Share via E-Mail
Share on Google Buzz
Share on Twitter
Share on Facebook
E-junkie Blog
E-junkie FaceBook Page
E-junkie @ Twitter

How to make a button that automatically applies a discount code

While it's possible to create an automatic discount by just configuring the discount with a blank Discount Codes field, so any order meeting the Min. Item Total and Quantity thresholds would get the discount, sometimes you may want a discount that only gets applied automatically when the buyer clicks specific Cart or Buy Now buttons. This can be done by adding the discount code inside the button code itself.

Add to Cart buttons

Just add &discount_code=YOURCODEHERE to the Cart button's href= URL, like so:

<a href="https://www.e-junkie.com/ecom/gb.php?c=cart&i=XXXXXX&cl=YYYYYY&ejc=2&discount_code=SPECIALSALE" target="ej_ejc" class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this);"><img src="http://www.e-junkie.com/ej/ej_add_to_cart.gif" border="0" alt="Add to Cart"/></a>

Buy Now buttons

First, bear in mind that Buy Now buttons can only work with certain types of discount. You can put the discount code in a Buy Now button by adding &on0=Promotion&os0=YOURCODEHERE to the Buy Now button's href= URL, like so:

<a href="https://www.e-junkie.com/ecom/gb.php?i=XXXXXX&c=single&cl=YYYYYY&on0=Promotion&os0=SPECIALSALE" target="ejejcsingle"><img src="http://www.e-junkie.com/ej/x-click-butcc.gif" border="0" alt="Buy Now"/></a>

This page added by E-junkieGuru on May 17th, 2011 @ 3:36 pm GMT -7
Updated by E-junkieGuru on May 17th, 2011 @ 3:37 pm GMT -7
  • Questions?
    Feel free to contact us if you don't find an answer in our Help pages or our Forums.

    If you just want to enquire about what all E-junkie does, you can check our feature list.
30 Day Money Back Guarantee
PayPal Certified Integration
Google Checkout Certified Integration
Slam the Online Scam