Skip to content

Instantly share code, notes, and snippets.

@riq363
Created January 27, 2015 16:26
Show Gist options
  • Save riq363/df77f1ed21b3cfb2a64d to your computer and use it in GitHub Desktop.
Save riq363/df77f1ed21b3cfb2a64d to your computer and use it in GitHub Desktop.
Clear address fields on Billing address step and unselect checkbox 'My billing address is the same as the shipping address'
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>if (typeof(Ecwid) == 'object') {
Ecwid.OnPageLoaded.add(function(page) {
if ('CHECKOUT_PAYMENT_DETAILS' == page.type) {
$('input[type=checkbox]').prop('checked', false);
$("input[type=text]").prop('disabled', false);
$("input[type=tel]").prop('disabled', false);
$("select[name='country-list']").prop("disabled", false);
$("select[name='state-list']").prop("disabled", false);
$("select[name='state-suggest']").prop("disabled", false);
$('input[type=text]').val('');
$('input[type=tel]').val('');
$("select[name='country-list']").val('');
$("select[name='state-list']").val('');
$("select[name='state-suggest']").val('');
}
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment