Carpe_diem Posted February 15, 2023 Share Posted February 15, 2023 (edited) Hi, I working on a PS 1.6 and my client wants two vouchers which are depending on cart total. He wants me to set an automatic voucher to give 10% of for cart total below 100 € and for those above 100€ it should give a discount of 20%. The second voucher from 100€ and above is easy to setup as you set the minimum amount in the cart rules. How do I set a maximum amount for the first one? There is no field to enter a value. I have tried to set different priorities but it didn't work. Regardless what I do at the momem both vouchers are active if the cart total is 101 € and gives 30% of discount when it should only be 20%. I tried to add this to CartRule file if($cartTotal > 200) { $context->cart->addCartRule(101); } if($cartTotal < 200){ $context->cart->addCartRule(100); } The clients wants an automatic solution with no code. Can someone help me solve this Edited February 15, 2023 by Carpe_diem (see edit history) Link to comment Share on other sites More sharing options...
s4lvozesta Posted February 15, 2023 Share Posted February 15, 2023 4 hours ago, Carpe_diem said: The clients wants an automatic solution with no code. I should think at least there is need to create a module. cmiiw Or alternatively, create 2 vouchers: - voucher A can always apply 10% discount (for your case 1) - voucher B can only apply when cart is >100 (for your case 2) I am not sure it it would be 10%+10% or 20% of total cart though. Beside, not very convenient Link to comment Share on other sites More sharing options...
Carpe_diem Posted February 15, 2023 Author Share Posted February 15, 2023 (edited) 2 hours ago, s4lvozesta said: alternatively, create 2 vouchers: - voucher A can always apply 10% discount (for your case 1) - voucher B can only apply when cart is >100 (for your case 2) I am not sure it it would be 10%+10% or 20% of total cart though. Beside, not very convenient This what I have setup now and both are active as there isn't a maximum amount that is why I tried to add an if statement in the CartRule.php file but with no luck. Is there a hardcode solution? Or do you know for a module that will solve this? Edited February 15, 2023 by Carpe_diem (see edit history) Link to comment Share on other sites More sharing options...
s4lvozesta Posted February 16, 2023 Share Posted February 16, 2023 I have not personally use any of them below, but from this thread https://www.prestashop.com/forums/topic/255851-how-to-discount-based-on-number-of-total-items-in-cart-1541/ I found Quote By purchase amount : Discount by basket amount: 5% for a basket of 1000 to 1500 €, 10% for basket over 1500 € That could be interesting for you? Otherwise, I am afraid the last resort would be to develop a custom module 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