Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
Display coupons used on checkout?
Posted: 05 August 2010 12:19 PM   [ Ignore ]
Wallflower
Rank
Total Posts:  12
Joined  2010-06-25

I’d like to display coupons used on the checkout:
So the checkout would contain a line saying something like “Discount: £40 (COUPON3456)”

Is there a tag for this or should I do I need to do some PHP coding smile?

Profile
 
 
Posted: 05 August 2010 12:21 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Yes, you’ll have to do some php coding, we haven’t really gotten around to making comprehensive tags for coupons.

Profile
 
 
Posted: 14 September 2010 12:58 AM   [ Ignore ]   [ # 2 ]
Has a Nice Profile
RankRank
Total Posts:  171
Joined  2010-03-01

Just got this reponse -

<?php var_dump($_SESSION['cartthrob']['coupon_codes']); ?> (use foreach) 
Profile
 
 
Posted: 14 September 2010 01:08 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10256
Joined  2008-09-29

IF we’re keeping score… that was me. The post above just contains a rough idea of where to find the coupon codes in the session. Don’t actually use it, because a var_dump is really for debugging, and won’t allow you to do any formatting.

Below however is a more flushed out version:

<?php 
if (!empty($_SESSION['cartthrob']['coupon_codes']))
{
    
foreach($_SESSION['cartthrob']['coupon_codes'as $key=>$item)
    
{
        
//this is the coupon code
        
echo $item
    
}
}
?> 
[ Edited: 14 September 2010 03:56 AM by Chris Newton ]
 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 14 September 2010 03:38 AM   [ Ignore ]   [ # 4 ]
Has a Nice Profile
RankRank
Total Posts:  171
Joined  2010-03-01

I get a non rendered basket with this code. The rest of the page renders fine though..

Profile
 
 
Posted: 14 September 2010 03:57 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10256
Joined  2008-09-29

Whoops. Forgot a parentheses. Take a look at the corrected version below. (corrected the version above too… in case anyone else tries to use it)

<?php 
if (!empty($_SESSION['cartthrob']['coupon_codes']))
{
    
foreach($_SESSION['cartthrob']['coupon_codes'as $key=>$item)
    
{
        
//this is the coupon code
        
echo $item
    
}
}
?> 
 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 23 November 2010 06:39 AM   [ Ignore ]   [ # 6 ]
Is a Really Great Dancer
RankRank
Total Posts:  80
Joined  2010-06-22
Chris Newton - 14 September 2010 03:57 AM

Whoops. Forgot a parentheses. Take a look at the corrected version below. (corrected the version above too… in case anyone else tries to use it)

<?php 
if (!empty($_SESSION['cartthrob']['coupon_codes']))
{
    
foreach($_SESSION['cartthrob']['coupon_codes'as $key=>$item)
    
{
        
//this is the coupon code
        
echo $item
    
}
}
?> 

From the above, it sounds like you can use multiple coupons if you order multiple items. In my tests, even when I order multiple products, only one coupon is applied.

Can multiple coupons be used on one order?

Thanks.

Profile
 
 
Posted: 23 November 2010 11:11 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Currently, no. There is some underlying architecture there to help support multiple coupons, but it’s by no means complete.

Profile
 
 
Posted: 23 November 2010 04:44 PM   [ Ignore ]   [ # 8 ]
Is a Really Great Dancer
RankRank
Total Posts:  80
Joined  2010-06-22
Rob Sanchez - 23 November 2010 11:11 AM

Currently, no. There is some underlying architecture there to help support multiple coupons, but it’s by no means complete.

Thanks. I thought it was one coupon only but wanted to make sure.

Profile