|
|
@ -6,10 +6,10 @@ |
|
|
* Initialize actions. |
|
|
* Initialize actions. |
|
|
*/ |
|
|
*/ |
|
|
init: function() { |
|
|
init: function() { |
|
|
$( document.body ).on( 'submit', '.woocommerce-shipping-calculator', function(event) { |
|
|
|
|
|
|
|
|
$( document.body ).on( 'submit', 'form.woocommerce-shipping-calculator', function(event) { |
|
|
event.preventDefault(); |
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
|
WC_Fvc.block(); |
|
|
|
|
|
|
|
|
WC_Fvc.block('form.woocommerce-shipping-calculator, div.cart_totals'); |
|
|
|
|
|
|
|
|
var cep = $('#calc_shipping_postcode').val(); |
|
|
var cep = $('#calc_shipping_postcode').val(); |
|
|
|
|
|
|
|
|
@ -28,6 +28,7 @@ |
|
|
$('#calc_shipping_state').val(address.data.state).change(); |
|
|
$('#calc_shipping_state').val(address.data.state).change(); |
|
|
$('#calc_shipping_city').val(address.data.city).change(); |
|
|
$('#calc_shipping_city').val(address.data.city).change(); |
|
|
} |
|
|
} |
|
|
|
|
|
WC_Fvc.unblock('form.woocommerce-shipping-calculator, div.cart_totals'); |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
@ -36,8 +37,8 @@ |
|
|
/** |
|
|
/** |
|
|
* Block shipping form. |
|
|
* Block shipping form. |
|
|
*/ |
|
|
*/ |
|
|
block: function() { |
|
|
|
|
|
$('.woocommerce-shipping-calculator, div.cart_totals') |
|
|
|
|
|
|
|
|
block: function(elements) { |
|
|
|
|
|
$(elements) |
|
|
.addClass('processing') |
|
|
.addClass('processing') |
|
|
.block({ |
|
|
.block({ |
|
|
message: null, |
|
|
message: null, |
|
|
@ -51,8 +52,8 @@ |
|
|
/** |
|
|
/** |
|
|
* Unblock checkout. |
|
|
* Unblock checkout. |
|
|
*/ |
|
|
*/ |
|
|
unblock: function() { |
|
|
|
|
|
$('.woocommerce-shipping-calculator, div.cart_totals') |
|
|
|
|
|
|
|
|
unblock: function(elements) { |
|
|
|
|
|
$(elements) |
|
|
.removeClass('processing') |
|
|
.removeClass('processing') |
|
|
.unblock(); |
|
|
.unblock(); |
|
|
}, |
|
|
}, |
|
|
|