Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Alternate shipping prices

Vote:
 

Hi,

I am new to episerver commerce and I am working on a project that already has commerce installed and working. The website owner has asked me to look into the possibility of having a different shipping cost for some products in their store. By default all orders have the same shipping cost but some products could be more expensive to ship and some could have no shipping cost at all.

The way that the shipping is currently calculated involves a lot of custom code written by the previous development team but I am curious what is the standard way episerver commerce deals with shipping costs. Is there a way to have variable shipping costs with episerver commerce? Or do I need to write some more custom code?

#180620
Jul 17, 2017 17:00
Vote:
 

You could

  1. Add meta field to lineitem, mapping from your variant/product data model, that contains the shipping cost information
  2. Create a IShippingCalculator and override the methods you need to override (GetShippingCost, GetShippingItemsTotal?)
  3. In the IShippingCalculator, do your own logic checking the lineitems in the orderform/shipment
  4. Dependency inject your own implementation of the IShippingCalculator

Not sure it is the best episerver way, but it is an episerver way of doing it :) 

#180622
Jul 18, 2017 9:42
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.