Granting a Shipping Discount Based On an Item in the Cart (screencast)

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.

Posted November 28, 2011

Comments

Submitted by Andre Crone (not verified) on

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

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <br>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
X
In 2019 Commerce Guys rebranded to Centarro.

Change is at the center of eCommerce, but our team and mission remain the same.

Our consulting, development, and support offerings apply our expertise to help you adapt to change and grow.

Find us now at: https://www.centarro.io