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:  2933
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:  131
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:  7452
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 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 14 September 2010 03:38 AM   [ Ignore ]   [ # 4 ]
Has a Nice Profile
RankRank
Total Posts:  131
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:  7452
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 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

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:  2933
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