Skip to content

Instantly share code, notes, and snippets.

@qetzal
qetzal / gist:1073793
Created July 9, 2011 17:50
How to remove Ecwid breadcrumbs from the main root page only
div.ecwid-productBrowser-CategoryPage-0 div.ecwid-productBrowser-categoryPath {
display:none;
}
@qetzal
qetzal / gist:1115865
Created July 30, 2011 19:07
Wrong code
* The backgrounded panel on the right of some pages */
/* (product details or the shopping bag pages for example) */
html#ecwid_html body#ecwid_body div.ecwid-productBrowser-backgroundedPanel {
background-color: #fff;
overflow: hidden;
}
<?php
function internal_parse_json($json) {
if(version_compare(PHP_VERSION,"5.2.0",">=")) {
return json_decode($json, true);
}
include_once('JSON.php');
$json_parser = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
return $json_parser->decode($json);
}
@qetzal
qetzal / gist:1118615
Created August 1, 2011 17:44
SSO Complete Example in PHP
<html><body>
<script>
<?php
if (!$_REQUEST['logoff']) {
$profile = array(
'appId' => "My cool app",
'userId' => "234",
'profile' => array(
'email' => "test@example.com",
'billingPerson' => array(
@qetzal
qetzal / gist:1118622
Created August 1, 2011 17:48
PHP SSO example
<?php
$sso_secret = "TEST";
$message = base64_encode("{appId:'123',userId:'234',profile:{email:'test@example.com'}}");
$timestamp = time();
$hmac = hash_hmac('sha1', "$message $timestamp", $sso_secret);
echo "<script> var ecwid_sso_profile = '$message $hmac $timestamp' </script>";
?>
<meta name="application-name" content="Ecwid Control Panel" />
<meta name="msapplication-tooltip" content="Ecwid Control Panel" />
<meta content="width=1024;height=768" name="msapplication-window" />
<meta name="msapplication-starturl" content="https://my.ecwid.com/cp/" />
<meta content="Dashboard;
action-uri=https://my.ecwid.com/cp/CP.html#products=list&catalog=1&promotions=0&profile=-1&settings=0&t1=-1&t2=0&dashboard=-1;
icon-uri=https://my.ecwid.com/favicon.ico" name="msapplication-task" />
<meta content="Sales;
action-uri=https://my.ecwid.com/cp/CP.html#products=list&catalog=-1&promotions=-1&profile=-1&settings=-1&t1=0&orders=0&order=list&t2=-1;
<script src="//app.ecwid.com/script.js?1003" type="text/javascript" charset="UTF-8"></script>
<script>
Ecwid.OnSetProfile.add(function(profile) {
if (profile == null) document.getElementById('CUSTOMER').innerText = 'NOT logged in';
else document.getElementById('CUSTOMER').innerText = 'logged in';
});
</script>
<div><div id='CUSTOMER'/></div>
<script>
xProductBrowser();
@qetzal
qetzal / gist:1173126
Created August 26, 2011 10:06
Redirecting links inside the popup //ecwid
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<div>
div.ecwid-productBrowser-likeButton .fb_edge_widget_with_comment span.fb_edge_comment_widget iframe.fb_ltr {
display: none !important;
}
data:text/html,<body><div><script type="text/javascript" src="http://app.ecwid.com/script.js?1003" charset="utf-8"></script><script type="text/javascript"> xProductBrowser("categoriesPerRow=3","views=grid(3,3) list(10) table(20)","categoryView=grid","searchView=list","style="); </script></div></body>