We have a custom price adjuster to handle our volume discounts for certain products. Which works just fine. We also have a custom shipping rule of <£100 is X amount for shipping, Anything above that is free which we have set as a rule in the shipping methods.
We have a few cases where the volume discount would drop the customers order below £100 so technically they should pay the shipping but the calculator isn’t picking this up and is giving free shipping. Not sure how to handle this and make it so the shipping calculator is aware of our custom discounts? I’ve looked into a custom shipping calculator but not sure where to start with this!
I would need to see the code of your shipping calculator but my guess is you are calculating the shipping based upon the price properties on the order rather than reading from the current ShippingCalculatorContext.OrderCalculation. See the docs here on the Order Calculation State Order Calculation State | Umbraco Commerce
We’re just using the standard shipping no custom calculator currently. So I would need to write a custom shipping calculator and make sure it’s taking from the Adjusted Price?
Ahh, actually, I know what the issue is. I think this has been raised before and something that we need to look into.
The problem is we currently calculate the whole order and then apply the discounts at the end, but that means the shipping calculator doesn’t see the adjustments because they haven’t been applied yet. We need to look at updating the order calculation pipeline to calculate the order subtotal including discounts prior to the shipping calculation phase. Unfortunately this is a big task and so needs further investigation.
So unfortunately the shipping calculator can’t currently see the adjustments
Ah I see, rather than using a price adjuster then is there a workaround where possibly we can adjust the unit price being added to the cart before this?