yay Posted August 22, 2014 Share Posted August 22, 2014 (edited) Is there any quick way to restrict customers from using more than one coupon code? I know about the "Compatibility with other cart rules" in the Conditions tab but that's really not a great option when dealing with hundreds of coupons. Quite time consuming to add a new coupon and then have to go through all the old ones and remove the new coupon from the compatibility setting. Could this for example be restricted in the checkout template or in some other neat way? Using v. 1.5.6. Edited August 25, 2014 by yay (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 22, 2014 Share Posted August 22, 2014 you can do it with phpmyadmin database manager in sql query tool run this query: UPDATE ps_cart_rule SET cart_rule_restriction = 1 Link to comment Share on other sites More sharing options...
yay Posted August 22, 2014 Author Share Posted August 22, 2014 you can do it with phpmyadmin database manager in sql query tool run this query: UPDATE ps_cart_rule SET cart_rule_restriction = 1 Thanks for the quick reply. This however doesn't seem to help, I can still combine coupons. And this would have to be done every time a new coupon is added right? Link to comment Share on other sites More sharing options...
PuntoSex Posted August 22, 2014 Share Posted August 22, 2014 Maybe not the best solution but you could make a module to hookshoppingCart and check how many cart rules the cart has, and remove all but one. The you may need to reload the page to see the modification. We have something similar to offer a gift choice to first time customers. Link to comment Share on other sites More sharing options...
PascalVG Posted August 23, 2014 Share Posted August 23, 2014 (edited) Seems you also have to remove the (new) cart rules that are written in ps_cart_rule_combination WARNING! Hacking your database can currupt it. Always backup before trying anything like SQL modifications/deletions!! DELETE FROM `ps_cart_rule_combination` WHERE `ps_cart_rule_combination`.`id_cart_rule_2` = 3" Where 3 is the new cart rule you added (change accordingly) or, when you dont want any cart rule mixed with any other, just remove them all here. DELETE FROM `ps_cart_rule_combination` BUT!!! Make sure you DO set the restriction to 1 (otherwise it ignores any restriction) UPDATE ps_cart_rule SET cart_rule_restriction = 1 (N.B. You could make a trigger, if you want to to automate this...) Hope this helps, pascal. Edited August 23, 2014 by PascalVG Added warning (see edit history) 1 Link to comment Share on other sites More sharing options...
yay Posted August 25, 2014 Author Share Posted August 25, 2014 Thank you Pascal, that did the trick! Will try and turn it into a trigger as well for automated use. Link to comment Share on other sites More sharing options...
Mickeel Posted October 31, 2014 Share Posted October 31, 2014 Have anyone tried this method on ps 1.6.0.9? Link to comment Share on other sites More sharing options...
TurkeyFish Posted May 19, 2018 Share Posted May 19, 2018 This works for me, but has anyone created a trigger for this? I'm not familiar with that but would like to run those queries that Prestashop Fanatic detailed above at any time a coupon code is created. I can do a daily cron job but it's best to do it right away on a trigger instead. Link to comment Share on other sites More sharing options...
ajensen27 Posted June 6, 2018 Share Posted June 6, 2018 On 5/19/2018 at 6:06 PM, TurkeyFish said: This works for me, but has anyone created a trigger for this? I'm not familiar with that but would like to run those queries that Prestashop Fanatic detailed above at any time a coupon code is created. I can do a daily cron job but it's best to do it right away on a trigger instead. Would also like to know how to set up a trigger for this solution. Tried and failed haha. Link to comment Share on other sites More sharing options...
ajensen27 Posted July 16, 2018 Share Posted July 16, 2018 BUMP Link to comment Share on other sites More sharing options...
Saraaa Posted May 14, 2019 Share Posted May 14, 2019 for the trigger you asked for in case any one needs it CREATE TRIGGER `trigger_name` BEFORE INSERT ON `ps_cart_rule` FOR EACH ROW SET new.`cart_rule_restriction`=1 Link to comment Share on other sites More sharing options...
aytunc Posted May 1, 2020 Share Posted May 1, 2020 On 8/22/2014 at 11:30 AM, vekia said: you can do it with phpmyadmin database manager in sql query tool run this query: UPDATE ps_cart_rule SET cart_rule_restriction = 1 Hi Vekia You are a life saver. Thankyou verymuch. works perfectly Link to comment Share on other sites More sharing options...
ruisonika Posted January 20, 2021 Share Posted January 20, 2021 Hello does anybody knows how to only allow voucher code per user...if i have used the voucher i cannot use anymore. In cart rules i've said that but it allows. Prestashop 1.6.1.17 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now