Skip to content

Instantly share code, notes, and snippets.

Тело = "[{""sku"": ""S0000060326"", ""name"": ""Товар1""} , {""sku"": ""S0000053458"", ""name"": ""Товар2""} ]";
ssl = Новый ЗащищенноеСоединениеOpenSSL();
Сервер = "app.ecwid.com";
Ресурс = "api/v1/XXXXXXX/products?secure_auth_key=XXXXXXX";
HTTP = Новый HTTPСоединение(Сервер,,,,,,ssl);
HTTPЗапрос = Новый HTTPЗапрос(Ресурс);
javascript:(function(){var enc=encodeURIComponent,w=window,frames=w.frames,d=document,tn=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pu=w.location.href,isGMail=w.location.host.match(/mail\.google\.com/),tt=pt=d.title,subjSpans=d.getElementsByClassName("hP"),i,url;if(isGMail){if(subjSpans){tt=subjSpans[0].innerText}else{tt=d.title.substring(d.title.indexOf("-")+1,d.title.lastIndexOf("-")).replace(/^ +/,"").replace(/ +$/,"")};if(tn!="")tn+="\n\n";tn+="From email subject:("+tt+")\n"+pu;pu="https://mail.google.com/mail/u/0/?qs=true&search=query&q=subject:("+enc(tt)+")"};url='omnifocus:///add?note='+enc(tn+"\n"+pu)+'&name='+enc(tt);w.location.href=url})();
@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: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;
}