Gravity Forms Coupons: Exclude Shipping

Exclude the shipping price when calculating coupon discounts with the Gravity Forms Coupons add-on.

Stop! There's a better way.

This snippet is available as a plugin with Gravity Perks, a suite of over 47 premium Gravity Forms plugins!

View Plugin Buy Gravity Perks

This ensures that the shipping cost is always paid and never discounted. No configuration required! Just download, install and activate this plugin; the functionality will apply automatically to all coupons, for all forms.

Why is this needed?

By default, Gravity Forms does not exclude the shipping price from coupon discounts. This means if you have:

  • a coupon for 50% off
  • a product that costs $100
  • and a shipping fee of $10

…the discount amount would be $5.50. If you exclude the shipping price, the discount amount would be $5.00.

Example with a Flat Coupon

If you have:

  • a flat-rate coupon for $50 off
  • a product that costs $25
  • and a shipping fee of $10

…the discount amount would be $35 and the form total would be $0. If you exclude the shipping price, the discount amount would be $25 and the form total would be $10.

Comments

  1. Thomas Secher
    Thomas Secher March 12, 2018 at 11:11 am

    Would it be possible to set a 0 EUR/USD value on a discount code and then use your discount add-on when discount code is set to something specific? It isnt possible to set coupon to be 0 EUR/USD in Gravity Forms add-on but could that be accomplished in an easy way so that I can control discount with your add-on instead?

    Reply
    1. David Smith
      David Smith Staff February 21, 2015 at 7:40 am

      Hi there, I’ve sent you an email requesting more details. I wasn’t able to recreate this on my end so I’ll need more details to debug.

  2. Mario Hennenberger
    Mario Hennenberger February 8, 2015 at 11:04 am

    great work .. is it possible to use “another” custom field” to exclude instead of the shipping ?

    i have a field called “pickup price” .. which is pretty much the same .. but its not counting as a shipping field …

    Reply
    1. David Smith
      David Smith Staff February 8, 2015 at 4:56 pm

      Hi Mario, it is possible to exclude a specific product from the coupon discount; however, it is not a simple enough process that I can readily explain it. The best I can do right now is direct you to the plugin code and suggest that you replace the shipping price everywhere it is retrieved with the price of your product. I admit, it isn’t a simple task…

  3. Jordan
    Jordan February 4, 2015 at 2:44 pm

    Hi David,

    Thanks for sharing your knowledge. I have an issue that seems to require an opposite solution. I have a form that lists multiple books with different pricing and shipping fees. I’d like to have a coupon code that simply removes shipping fees for those who enter it. Since the shipping fees vary, and coupon codes only deduct % or flat rates, can you think of a clever way to dynamically remove shipping fees for one ore more books that are selected?

    Thank you! JC

    Reply
    1. David Smith
      David Smith Staff February 6, 2015 at 5:41 pm

      Hi Jordan, I wish there was a simple solution I could offer you but this would require a decent bit of custom code. If you’re interested in commissioning the functionality, I’d be happy to cook something up for you. Get in touch.

  4. Cindy
    Cindy December 30, 2014 at 2:21 pm

    This doesn’t make any sense to me?

    a coupon for 50% off a product that costs $100 and a shipping fee of $10

    Wouldn’t that be $50 after the 50% discount? Usually the shipping is unaffected with just the coupon code.

    Also in the flat rate example:

    a flat-rate coupon for $50 off a product that costs $25 and a shipping fee of $10

    The $50 off coupon would result in owing the purchaser $25 for a $25 product. I must just not be understanding this.

    In any case, my form found on page http://billmayer-saddles.com/order-bms-motorcycle-seat-now/ appears to do what the exclude shipping with coupon should do, but the shipping appears when the user gets to paypal. I could use some help because we are going to be offering 10% off and no shipping for a New Year Day special.

    Reply
    1. David Smith
      David Smith Staff January 5, 2015 at 10:59 pm

      Hi Cindy,

      To clarify, this plugin excludes the shipping from the form total when the coupon discount is calculated. By default with Gravity Forms, the shipping IS included with the form total when the coupon discount is calculated. So a $100 product a shipping fee of $10 would give you a total of $110 and a 50% discount of $55 rather than the expected $50.

      In the flat rate example, the seller would never owe the buyer money. At most, a coupon can simply bring the total to $0. The issue is since the shipping fee is included in the discounted amount (again, default behavior for Gravity Forms), the flat rate discount can provide unintended free shipping.

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.

Download Plugin

Gravity Forms Coupons: Exclude Shipping

This field is for validation purposes and should be left unchanged.