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
// Set payment method title that matches merchant's payment method title set in Ecwid Control Panel. Use public token to get it from store profile | |
var paymentMethodTitle = "PayPal"; | |
// Custom styles for icons for our application | |
var customStyleForPaymentIcons = document.createElement('style'); | |
customStyleForPaymentIcons.innerHTML = ".ecwid-PaymentMethodsBlockSvgCustom { display: inline-block; width: 40px; height: 26px; background-color: #fff !important; border: 1px solid #e2e2e2 !important;}"; | |
document.querySelector('body').appendChild(customStyleForPaymentIcons); |
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 data = { | |
color : 'red', | |
size : 'big', | |
page_id : '123456' | |
}; | |
EcwidApp.setAppStorage(data, function(){ | |
console.log('Data saved!'); | |
}); |
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.11.2/jquery.min.js"></script> | |
<script> | |
Ecwid.OnPageLoaded.add(function(page){ | |
setTimeout(function hidePrice() { | |
if(page.type == "CATEGORY") { | |
$(".ecwid-BuyNow-outOfStockLabel").each(function(idx, el){ | |
$(el).after('<br/>Click to pre-order'); | |
}); | |
} | |
if (page.type == "PRODUCT") { |
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> | |
Ecwid.OnPageLoaded.add(function(page){ | |
setTimeout(function hidePrice() { | |
$(".ecwid-productBrowser-price").each(function(idx, el){ | |
if ($(el).text() == Ecwid.formatCurrency(0)) { | |
if(page.type == "CATEGORY") { | |
$(el).text('Call for price'); | |
$('.ecwid-BuyNow-outOfStockLabel').hide(); | |
} | |
else if (page.type == "PRODUCT") { |
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> | |
var added; | |
Ecwid.OnPageLoaded.add(function(Cart){ | |
var product = { | |
id: 50559268, | |
quantity: 1, | |
options: { | |
type: "EU", | |
color: "Black" | |
} |
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', |
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
<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> |
NewerOlder