In this screencast I'll show how to offer a shipping discount based on whether a particular item is in the cart.
- Create a baseline shipping service. I use "Flat rate shipping" for $10.00.
- Add a "Calculation Rule" with three conditions and one action
- Condition: Entity has field "commerce_shipping_service", to bring the shipping service field into scope.
- Condition: Data comparison commerce_line_item:commerce_shipping_service = "Flat Rate".
- Condition: Order contains a product, product SKU = "NINETYNINE", the SKU of my demonstration product.
- Action: Subtract an amount from the unit price (and subtract 500, or $5.00)
In real life you may want to add an extra condition to check that the line item unit price is greater than 500 before subtracting from it, as we don't want to be giving them money.
Shipping Discount for Item in Cart using Calculation Rules from Randy Fay on Vimeo.
Comments
Can you use wildcards for the SKU comparison?
Thanks for just another great screen cast. These have really helped me with setting up shipping.
My only issue is that I have a lot of comparable SKU's that I want to use in the calculation rule. These SKU's all have the same start. Is it possible to test against something like DFF-34-* where * is some sort of wild card? That we you don't have to create to rule for every specific SKU.
Add new comment