How to use 3 smart buttons for multiple items?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Add Others data in SDKs
- Shipping options are not appearing in my cart through link or button. in PayPal Payments Standard
- Seller "Buy now" button - unable to edit a button in PayPal Payments Standard
- Hosted Buttons have changed. How can I now edit the item ID and stock? in PayPal Payments Standard
- What happened to PayPal Buttons?! in PayPal Payments Standard