<div id=”smart-button-container”>
<div style=”text-align: center;”>
<div style=”margin-bottom: 1.25rem;”>
Masterclass Sistema Pajoni
<select id=”item-options”>
<option value=”1 Masterclass”>1 Masterclass – 40 USD</option>
<option value=”1 Masterclass + 1 Práctica”>1 Masterclass + 1 Práctica – 48 USD</option>
<option value=”2 Masterclass”>2 Masterclass – 60 USD</option>
<option value=”2 Masterclass + 1 Práctica”>2 Masterclass + 1 Práctica – 68 USD</option>
<option value=”2 Masterclass + 2 Prácticas”>2 Masterclass + 2 Prácticas – 74 USD</option>
<option value=”3 Masterclass “>3 Masterclass – 70 USD</option>
<option value=”3 Masterclass + 1 Práctica”>3 Masterclass + 1 Práctica – 78 USD</option>
<option value=”3 Masterclass + 2 Prácticas”>3 Masterclass + 2 Prácticas – 84 USD</option>
<option value=”3 Masterclass + 3 Prácticas”>3 Masterclass + 3 Prácticas – 88 USD</option>
<option value=”4 Masterclass”>4 Masterclass – 80 USD</option>
<option value=”4 Masterclass + 1 Práctica”>4 Masterclass + 1 Práctica – 88 USD</option>
<option value=”4 Masterclass + 2 Prácticas”>4 Masterclass + 2 Prácticas – 94 USD</option>
<option value=”4 Masterclass + 3 Prácticas”>4 Masterclass + 3 Prácticas – 98 USD</option>
<option value=”4 Masterclass + 4 Prácticas”>4 Masterclass + 4 Prácticas – 100 USD</option>
</select>
</div>
<div id=”paypal-button-container”></div>
</div>
</div>
<script src=”https://www.paypal.com/sdk/js?client-id=sb¤cy=USD” data-sdk-integration-source=”button-factory”></script> <script> function initPayPalButton() { var shipping = 0; var itemOptions = document.querySelector(“#smart-button-container #item-options”); var quantity = parseInt(); var quantitySelect = document.querySelector(“#smart-button-container #quantitySelect”); if (!isNaN(quantity)) { quantitySelect.style.visibility = “visible”; } var orderDescription = ‘Masterclass Sistema Pajoni’; if(orderDescription === ”) { orderDescription = ‘Item’; } paypal.Buttons({ style: { shape: ‘rect’, color: ‘white’, layout: ‘vertical’, label: ‘buynow’, }, createOrder: function(data, actions) { var selectedItemDescription = itemOptions.options[itemOptions.selectedIndex].value; var selectedItemPrice = parseFloat(itemOptions.options[itemOptions.selectedIndex].getAttribute(“price”)); var tax = (0 === 0) ? 0 : (selectedItemPrice * (parseFloat(0)/100)); if(quantitySelect.options.length > 0) { quantity = parseInt(quantitySelect.options[quantitySelect.selectedIndex].value); } else { quantity = 1; } tax *= quantity; tax = Math.round(tax * 100) / 100; var priceTotal = quantity * selectedItemPrice + parseFloat(shipping) + tax; priceTotal = Math.round(priceTotal * 100) / 100; var itemTotalValue = Math.round((selectedItemPrice * quantity) * 100) / 100; return actions.order.create({ purchase_units: [{ description: orderDescription, amount: { currency_code: ‘USD’, value: priceTotal, breakdown: { item_total: { currency_code: ‘USD’, value: itemTotalValue, }, shipping: { currency_code: ‘USD’, value: shipping, }, tax_total: { currency_code: ‘USD’, value: tax, } } }, items: [{ name: selectedItemDescription, unit_amount: { currency_code: ‘USD’, value: selectedItemPrice, }, quantity: quantity }] }] }); }, onApprove: function(data, actions) { return actions.order.capture().then(function(details) { alert(‘Transaction completed by ‘ + details.payer.name.given_name + ‘!’); }); }, onError: function(err) { console.log(err); }, }).render(‘#paypal-button-container’); } initPayPalButton(); </script>