Jump to content

Make Voucher NOT cumulative with itself


Recommended Posts

Hi,

I have a problem with a voucher and cannot find any solution in the forums.


How do I make a voucher that is cumulative with other vouchers but not with itself?

Currently I have a voucher that gives 10% off to everyone, but if I enter cumulative with other vouchers, then I can enter the voucher code over and over again and it keeps taking an additional 10% off.

Please help.

Link to comment
Share on other sites

This will only allow the user to use the code once and never again, or is that a wrong assumption???

I need them to be able to use it once per order but they can order 30 times and for every one of those orders, they can use the discount.

Link to comment
Share on other sites

  • 2 months later...

in classes/Cart.php

l:816

            
foreach ($discounts as $discount)
   if (!$discount['cumulable']){
     return Tools::displayError('previous voucher added isn\'t cumulative with other discounts');
   } else {
       if($discountObj->name == $discount['name']){
               return Tools::displayError('you cannot use this voucher anymore (usage limit attained)');
       }
   }



it compare voucher's name with vouchers already registred and if it's the same it return an error.

Link to comment
Share on other sites

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...