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.
   
 
Buy X Get X promo code not working
Posted: 04 July 2012 06:40 AM   [ Ignore ]
Has a Great Personality
Rank
Total Posts:  45
Joined  2011-06-27

Hi there,

I am looking to set up a promo code whereby if customers add 2 or more items to their basket, they can receive 20% off the total order.

I have set the purchased quantity to 2, and the percentage off to 20 (see screenshot attached).

Problem is when I submit, there is an error which says: You must add more items to use this discount.

Any ideas?

Many thanks
Simon

Image Attachments
promocode.gif
Profile
 
 
Posted: 05 July 2012 03:21 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10223
Joined  2008-09-29

You’d like it to work as a buy ANY 2 items and get X off. It doesn’t do that. It’s only a buy X of a specific qualifying entry id and get an amount off. What you want, I take it, is to buy X or more products of any kind and get a discount right?

We’d have to modify one of the existing plugins to do that. Wouldn’t take much effort though. I’ spent a few minutes making this. It’s untested, but you can try it out.

File Attachments
Cartthrob_discount_percentage_off_over_x_items.php.zip  (File Size: 2KB - Downloads: 23)
 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: 06 July 2012 12:31 AM   [ Ignore ]   [ # 2 ]
Has a Great Personality
Rank
Total Posts:  45
Joined  2011-06-27

Wow, thank you Chris!

How do I install this? (Sorry)

Profile
 
 
Posted: 06 July 2012 12:50 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10223
Joined  2008-09-29

file goes here: cartthrob > cartthrob > plugins > discounts

 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: 13 July 2012 03:05 AM   [ Ignore ]   [ # 4 ]
Has a Great Personality
Rank
Total Posts:  45
Joined  2011-06-27
Chris Newton - 06 July 2012 12:50 AM

file goes here: cartthrob > cartthrob > plugins > discounts

Thanks Chris, this works but only if I add two different items to the cart. If I add two of the same item, the discount use doesn’t work, and it doesn’t produce an error message.

Is there anything I can do?

Profile
 
 
Posted: 13 July 2012 02:26 PM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10223
Joined  2008-09-29

It’s not an error… so it won’t produce a message. It’s only looking at unique items in the cart. Is it your goal to look at quantities as well? If so, the plugin would need to be modified slightly.

 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: 13 July 2012 02:36 PM   [ Ignore ]   [ # 6 ]
Has a Great Personality
Rank
Total Posts:  45
Joined  2011-06-27
Chris Newton - 13 July 2012 02:26 PM

It’s not an error… so it won’t produce a message. It’s only looking at unique items in the cart. Is it your goal to look at quantities as well? If so, the plugin would need to be modified slightly.

Sorry Chris,  that’s my fault I didn’t explain it well.

Yes what I was after was quantities. So if the cart has 2 or more of any item (even just two of the same item), it would then allow the discount code.

 

Profile
 
 
Posted: 17 July 2012 05:32 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10223
Joined  2008-09-29

In the discount plugin, change


  $count = count($this->core->cart->items());


to

$count = $this->core->cart->count_all();

 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 July 2012 01:30 AM   [ Ignore ]   [ # 8 ]
Has a Great Personality
Rank
Total Posts:  45
Joined  2011-06-27

Perfect, thank you very much Chris

Profile