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="https://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="https://www.e-junkie.com/ej/x-click-butcc.gif" border="0" alt="Buy Now"/></a>