Skip to content

Instantly share code, notes, and snippets.

ec.order = ec.order || {};
ec.order.extraFields = ec.order.extraFields || {};
// A text input that asks a buyer how to sign the package
ec.order.extraFields.wrapping_box_signature = {
'title': 'How should we sign the package?',
'textPlaceholder': 'Package sign',
'type': 'text',
'tip': 'We will put a label on a box so the recipient knows who it is from',
'required': false,
@makfruit
makfruit / ecwid_clean_urls_setup_examples.md
Last active December 14, 2022 12:20
Setting up SEO friendly clean URLs in Ecwid (Examples)

Setting up SEO friendly clean URLs in Ecwid (Examples)

This is a followup on the Ecwid blog post about the new SEO friendly clean URLs available for Ecwid stores. If you have your Ecwid store installed on a platform or sitebuilder including Wordpress, Wix, Adobe Muse or Ecwid Starter Site, you should have the clean URLs enabled automatically (see the blog post for the details). On the other hand, if you run a custom made web site, you will need to adjust your site setup a bit to enable the clean URLs as explained in the Ecwid API docs.

Below are examples of clean URLs setup on custom made websites.

@makfruit
makfruit / amazon_requests_examples.txt
Last active February 5, 2022 00:15
Amazon MWS requests examples
REQUEST #1
POST /Products/2011-10-01?AWSAccessKeyId=<removed>
&Action=ListMatchingProducts
&SellerId=<removed>
&MWSAuthToken=<removed>
&SignatureVersion=2
&Timestamp=2019-05-27T09%3A20%3A51Z
&Version=2011-10-01
&Signature=<removed>
@makfruit
makfruit / ecwid_redirect_confirmation_page.js
Created December 20, 2011 10:37
A script for Ecwid to redirect a customer after placing an order to a custom 'thank you' page
var confirmationPageURL = "http://google.com";
// Add handler for Ecwid's OnPageLoad event
if (
typeof(Ecwid) == 'object'
&& typeof(Ecwid.OnPageLoad) == 'object'
) {
Ecwid.OnPageLoad.add(function(page) {
// Redirect user if needed
if (
@makfruit
makfruit / ecwid_fill_order_comments.js
Created October 1, 2012 08:57
A drop-in script for Ecwid for populating the order comments section with custom text
if (typeof(Ecwid) == 'object') {
Ecwid.OnPageLoaded.add(function(page) {
if ('CHECKOUT_PAYMENT_DETAILS' == page.type) {
jQuery('.ecwid-PaymentCommentsBlock-textarea').val('here goes the text');
}
});
}
@makfruit
makfruit / ecwid_alter_buy_now.css
Last active April 25, 2021 20:49
A CSS code snippet for Ecwid to alter the Buy now buttons styles. Online buttons generators used: - http://css3button.net/76603 - http://dabuttonfactory.com/
/* Styles for the 'Buy now' button */
button.ecwid-AccentedButton {
height: auto;
}
button.ecwid-AccentedButton {
font-size: 13px;
color: #ffffff;
padding: 9px 18px;
background: -moz-linear-gradient(
@makfruit
makfruit / ecwid_buy_now_shiny_blue.css
Last active April 25, 2021 20:48
A CSS snippet for Ecwid to alter buy now buttons. The button CSS styles is from this list: http://hellohappy.org/css3-buttons/ ('Shiny blue')
/*
* A CSS snippet for Ecwid to alter buy now buttons.
* The button CSS styles is from this list: http://hellohappy.org/css3-buttons/ ('Shiny blue')
*/
/* This code prevents the button height issues and default IE fallbacks in Ecwid */
button.ecwid-AccentedButton,
button.ecwid-AccentedButton:hover,
button.ecwid-AccentedButton:active {
height: auto;
@makfruit
makfruit / ecwid_redirect_continue_shopping.html
Last active April 25, 2021 20:48
An HTML/Javascript code snippet for Ecwid to redirect continue shopping buttons to a custom page
<!-- An HTML/Javascript code snippet for Ecwid to redirect continue shopping buttons to a custom page -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>
if (typeof(Ecwid) == 'object') {
Ecwid.OnAPILoaded.add(function() {
// Redirect address. Change it to the URL of page where you want to redirect your customers.
// You can use absolute or relative addresses, e.g. 'index.html', 'http://google.com'
var continueShoppingRedirect = "#!/~/category/id=0";
// Delay (ms), which is necessary for the empty cart page to appear after onCartChange event firing
// Выбор даты самовывоза, несколько пунктов самовывоза
ec.order.extra_fields.ecwid_pickup_time = {
'key': 'ecwid_pickup_time', // Ключ поля в базе.
'title': '_msg_schedule_pickup_time',
'required': true,
'type': 'date',
'checkout_display_section': 'pickup_customer_info',
'datepicker_options': {
'limit_maximum_date_interval_days': 14,
'show_time': true, // Показывать ли селектор времени
@makfruit
makfruit / product_filters_response.js
Last active October 23, 2018 07:03
Sample response from Ecwid Product Filters API
{
"filters": {
"attribute_Brand": {
"values": [
{
"title":"Toyota",
"productCount": 10
},
{