Jump to content

[solved]BO AdminOrders price calculation difference between ps1.3.1 and 1.3.6 when viewing order details


Recommended Posts

Hi, I just upgraded from ps1.3.1 to ps1.3.6 ,
I see there are a few extra columns in ps_order_details (specially these reduction_percent and reduction_group )
I am trying to find where in the code (in BO AdminOrders) is calculating (and how) the final price, let me explain
I have product A with price 11.000$ with a percent_discount of 15% and a customer who is buying it has a group reduction of 30%, in FO I managed to apply the biggest reduction , in this case 30%, so the final price is 7700$ , the order is saved with total = 7700 but the detail is saved with price 11000 and percent_reduction 15% and group_reduction 30%,
so that when I see the order in BO the total of the order is shown correctly (7700$) but in the product detail shows a price of 6545$ ( which is 11000$*0.7(group_reduction)*0.15(percent_reduction)), so in BO is applying both reductions to get the final price

Anybody could give a hint about this, I couldnt find the code in BO which is doing this



Share this post

Link to post
Share on other sites

I think I found part of the "problem"
I /classes/Order.php in method Order::getProducts() there is a call to another method Order::setPricess , which is recalculating the prices to show in BO
The other difference is in /classes/PaymentModule.php the method PaymentModule::validateOrder() is saving the product price without the reductions applied in FO , so I guess thats all I need to change to maintain my desired price calculation behavior

  • Like 1

Share this post

Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More