Uniplan Posted October 14, 2020 Share Posted October 14, 2020 Hello, I have an order in which a discount voucher has been partially used I would like to know in which table this information is saved. In other words, I would like to know where the amount that I have highlighted in the figure is saved. Thank you. Greetings. Antonio. Link to comment Share on other sites More sharing options...
Rachit Agarwal Posted October 14, 2020 Share Posted October 14, 2020 All discounts define in ps_cart_rule table with how much price or percent will be applied. and the relation between order and this cart rule comes under ps_cart_cart_rule. Link to comment Share on other sites More sharing options...
idnovate.com Posted October 14, 2020 Share Posted October 14, 2020 But this value is stored in fields total_discounts, total_discounts_tax_incl, total_discounts_tax_excl from table ps_orders. Link to comment Share on other sites More sharing options...
Rachit Agarwal Posted October 14, 2020 Share Posted October 14, 2020 (edited) 4 minutes ago, idnovate.com said: But this value is stored in fields total_discounts, total_discounts_tax_incl, total_discounts_tax_excl from table ps_orders. yes, at the time of order creation, values are being calculated according to applied discount as per the ps_cart_rule table and stored in ps_orders to reduce the joins and recalculation everytime while fetching order details. So if we want the original discount information from where it is calculated, that is in ps_cart_rule and calculated amount is in ps_orders. Edited October 14, 2020 by RachitAg03 (see edit history) Link to comment Share on other sites More sharing options...
Uniplan Posted October 14, 2020 Author Share Posted October 14, 2020 29 minutes ago, RachitAg03 said: All discounts define in ps_cart_rule table with how much price or percent will be applied. and the relation between order and this cart rule comes under ps_cart_cart_rule. But in this table I find the total value of the coupon not the amount actually used Link to comment Share on other sites More sharing options...
Rachit Agarwal Posted October 14, 2020 Share Posted October 14, 2020 2 minutes ago, Uniplan said: But in this table I find the total value of the coupon not the amount actually used As i said in my last quote 27 minutes ago, RachitAg03 said: yes, at the time of order creation, values are being calculated according to applied discount as per the ps_cart_rule table and stored in ps_orders to reduce the joins and recalculation everytime while fetching order details. So if we want the original discount information from where it is calculated, that is in ps_cart_rule and calculated amount is in ps_orders. as @idnovate.com said 31 minutes ago, idnovate.com said: But this value is stored in fields total_discounts, total_discounts_tax_incl, total_discounts_tax_excl from table ps_orders. So to get the actual amount you should go for ps_orders table. 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