Jump to content

Cart rule (Vouchers)


Saraaa

Recommended Posts

Hello ,

So I did ask before about this problem I'm having with cart rule 

Now I am a bit more aware in wich case the problem is occuring 

My problem is that I am creating cart rules for a big group of people each one have one cart rule that can be used partially,  with free shipping option, the cart rule value is an amount with tax.

And when a customer buy products from my shop and use the cart rule, so the problem accures when the cart rule has the exact value of the total products in the order what happens is that when i go to the order in the BO I find the reduction amount but there is no information that shows which cart rule was used.

in the Data Base the reduction amount exist in the table ps_orders but there is no line of this order in the table ps_order_cart_rule  and the cart rule can be always used because no update happend to the table ps_cart_rule. 

I want to know how cart rule works and how can I fix it, Pleaseeee???

PS: I attached the screenshots of a test I did my self 

I have two prestashop 1.6.1.6 and 1.6.1.23 and the probleme is acuring in both

Cart_rule1.PNG

Cart_rule2.PNG

Cart_rule3.PNG

Order1.PNG

Order2.PNG

Order3.PNG

Cart_rule4.PNG

Edited by Saraaa (see edit history)
Link to comment
Share on other sites

Hello, Salamo 3likom

This problem due to the $values['tax_incl'] contain also shipping value, so we must decrease the shipping value

Prestashop => classes => PaymentModule.php => in if statement ligne 533 :

change  && $values['tax_incl'] > ($order->total_products_wt - $total_reduction_value_ti) &&

 

to 

 

 && ($values['tax_incl']-$order->total_shipping_tax_incl) > ($order->total_products_wt - $total_reduction_value_ti) &&

 

Enjoy 😄

  • Haha 1
Link to comment
Share on other sites

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...