Skip to content

Instantly share code, notes, and snippets.

div.ecwid-floatLeftPanel {
float: left;
text-align: right;
}
div.ecwid-PaymentMethodsBlock-PaymentOption {
text-align: right;
}
div.ecwid-fieldWrapper {
overflow: hidden;
}
class HiddenForm
d = document
constructor: (fields, attributes={})->
@form_element = d.createElement 'form'
for own name, value of fields
@add_field name, value
for own name, value of attributes
@form_element.setAttribute name, value
@form_element.setAttribute 'style', 'display: none'
d.body.appendChild(@form_element)
@genee19
genee19 / dabblet.css
Created May 21, 2013 11:13 — forked from anonymous/dabblet.css
Ecwid's loading indicator in pure CSS
/**
* Ecwid's loading indicator in pure CSS
*/
@keyframes move {
from { background-position-x: 0%; }
to { background-position-x: 100%; }
}
#load-indicator {
@genee19
genee19 / ecwid-cash-on-delivery.js
Created June 8, 2012 10:07
Hide or show payment methods in Ecwid depending on the delivery methods selected
/*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
@genee19
genee19 / ecwid-grid-borders.css
Created May 30, 2012 17:26
A quick set of rules to add a border around the products in grid view of Ecwid
div.ecwid-productBrowser-productsGrid-productTopFragment {
border: solid 1px #b4b8bc;
border-bottom: none;
}
div.ecwid-productBrowser-productsGrid-productBottomFragment {
border: solid 1px #b4b8bc;
border-top: none;
}
@genee19
genee19 / ecwid-hide-zero-prices.html
Created May 18, 2012 14:53
A quick snippet to have the zero prices automatically hidden in the product details page in Ecwid. Add the code into the HTML of your store page, after Ecwid widgets.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<script>
(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;
/* if you need to have the zero price generally visible in the store and hide them only in some categories, you can put those categories' IDs, comma separated, into categories array below */
categories = [];
/* like
categories = [2222333, 44455555];
@genee19
genee19 / uuid.coffee
Created May 4, 2012 13:04
UUID generator in 8 lines of CoffeeScript
UUID: ->
hex = "0123456789ABCDEF"
s = (Math.floor(Math.random() * 0x10) for [0..35])
s[14] = 4
s[19] = (s[19] & 0x3) | 0x8
s = (hex[num] for num in s)
s[8] = s[13] = s[18] = s[23] = "-"
s.join ""
@genee19
genee19 / ecwid-prohibit-product-details.js
Created April 26, 2012 13:22
A simple script that wouldn't allow to open product details page, redirecting to its category view instead. Usage: prohibitEcwidProductDetails() to prohibit all product details, prohibitEcwidProductDetails(3003, 3004); to prohibit only in some categories
function prohibitEcwidProductDetails() {
var categories,
__slice = [].slice,
__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; };
categories = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
Ecwid.OnPageLoad.add(function(page) {
var _ref;
if (page.type === 'PRODUCT' && ((_ref = page.categoryId, __indexOf.call(categories, _ref) >= 0) || categories.length === 0)) {
window.location.hash = "ecwid:mode=category&category=" + page.categoryId;
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript' src='/js/lib/mootools-core-1.4.2-full-nocompat.js'></script>
<link rel="stylesheet" type="text/css" href="/css/normalize.css">
@genee19
genee19 / ecwid_product_api.php
Created January 18, 2012 10:11
A bit more careful Ecwid product API.
<?php
/**
* @version 1.2 April 10, 2011
* @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2011 RocketTheme, LLC
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
*
* Based on work by
* @author Rick Blalock
* @package Joomla