Skip to content

Instantly share code, notes, and snippets.

@makfruit
makfruit / ecwid_move_related_products.html
Last active December 15, 2015 02:19
A drop-in HTML/Javascript snippet for Ecwid to move the 'You may also like' section to underneath the product image (in between the image and the product description). Place it _after_ the Ecwid integration code.
@makfruit
makfruit / ecwid_options_expander.html
Last active December 15, 2015 18:19
An HTML/Javascript code snippet for Ecwid to show/hide product options depending on a trigger(expander) option
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
/* An HTML/Javascript code snippet for Ecwid to show/hide product options depending on a trigger(expander) option */
if (typeof(Ecwid) == 'object') {
Ecwid.OnAPILoaded.add(function() {
var expanderOptionName = "Do_you_want_extra_options";
var expanderOptionFlagValue = "Yes";
function checkExpandableOptions() {
@makfruit
makfruit / ecwid_disallow_purchasing_for_categories.html
Created April 19, 2013 10:22
An HTML/Javascript code snippet for Ecwid to disallow purchasing of products from certain categories
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
/* An HTML/Javascript code snippet for Ecwid to disallow purchasing of products from certain categories */
if (typeof(Ecwid) == 'object') {
Ecwid.OnAPILoaded.add(function() {
var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
var categories = [
1234567,
5286250
@makfruit
makfruit / ecwid_move_pagination_bar_to_top.html
Created August 23, 2013 10:38
An HTML/Javascript code snippet for Ecwid to move the pagination bar to the top of product listing
<!-- 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() {
Ecwid.OnPageLoaded.add(function(page) {
jQuery('.ecwid-pager').removeClass('ecwid-pager-hasTopSeparator').insertAfter('div.ecwid-results-topPanel-itemsCountLabel');
});
});
}
@makfruit
makfruit / ecwid_yotpo_sample_code.html
Created August 26, 2013 16:38
A sample code snippet for Ecwid-Yotpo integration. For the details, see: - https://github.com/makfruit/ecwid_yotpo_widgets -
<script type="text/javascript" src="http://mysite.com/path/to/EcwidYotpoWidgets.js"></script>
<script>
EcwidYotpoWidgets.load({
yotpoAppKey: 'my_yotpo_key' // Place your Yotpo API key here
});
@makfruit
makfruit / ecwid_move_descr_to_righ_panel.html
Created August 30, 2013 14:42
An HTML/Javascript code snippet for Ecwid to move the product description to the right panel
<!-- An HTML/Javascript code snippet for Ecwid to move the product description to the right panel -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script type="text/javascript">
Ecwid.OnPageLoaded.add(function(page) {
if (page.type == "PRODUCT" && !descrMoved) {
jQuery("div.ecwid-productBrowser-details-descr").insertBefore("div.ecwid-productBrowser-details-rightPanel div.ecwid-productBrowser-sku");
var descrMoved = true;
}
});
@makfruit
makfruit / ecwid_payment_options_on_subtotal.html
Last active December 26, 2015 21:39
An HTML/Javascript code snippet for Ecwid to hide particular payment options depending on order subtotal
<script>
/*
* Hide or show payment methods in Ecwid depending on the order subtotal
* https://gist.github.com/makfruit/7217739
*/
/*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))}functi
@makfruit
makfruit / ecwid-hide-prices-in-category.css
Created December 4, 2013 18:49
A CSS mod for Ecwid to hide product prices in category view
div.ecwid-productBrowser-category div.ecwid-productBrowser-price,
div.ecwid-productBrowser-category td.ecwid-productBrowser-productsTable-price {
display: none;
}
@makfruit
makfruit / ecwid-product-descr-next-to-image.css
Created December 6, 2013 10:19
CSS mod for Ecwid to place product description at the right hand of thumbnail on product details pages
div.ecwid-productBrowser-details-leftPanel div {
float: left;
}
div.ecwid-productBrowser-details-thumbnail {
width: 225px;
margin-right: 5px;
}
div.ecwid-productBrowser-details-leftPanel div.ecwid-productBrowser-details-descr,
@makfruit
makfruit / ecwid-frame-for-category-thumbnails.css
Created December 11, 2013 08:03
A CSS mod for Ecwid to add a border/frame around category thumbnails in category grid
table.ecwid-productBrowser-subcategories-mainTable img {
border-style: solid !important;
border: 2px solid #D8D8D8;
}