Skip to content

Instantly share code, notes, and snippets.

@genee19
genee19 / float_description.css
Created March 21, 2011 15:13
Floating product description in Ecwid. This snippet goes into Ecwid custom CSS. Subsequent modifications to divs in this area may become tricky
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{
@genee19
genee19 / pager-top.css
Created March 25, 2011 10:54
The way to move the category pagination in Ecwid from bottom to top. This is to be applied into your Ecwid custom CSS theme.
div.ecwid-pager {
position: absolute;
top: 0;
width: 100%;
margin: 0;
}
div.ecwid-productBrowser-category {
padding-top: 2em;
position: relative;
@genee19
genee19 / eg2.xml
Created April 20, 2011 16:38
Ecwid's fine-grained Google Gadget
<?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" />
@genee19
genee19 / ecwid-scripts-work.js
Created May 17, 2011 18:27
Ecwid addon: a drop-in script to make any scripts inserted in product description to work out of the box.
(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=
@genee19
genee19 / gist:1186041
Created September 1, 2011 12:07 — forked from qetzal/gist:1118615
SSO Complete Example in PHP
<html><body>
<script>
<?php
if (!$_REQUEST['logoff']) {
$profile = array(
'appId' => '123',
'userId' => '234',
'profile' => array(
'email' => 'test@example.com',
'billingPerson' => array(
@genee19
genee19 / ecwid-catid-class.js
Created September 13, 2011 11:43
Adds class with category ID into div.ecwid-productBrowser so various CSS customizations can be targeted to products in some particular category
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});
<script>
window.ecwidMessages = window.ecwidMessages||{};
ecwidMessages["OrderComponent.order_no"] = "<span class=\"invoice-taxnum\">ABN: 1234567890</span>Order <span>\# ";
</script>
span.invoice-taxnum {
float: right;
}
@genee19
genee19 / ecwid-zoom-to-gallery.js
Created October 5, 2011 16:34
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.
@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