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: 10, | |
quantity: 3, | |
options: { | |
someTextOption: "optionVal", | |
someDateOption: new Date().getTime().toString(), | |
someRadioOption: "optionVal", | |
someDropDownOption: "optionVal", | |
someCheckboxOption: ["optionVal1", "optionVal2"] | |
}, |
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
<!-- | |
An HTML/JS snippet for Ecwid to move category description and subcategories under the subcategories/products listing | |
https://gist.github.com/makfruit/8f55e57945de9089a014 | |
Put this code after Ecwid integration code on your site | |
--> | |
<script src="//code.jquery.com/jquery.min.js"></script> | |
<script> | |
Ecwid.OnPageLoaded.add(function(page) { | |
if (page.type == 'CATEGORY') { |
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> | |
// categoryURLs array as category Id => redirection URL | |
// Please use this array to define your own redirection rules | |
var categoryURLs = { | |
'1765387' : 'http://www.google.com', | |
'1797366' : 'http://www.ecwid.com' | |
}; | |
// Add handler for Ecwid's OnPageLoad event | |
if ( |
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
<?php | |
function show_ecwid_catalog($ecwid_store_id) { | |
include_once "ecwid_product_api.php"; | |
$ecwid_store_id = intval($ecwid_store_id); | |
$api = new EcwidProductApi($ecwid_store_id); | |
$cat_id = isset($_GET['ecwid_category_id']) ? intval($_GET['ecwid_category_id']) : false; | |
$prod_id = isset($_GET['ecwid_product_id']) ? intval($_GET['ecwid_product_id']) : false; | |
$ecwid_category_id = $cat_id; |
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
/* | |
* A script for Ecwid to display Vkontakte social widgets (like, share, comments) on the product pages. | |
* Please include it after the Ecwid integration code. | |
* | |
* Required: Ecwid Product API, Vkontakte API, jQuery | |
* | |
* Global variables: vkWidgetsSettings (redefines the default widget settings) | |
*/ | |
/* |
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 ecwid_ProductBrowserURL = 'http://www.example.com'; // change it to your store page URL | |
if (typeof(Ecwid) == 'object') { | |
// Add handler for Ecwid's OnPageLoad event | |
Ecwid.OnPageLoad.add(function(page) { | |
// If any Ecwid link is clicked, open the corresponding Ecwid page in the main product browser | |
if (window.location.hash.match(/\/~\//) !== null) { | |
window.location = ecwid_ProductBrowserURL + window.location.hash; | |
} | |
}); |
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
/*yepnope1.5.x|WTFPL*/ | |
(function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){v |
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') { | |
// Add handler for Ecwid's OnPageLoad event | |
Ecwid.OnPageLoaded.add(function(page) { | |
if ('CHECKOUT_PAYMENT_DETAILS' == page.type) { | |
jQuery('.ecwid-AddressForm input[type=checkbox]').first().click(function() { | |
if (!this.checked) { | |
jQuery('.ecwid-AddressForm input[type=text]').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
// Add handler for Ecwid's OnPageLoad event | |
if ( | |
typeof(Ecwid) == 'object' | |
&& typeof(Ecwid.OnPageLoad) == 'object' | |
) { | |
Ecwid.OnPageLoad.add(function(page) { | |
// Determine a product ID and do necessary actions | |
if ( | |
typeof(page) == 'object' | |
&& 'PRODUCT' == page.type |
OlderNewer