Please Note: We are no longer using forums to facilitate standard support. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Promo code hack

  1. For all of you looking to use promo codes....

    Using the new conditional logic, I've implemented a basic promo code system. I create a product with a negative dollar amount and show it if the promo code field equals a given value. It's manual, but works for me!

    Posted 3 years ago on Friday March 2, 2012 | Permalink
  2. How do you make the promo code field?
    Is it possible to make the value a word?

    This could be the coupon work around everyone is looking for in gravity forms.

    Posted 3 years ago on Wednesday March 7, 2012 | Permalink
  3. on the negative product I set a condition to show when the promo code field equaled a specific value. I set the value as the promo code such as freeship20. You can use any alphanumeric value.

    Posted 3 years ago on Wednesday March 7, 2012 | Permalink
  4. Simple coupon work around.
    Thanks brianmayer

    Step 1:

    Create a "Single Line Text" field.
    name it Enter Coupon Code (or whatever field name you want)

    Step 2:

    Create A "Product" field under the pricing tab.
    Name it "Product without coupon" (for illustration purposes)
    Set the price to $100
    Disable Quantity Field
    Enable Conditional Logic
    Setup for "Hide" this field if "All" of the following match
    Select "Enter Coupon Code" from the drop down menu and select "is".
    then enter testcoupon in the text field.

    Step 3:

    Create another "Product" field under the pricing tab.
    Name it "Product with coupon" (for illustration purposes)
    Set the price to $90 or a negative amount
    (This is the discounted price or 10% off or $10 off or whatever you are promoting)
    Disable Quantity Field
    Enable Conditional Logic
    Setup "Show" this field if "All" of the following match
    Select "Enter Coupon Code" from the drop down menu and select "is".
    then enter testcoupon (for illustrations purposes) in the text field.

    Thats it : ) Entering the coupon will change the price with an animation. This has nothing to do with paypal, only the final product showing will be taken to checkout.

    The long awaited simple coupon workaround : )
    More can be done with this, just think...

    Posted 3 years ago on Wednesday March 7, 2012 | Permalink
  5. Great workaround! But how would this work for quantities? Would only $10 be taken off a $300 order? Is there any way to do a percentage?

    Posted 3 years ago on Wednesday March 7, 2012 | Permalink
  6. Well the basic idea is just an illusion that the promo code is giving you a discount (to the customers eye) when in reality the products are just switching places. So technically you can set the discounted price to anything you were promoting, So for example if you wanted to do 50% of $1488 set the first product to $1488 and the second product to $744 (50% off) and entering a coupon code will hide $1488 and show $744.

    Posted 3 years ago on Thursday March 8, 2012 | Permalink
  7. cthorpe
    Member

    While this works, the coupon is visible in plain text in the source code. That is, obviously, not ideal.

    For example, with a coupon of 10off, you can find this in the source:

    [{"fieldId":"2","operator":"is","value":"10off"}]}

    C

    Posted 3 years ago on Thursday March 8, 2012 | Permalink
  8. red
    Member

    Agree that showing coupon codes in the source code is not ideal. Was able to work out a way to add valid codes as a radio button selections in the form editor, set it to admin-only, and retrieve them with ajax for validation against a coupon code input.

    Any feedback on ways to improve on this approach appreciated!

    Was blocked from posting my outline of steps, so did a pastebin of the steps here:
    http://pastebin.com/Bi577HTi

    Pastebin links to code in step 3 and 4.

    Unresolved issues:
    If post the form and there are errors, coupon code field won't update when edited

    Posted 3 years ago on Thursday May 17, 2012 | Permalink
  9. red
    Member

    When I went to make the above changes live, worked fine with a pay by check option, but found that PayPal Standard (using the gf add-on) doesn't like negative numbers.

    Found this:
    http://www.gravityhelp.com/documentation/page/Gform_paypal_query

    but since I'm also using early bird discounts and sometimes passing up to 3 negative values, it didn't work for this, it was only taking off the last value.

    So used the idea of the PayPal example hook and function, but redid it to remove all negative values from the query string. It checks if there are negative values, and if so, combines all items it one 'registration total' with a grand total. So looks like an aggregate but is becoming one product. If there aren't any negative values, it just sends on as usual.

    Here's the code: http://pastebin.com/FwTSNrT5

    If there's a better way to approach this, please post back!

    Posted 3 years ago on Sunday May 20, 2012 | Permalink
  10. red
    Member

    Actually, completely reworked this. Now, it takes advantage of PayPal's discount_amount_cart field.

    http://pastebin.com/WgC9vwD2

    Doesn't compile into one 'Registration Total' item. Instead:
    - keeps all non-negative items as is
    - adds up discount and coupon items
    - clears out those discount and coupon items and $0 value items from the cart
    - sends to PayPal only non-negative cart items and one grand total discount amount for the cart

    This way you still get itemized checkouts and receipts and can show the discount separate, without passing negative numbers.

    Posted 3 years ago on Sunday May 20, 2012 | Permalink
  11. Slightly kludgey, works great. My kinda solution, there.

    Posted 3 years ago on Friday June 8, 2012 | Permalink
  12. Good work around. Really need native support for this built into GF.

    Posted 3 years ago on Thursday June 21, 2012 | Permalink
  13. Nice work! Thank you so much!! I have been needing this.

    Posted 3 years ago on Saturday June 30, 2012 | Permalink
  14. red
    Member

    The PayPal add-on supports discount fields now, so the update_paypal_query is no longer necessary to add to the theme's functions file when using PayPal. The promo code / coupon code stuff outlined above that still functions as needed.

    Posted 2 years ago on Thursday May 2, 2013 | Permalink

 

Support Tickets

Open A New Support Ticket
 Open A New Priority Support Ticket *

* Developer license holders only