I have the following code at bottom of page to update amount (p_amount) and package id (pack_id) (all codes are in same page)
jQuery.ajax({
url : ajaxurl,
dataType : "json",
type : "post",
data : search_params,
success : function(response){
if(response.code=='success'){
jQuery('#coupon-result').html('<img src="<?php echo WP_iv_membership_URLPATH; ?>admin/files/images/right_icon.png">');
}else{
jQuery('#coupon-result').html('<img src="<?php echo WP_iv_membership_URLPATH; ?>admin/files/images/wrong_16x16.png">');
}
jQuery('#p_amount').html(response.p_amount);
}
after this, It updates the value here
<div class="col-md-8 col-xs-8 col-sm-8 " id="p_amount">
and here in the middle of page i am using js to send values over my payment gateway provider, I want to insert the updated value of amount(p_amount) inside (var amount), but it never updates
<div class="checkout">
<script type="text/javascript">
var amount = 'p_amount';
var currency = 'USD';
Aucun commentaire:
Enregistrer un commentaire