- Issue created by @c_archer
- π¬π§United Kingdom c_archer Cumbria
For example this is the promotion.
In this instance is should be Β£5.75 for shipping:
In this example it should be Β£8.32:
- πΊπΈUnited States rszrama
Generally speaking, this is a perfect case for a custom
PromotionOffer
plugin, because the UI to support every possible permutation of "only give free shipping for some products" would be quite unwieldy. The primary way I could see Commerce Shipping supporting this right now would be for stores using theFlatRatePerItem
shipping method type, since we can easily recalculate the rate from the offer after filtering out specified items from the shipment before counting the quantity.My proposal would be something like this:
- Define a new
ShipmentFixedAmountOffPerItem
andShipmentPercentageOffPerItem
promotion offers. - The idea is that these will calculate either a fixed or percentage based discount off of the price per item as set in the shipping method configuration.
- When calculating the discount amount, the plugin will basically need to determine how many items on the shipment should be discounted, sum up the total of the discount, and apply it as an adjustment.
- The primary option for determining how many items to discount should be an "Item matching method" radios with options labeled:
- "Charge full price for a specified quantity of items", which then prompts you to enter the number of items that should be discounted. This number could be 0 or greater, meaning you could use this for a free shipping method based on shipping per item.
- "Discount the shipping per item for specific products", which then prompts you to select a "Product matching method" of "Any of the following" vs. "Any except the following", and has you reference products via a multi-value autocomplete.
- "Discount the shipping per item for specific product variations", which is like the above but at the variation level.
This would give you the tools you'd need (assuming you're calculating the shipping rate by item quantity) and be flexible enough for other scenarios, especially the idea of giving free shipping on a subset of the product catalog but still charging for other items. This won't really help folks just using a flat rate for the whole order, but that's where a custom promotion offer plugin comes in.
- Define a new