New to the community? Welcome! Please read our Community Rules and Guidelines
Hello, my question is probably quite basic but I couldn´t find any help for many hours.
I want to sell 3 different products on a webpage using the new stylish smart buttons instead of the old "buy now" buttons.
But only the first smart button will be shown, all others will be ignored.
How can I setup different IDs for the three products?
I have changed div ID and render ID but it didn´t help 😞
<div id="paypal-button-container"></div>
<script src="https://www.paypal.com/sdk/js?client-id=sb&currency=EUR&locale=de_DE" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'pill',
color: 'white',
layout: 'vertical',
label: 'paypal',
},
createOrder: function(data, actions) {
return actions.order.create({ purchase_units: [{ amount: { value: 97.00 } }], application_context: { shipping_preference: 'NO_SHIPPING'
}
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
}
}).render('#paypal-button-container');
</script>
Hi @Ole7,
Thank you for contacting PayPal community.
We apologize for any inconvenience.
I request to initialize the script code only once in your code
<script src="https://www.paypal.com/sdk/js?client-id=sb&currency=EUR&locale=de_DE" data-sdk-integration-source="button-factory"></script>
Thank you for understanding and patience.
Sincerely,
Chiranjeevi
PayPal, Inc.
If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution
©1999-2022 PayPal, Inc. All rights reserved.