ShippingMethod: Calculate shipping price per categories

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hey,
I have created four categories, with products which are part of one of those categories.

I want to add a fixed price for the shipping method based on the products in my cart. Lets say a customer has a product of categorie 1-3 in his cart, then I want to add 10$ to the shipping cost. If the customer has a product of category 4 in his cart, I want to add 5$. If products of categorie 1-3 AND 4 are in the basket, I want to add both fixed rate, so the shipping costs should be 15$.

Is there any way to achieve this out of the box? Or do I need to implement a new shipping method for this?
6 years ago
It can't be done out of the box. Shipping Director can do it:

10    Decimal     BaseRate    0.0
20    Decimal     BaseRate    [BaseRate] + (Items.Any(Product.HasCategory("x") or Product.HasCategory("y")) ? 10.00 : 0)
30    Decimal     BaseRate    [BaseRate] + (Items.Any(Product.HasCategory("z")) ? 5.00 : 0)

100   Option      Shipping    true  [BaseRate]

The " ? : " is an if-then-else operator.

To make for easier maintenance, I would suggest that you set up new shipping related categories, and mark them as unpublished (i.e. uncheck "Published" check box).  E.g. "Shipping 10.00", etc.  If the category is unpublished, you can still put products in the category, but it won't appear in the category navigation tree or elsewhere.   Products can be in more than one category.


(There is also a Product.HasParentCategory()  )
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.