In the current version of Tea Commerce the shipping and payment calculators doesnt not recalculate on a finalized order. We have changed that in the version that runs the Marketing module for Tea Commerce. But there is some time until we release this. I think you can override the order calculator and then call every method of the base order calculator.
My mistake, the order calculator is being called when an order is updated in the back-end.
Can you elaborate on what I need to do here to incorporate my shipping calculator code because I'm a bit confused? What I should override and where I should insert my logic.
You should call these methodsn your calculate order method. Now everything will be recalculated at all times. You might want to not calculate the vat rate when the order is finalized. But you decide :)
CalculateVatRate( order ); CalculateOrderLines( order ); CalculateSubtotals( order ); CalculateShippingCosts( order ); CalculatePaymentCosts( order ); CalculateTransactionCosts( order ); CalculateTotals( order );
Editing a finalised order in the Tea Commerce UI does not fire the Custom Shipping Calculator
I've created a custom shipping calculator by overriding:
I've not bothered to override the method for when there's no order.
I'm using to price up the shipping based on the total weight of the cart, it works well.
Here's an order for one items, you can see the calculated weight and shipping cost.
Here's an order for three items, you can see the increase in weight and shipping cost.
Look what happens though when I edit the first order and increase the quantity from 1 to 3 and save it.
You can see all the totals get updated but the weight and shipping cost does not get recalculated.
The Shipping Calculator does not get fired.
Regards,
Matt
Hi Matt
In the current version of Tea Commerce the shipping and payment calculators doesnt not recalculate on a finalized order. We have changed that in the version that runs the Marketing module for Tea Commerce. But there is some time until we release this. I think you can override the order calculator and then call every method of the base order calculator.
Kind regards
Anders
You mean like this?
Cheers, Matt
What do you mean here because the OrderCalculator does not seem to get fired either?
Could you check if it runs at all. Just to check that it has registered the custom calculator.
Kind regards
Anders
Hi Anders,
My mistake, the order calculator is being called when an order is updated in the back-end.
Can you elaborate on what I need to do here to incorporate my shipping calculator code because I'm a bit confused?
What I should override and where I should insert my logic.
Regards, Matt
You should call these methodsn your calculate order method. Now everything will be recalculated at all times. You might want to not calculate the vat rate when the order is finalized. But you decide :)
CalculateVatRate( order );
CalculateOrderLines( order );
CalculateSubtotals( order );
CalculateShippingCosts( order );
CalculatePaymentCosts( order );
CalculateTransactionCosts( order );
CalculateTotals( order );
Kind regards
Anders
Thanks Anders,
Nice and simple and working.
Cheers, Matt
is working on a reply...