This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var product = { | |
id: 33005, | |
quantity: 1, | |
options: { | |
checkboxOption: "test", | |
checkboxOption2: "111,222", | |
checkboxOption3: ["aaa", "ccc"] | |
}, | |
callback: function(success, product, cart) { | |
console.log(success); // true or false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | |
<script> | |
Ecwid.paymentOptionElement = function(caption) { | |
return jQuery("label:contains('" + caption + "')").parents('.ecwid-PaymentMethodsBlock-PaymentOption'); | |
}; | |
Ecwid.OnPageLoaded.add(function(page) { | |
if (page.type === 'CHECKOUT_PAYMENT_DETAILS') { | |
Ecwid.Cart.get(function(cart) { | |
//if customer selects 'Local delivery' shipping method | |
if (cart.shippingMethod === 'Local delivery') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script> | |
<script type="text/javascript"> | |
Ecwid.OnPageLoaded.add(function(page) { | |
function clearFields() { | |
jQuery("input.ecwid-productBrowser-details-optionTextField").val(""); | |
jQuery("select.ecwid-productBrowser-details-optionSelectBox").val($("option:first").val()); | |
jQuery("span.ecwid-productBrowser-details-optionCheckbox input").prop("checked", false); | |
jQuery("span.ecwid-productBrowser-details-optionRadioButton:first input").click(); | |
jQuery("input.ecwid-productBrowser-details-optionDateField").val(""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://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_SHIPPING_ADDRESS' == page.type) { | |
$('input[type=text]').val(''); | |
$('input[type=tel]').val(''); | |
$("select[name='country-list']").val(''); | |
$("select[name='state-list']").val(''); | |
$("select[name='state-suggest']").val(''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
if (document.location.hash != '' ) { | |
history.pushState('', document.title, window.location.pathname); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script> | |
Ecwid.paymentOptionElement = function(caption) { | |
return jQuery("label:contains('" + caption + "')").parents('.ecwid-PaymentMethodsBlock-PaymentOption'); | |
}; | |
Ecwid.OnPageLoaded.add(function(page) { | |
if (page.type === 'CHECKOUT_PAYMENT_DETAILS') { | |
Ecwid.Cart.get(function(cart) { | |
if ( $("body").hasClass("ecwid-customer-group-1794001") ) { | |
Ecwid.paymentOptionElement('Demo payment').show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script> | |
Ecwid.OnPageLoad.add(function(page) { | |
if (page.type == 'CHECKOUT_PAYMENT_DETAILS') { | |
$('textarea.ecwid-PaymentCommentsBlock-textarea').attr('placeholder', 'row 1\nrow2\nrow3'); | |
} | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ecwid.OnPageLoaded.add(function(page){ | |
if ('ORDER_CONFIRMATION' == page.type) { | |
setTimeout(function(){ | |
var order_obj = document.getElementsByClassName('ecwid-Invoice-Header-OrderNumber')[0]; | |
var onumber= order_obj.getElementsByTagName('span')[0].textContent; | |
var script = document.createElement('script'); | |
onumber = onumber.replace(/\#/g,''); | |
alert(onumber); | |
},2000); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Don't forget about jQuery! | |
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script> | |
<script> | |
if (1 || window.location.href.indexOf('key=showMeTheCheckoutMods') != -1) { | |
processCheckoutShippingPage = function() { | |
//prefill your desired data | |
fields = { | |
'address1':'Specify the address', |
OlderNewer