I have an input html country
and a script like this:
checkout.php Input html :
<div class="col-md-6">
<div class="form-group">
<label for="country_shipping">Paese<sup>*</sup></label>
<select class="form-control dark" id="country_ship" name="country_ship" tabindex="-1">
<option value="Afganistan">Afghanistan</option>
.... with all countries
</select>
</div>
</div>
My FIRST script:
<script>
$('#country_ship').change(function() {
if($(this).val() == "Italy"
)
{
$('#price_ship').val('<?php echo $Italy;?>'); // it work well
$('data-amount').val('{{ $total * 100 - $price_coupon * 100 + $Italy * 100 }}'); // it doesnt work well
$('#total_ship').val('<?php echo number_format($total - $price_coupon + $Italy, 2);?>'); // it work well
}
});
</script>
My SECOND Script (button stripe):
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_yNuawoy0jUqj1GC14jwcQR5d"
data-amount=""
data-name="dixard"
data-description="Widget"
data-image="https://s3.amazonaws.com/stripe-uploads/acct_14s03fK9wMx3sd9Bmerchant-icon-1416180891533-icona.jpg"
data-locale="auto"
data-currency="eur"
data-id="stripe"
>
</script>
In my FIRST script i'm trying to give a value if user select country Italy, but it doesn't work! I would like attribute a value to "data-mount" with my operation.
maybe I'm wrong here:
$('data-amount').val('{{ $total * 100 - $price_coupon * 100 + $Italy * 100 }}');
my variables like $total, $price_coupon, $italy exist and return the right values. i'm using "{{" because i'm using laravel blade template.
Thank your for your help!