Skip to content

Instantly share code, notes, and snippets.

@rimmer333
rimmer333 / float_description.css
Created Mar 21, 2011
Floating product description in Ecwid. This snippet goes into Ecwid custom CSS. Subsequent modifications to divs in this area may become tricky
View float_description.css
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, div.ecwid-productBrowser-details-leftPanel div.ecwid-productBrowser-details-descr div{
@rimmer333
rimmer333 / pager-top.css
Created Mar 25, 2011
The way to move the category pagination in Ecwid from bottom to top. This is to be applied into your Ecwid custom CSS theme.
View pager-top.css
div.ecwid-pager {
position: absolute;
top: 0;
width: 100%;
margin: 0;
}
div.ecwid-productBrowser-category {
padding-top: 2em;
position: relative;
@rimmer333
rimmer333 / eg2.xml
Created Apr 20, 2011
Ecwid's fine-grained Google Gadget
View eg2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Ecwid Demo Store" title_url="http://www.ecwid.com/demo-frontend.html" author="Ecwid team" scrolling="true">
<Require feature="dynamic-height"/>
</ModulePrefs>
<UserPref name="storeid" display_name="Your Ecwid Store ID" default_value="1003" datatype="int" />
<UserPref name="defaultCategoryId" display_name="Default category ID" default_value="0" datatype="int" />
<UserPref name="categoriesPerRow" display_name="Categories per row" default_value="2" datatype="int" />
<UserPref name="K" display_name="Grid view: number of products in a column" default_value="2" datatype="int" />
<UserPref name="L" display_name="Grid view: number of products in a row" default_value="2" datatype="int" />
@rimmer333
rimmer333 / ecwid-scripts-work.js
Created May 17, 2011
Ecwid addon: a drop-in script to make any scripts inserted in product description to work out of the box.
View ecwid-scripts-work.js
(function(){(function(k,h,M){function H(){var a=l;a.loader={load:N,i:0};return a}function N(a,c,e){var m=c=="c"?O:I;w=0;c=c||"j";x(a)?P(m,a,c,this.i++,y,e):(s.splice(this.i++,0,a),s.length==1&&z());return this}function P(a,c,e,m,n,i){function t(){!f&&(!b.readyState||b.readyState=="loaded"||b.readyState=="complete")&&(g.r=f=1,!w&&o(),b.onload=b.onreadystatechange=null,p(function(){A.removeChild(b)},0))}var b=h.createElement(a),f=0,g={t:e,s:c,e:i};b.src=b.data=c;!B&&(b.style.display="none");b.width=
b.height="0";a!="object"&&(b.type=e);b.onload=b.onreadystatechange=t;a=="img"?b.onerror=t:a=="script"&&(b.onerror=function(){g.e=g.r=1;z()});s.splice(m,0,g);A.insertBefore(b,B?null:v);p(function(){f||(A.removeChild(b),g.r=g.e=f=1,o())},l.errorTimeout)}function z(){var a=s.shift();w=1;a?a.t?p(function(){a.t=="c"?Q(a):R(a)},0):(a(),o()):w=0}function Q(a){var c=h.createElement("link"),e;c.href=a.s;c.rel="stylesheet";c.type="text/css";if(!a.e&&(C||D)){var m=function(n){p(function(){if(!e)try{n.sheet.cssRules.length?
(e=
@rimmer333
rimmer333 / gist:1186041
Created Sep 1, 2011 — forked from qetzal/gist:1118615
SSO Complete Example in PHP
View gist:1186041
<html><body>
<script>
<?php
if (!$_REQUEST['logoff']) {
$profile = array(
'appId' => '123',
'userId' => '234',
'profile' => array(
'email' => 'test@example.com',
'billingPerson' => array(
@rimmer333
rimmer333 / ecwid-catid-class.js
Created Sep 13, 2011
Adds class with category ID into div.ecwid-productBrowser so various CSS customizations can be targeted to products in some particular category
View ecwid-catid-class.js
Ecwid.OnAPILoaded.add(function(){var a;a=window.document.getElementById("ProductBrowser-1");window.Ecwid.ProductBrowser.element=a.getElementsByClassName&&a.getElementsByClassName("ecwid-productBrowser")[0]||function(){var b,c;c=/(^| )ecwid-productBrowser( |$)/;for(b in a.getElementsByTagName("div"))if(b.className.match(c))return b}()});Ecwid.OnPageLoaded.add(function(a){if(a.type==="PRODUCT")window.Ecwid.ProductBrowser.element.className+=" ecwid-productBrowser-ProductInCategory-"+a.categoryId});
View gist:1229387
<script>
window.ecwidMessages = window.ecwidMessages||{};
ecwidMessages["OrderComponent.order_no"] = "<span class=\"invoice-taxnum\">ABN: 1234567890</span>Order <span>\# ";
</script>
View gist:1229395
span.invoice-taxnum {
float: right;
}
@rimmer333
rimmer333 / ecwid-zoom-to-gallery.js
Created Oct 5, 2011
A drop-in script for Ecwid to trigger the product gallery popup when a product thumbnail image is clicked in the product details page. How to use: use theis script as usual on your shop page where you embed Ecwid product browser.
View ecwid-zoom-to-gallery.js
@rimmer333
rimmer333 / ecwid_product_api.php
Created Jan 18, 2012
A bit more careful Ecwid product API.
View ecwid_product_api.php
<?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