How to use the same Smart Subscribe button multiple times on the same webpage?

KristenRenee
Contributor
Contributor

Hello Paypal Community!

 

I wish to use the same Paypal Smart Subscribe button 3 times on my sales page. I have looked for the answer but I don't know anything about script and don't know what to use. If someone could help me know what script to put to use it 3 times I would greatly appreciate it. Let me know if you need anything from me. This is what I'm using so far:

 

<div id="paypal-button-container"></div>
<script src="https://www.paypal.com/sdk/js?client-id=ARZhqXJ9eDrT5aQraW87MAYFi_7kh99CoIqDnBUH4Xij5hY8wdPUbSJDafIA..." data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'subscribe'
},
createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': 'P-816959967J059280AMACLJOY'
});
},
onApprove: function(data, actions) {
alert(data.subscriptionID);
}
}).render('#paypal-button-container');
</script>

 

Thanks for the help, 

Kristen [removed]

Login to Me Too
1 REPLY 1

MTS_Chiranjeevi
Moderator
Moderator

Good day @KristenRenee,

 

Thank you for posting to the PayPal community.

 

In order to show/display all subscription smart buttons, please initialise the below script code only once in your website code. 

 

<script src="https://www.paypal.com/sdk/js?client-id=************&amp;vault=true" data-sdk-integration-source="button-factory" type="text/javascript"></script>

I request to please contact your website developer to update/modify your website code and initialise the above script code only once, so that all the subscribe smart buttons will be displayed/shown. 

 

Sincerely,

Chiranjeevi

PayPal/Braintree MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

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.