Overriding DeliveryCost calculation on Litium 8

How to override the calculation of delivery cost on Litium 8? The customer wants to calculate shipping price depending on a couple of parameters like weight and volume of the products in cart. I saw in a previous forum post that this could be done by decorating the DeliveryCostCalculator, but that was for Litium 7.

Litium version: 8.1.2

The ability to use custom fees for shipment and payment options is added in 8.1.3 that was released today.

Example to set the shipping fee to 1000.

var cartContext = HttpContext.GetCartContext();
await cartContext.SelectShippingOptionAsync(new SelectShippingOptionArgs
{
    ShippingOptionId = shippingOptionId,
    Fee = 1000m
});

Example to set the payment fee to 100.

var cartContext = HttpContext.GetCartContext();
await cartContext.SelectPaymentOptionAsync(new SelectPaymentOptionArgs
{
    PaymentOptionId = paymentOptionId,
    Fee = 100m
});
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.