Generating a coupon for my subscriptions button

Amosss
Contributor
Contributor

Hi

 

I have a subscription button with 2 options (monthly, yearly).

I want to add the option for a coupon so the user will receive X% discount for the first payment.

I read here: https://www.paypal.com/il/smarthelp/article/how-do-i-create-a-discount-code-or-coupon-code-for-my-pa... but the steps are not similar to what I see in paypal itself.

 

Am I missing something?

Thanks!

 

Login to Me Too
2 REPLIES 2

sharpiemarker
Esteemed Advisor
Esteemed Advisor

@Amosss 

 

Skip step #8, just copy the code onto your website to edit the code. You don't have to edit it right in the button code box. It probably won't let you anyway.


Kudos & Solved are greatly appreciated. 🙂
Login to Me Too

Amosss
Contributor
Contributor

I think I got the hang of it but from reading the explanation afterwards, it looks like all the code is visible to the user if he does "show page source" so he will know what coupons are available.

 

What am I missing?

<script type="text/javascript">
<!--
var discnt = 0; // no default percent discount

var coupons = new Array ( // place to put coupon codes
"coup1", // 1st coupon value - comma seperated
"coup2", // 2nd coupon value - add all you want
"coup3" // 3rd coupon value
);
var coupdc = new Array ( // place to put discounts for coupon vals
5,
10,
15
);
var coupval = "(blanket)"; // what user entered as coupon code

function ChkCoup () { // check user coupon entry
var i;
discnt = 0; // assume the worst
for (i=0; i<coupons.length; i++) {
if (coupval == coupons[i]) {
discnt = coupdc[i]; // remember the discount amt
alert ("Valid coupon number! \n\n" + discnt +
"% discount now in effect.");
return;
}
}
alert ("'" + coupval + "' is not a valid code!");
}
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.