I have built a website in the codeigniter framework.
I've got a form a user fills out when making a purchase, here they can select the quantity of how many items they want. At the moment my code updates a span label with the new amount. My code is
$( "#cases" ).change(function() {
var price = document.getElementById("ppc").value;
var quantity = document.getElementById("cases").value;
var Tprice = price * quantity ;
document.getElementById("Totprice2").innerHTML = Tprice
});
this updates perfectly, I am wondering how can I now pass the var Tprice into my stripe data-amount bit?
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="<?= get_option('stripe_public') ?>"
data-amount="3999"
data-description="Auction BIN #<?= $listing->listingID ?>"
data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
data-locale="auto"
data-zip-code="true"
data-currency="<?= get_option('currency_code') ?>">
</script>