OrderCarrier has no Discount in DeliveryCostCalculator

We have a DeliveryCostCalculator that overrides the default provided by litium. For some reason the orderCarrier have no discounts in it.

How do we force the orderCarrier to include all the discounts?

The DeliveryCostCalculator is the first calculator that is executed when the IOrderCalculator is executed. See https://docs.litium.com/documentation/previous-versions/litium-5/litium-documentation/sales/pricing_rules_1/calculating_order_grand_total

To force the the order carrier to have the campaign prices is not anything that I can recommend because of that the campaign engine may need the campaign prices to be able to set an delivery discount or that your campaign action is depend on the order total that includes the delivery fee.

If you anyway want to change it you should implement your own IOrderCalculator with the business rules that is needed for your project.

Our DeliveryCostCaluculator sets the delivery cost to 0 when above a specified threshold.

When the total price is below this threshold than the delivery cost gets set to 0 before the campaign calculation. The issue occurs when the Campaign calculated price yields a total price that goes above the threshold. This should result in the recaclculation of the delivery costs yielding a delivery cost above zero again. But this is not the case with the delivery cost remaining 0.

Our DeliveryCostCalculator is just an override of the existing DeliveryCostCalculator. Perhaps our override is incorrect, but we expect to see the calculated campaign price here, which we don’t.

Any thoughts on how we might resolve this?

Sounds that you not should overwrite the DeliverCostCalculator and instead implement your reducing of deliver cost as a campaign action. If you anyway want the dlivery calculator to execute after the campaign engine you need to update the IOrderCalculator, but you will not be able to use delivery campaign actions in that case. And the change for the delivery price can reflect on the order total that make another campaign action to not qualify and then you have created a small loop.

We ended up just overriding the CampaignCalculator and resolving/calling the IDeliveryCostCalculator from it. That seemed to do the trick.