cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

java code for calculate totals option in hmc/backoffice at cart

Former Member
0 Likes
689

Hi experts.. we have an option in hmc and backoffice to recalculate totals in cart.. What is the method name for this in business layer? is that the calculateTotals(cartModel) in the DefaultCalculationService? I need to call the exact same method in my business logic to calculate totals.. my webservice call isnt picking product level discounts, so i had to insert the discountvalues list in the cart entry.. The prices have to be refreshed after this list insertion in entry..

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Likes

Hello

I’ve confirmed that when you use “Recalculate order totals” button you’re calling for

 public void calculateTotals(final AbstractOrderModel order, final boolean recalculate)

method.

This method call another method:

 calculateTotals(final AbstractOrderModel order, final boolean recalculate,
 final Map<TaxValue, Map<Set<TaxValue>, Double>> taxValueMap)

This method calculates all totals. This does not trigger price, tax and discount calculation but takes all currently set price, tax and discount values as a base. For more information refer to de.hybris.platform.order.impl.DefaultCalculationService

I confirmed that’s product level discounts are used in calculating and that total price field is changing.

This might help you as well:

https://wiki.hybris.com/display/release5/Ordering+Process#OrderingProcess-CalculatedAttributeandCalc...