Version Description
- SEO improvement for canonical tags on the product and category pages. The Ecwid ecommerce plugin now hides the store root page canonical and dynamically adds corresponding canonical tags to the product and category pages as you browse the store. This is to improve the pages visibility for search engines, when the new clean URLs option is enabled.
- Fixed layout issue in the Wordpress 2017 theme. We found an issue with the way Ecwid online stores are displayed in the default Wordpress Twenty Seventeen theme the stores pages appeared too narrow. We fixed that.
Download this release
Release Info
Developer | Ecwid |
Plugin | Ecwid Ecommerce Shopping Cart |
Version | 5.0.7 |
Comparing to | |
See all releases |
Code changes from version 5.0.6 to 5.0.7
- css/pure-min.css +11 -0
- css/themes/2017.css +2 -0
- ecwid-shopping-cart.php +20 -17
- ecwid_menu_icon.png +0 -0
- images/grid-active.png +0 -0
- images/grid-default.png +0 -0
- images/list-active.png +0 -0
- images/list-default.png +0 -0
- images/table-active.png +0 -0
- images/table-default.png +0 -0
- includes/class-ecwid-kissmetrics.php +122 -0
- includes/class-ecwid-nav-menus.php +1 -1
- includes/class-ecwid-seo-links.php +6 -0
- includes/class-ecwid-store-page.php +6 -1
- js/advanced.js +0 -0
- js/chameleon.js +5 -0
- js/ecwid-chameleon.js +253 -0
- js/kissmetrics.js +50 -0
- lib/EcwidCatalog.php +269 -0
- lib/EcwidSitemapBuilder.php +85 -0
- lib/class-ecwid-message-manager.php +236 -0
- lib/class-ecwid-theme-manager.php +173 -0
- lib/themes.php +58 -0
- lib/themes/class-ecwid-theme-2014.php +21 -0
- lib/themes/class-ecwid-theme-base.php +24 -0
- lib/themes/class-ecwid-theme-bretheon.php +36 -0
- lib/themes/class-ecwid-theme-pagelines.php +19 -0
- lib/themes/class-ecwid-theme-responsive.php +56 -0
- readme.txt +5 -1
- templates/advanced-settings.php +4 -3
- templates/general-settings-initial.php +75 -0
- templates/general-settings.php +75 -0
- templates/setup.php +75 -0
- templates/wp-dashboard-widget.php +146 -0
css/pure-min.css
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
Pure v0.3.0
|
3 |
+
Copyright 2013 Yahoo! Inc. All rights reserved.
|
4 |
+
Licensed under the BSD License.
|
5 |
+
https://github.com/yui/pure/blob/master/LICENSE.md
|
6 |
+
*/
|
7 |
+
/*!
|
8 |
+
normalize.css v1.1.2 | MIT License | git.io/normalize
|
9 |
+
Copyright (c) Nicolas Gallagher and Jonathan Neal
|
10 |
+
*/
|
11 |
+
/*! normalize.css v1.1.2 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em;margin:.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.67em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:1em 40px}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,menu,ol,ul{margin:1em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}.pure-button{display:inline-block;*display:inline;zoom:1;line-height:normal;white-space:nowrap;vertical-align:baseline;text-align:center;cursor:pointer;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pure-button::-moz-focus-inner{padding:0;border:0}.pure-button{font-size:100%;*font-size:90%;*overflow:visible;padding:.5em 1.5em;color:#444;color:rgba(0,0,0,.8);*color:#444;border:1px solid #999;border:0 rgba(0,0,0,0);background-color:#E6E6E6;text-decoration:none;border-radius:2px;-webkit-transition:.1s linear -webkit-box-shadow;-moz-transition:.1s linear -moz-box-shadow;-ms-transition:.1s linear box-shadow;-o-transition:.1s linear box-shadow;transition:.1s linear box-shadow}.pure-button-hover,.pure-button:hover,.pure-button:focus{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#1a000000', GradientType=0);background-image:-webkit-gradient(linear,0 0,0 100%,from(transparent),color-stop(40%,rgba(0,0,0,.05)),to(rgba(0,0,0,.1)));background-image:-webkit-linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1));background-image:-moz-linear-gradient(top,rgba(0,0,0,.05) 0,rgba(0,0,0,.1));background-image:-ms-linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1));background-image:-o-linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1));background-image:linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1))}.pure-button:focus{outline:0}.pure-button-active,.pure-button:active{box-shadow:0 0 0 1px rgba(0,0,0,.15) inset,0 0 6px rgba(0,0,0,.2) inset}.pure-button[disabled],.pure-button-disabled,.pure-button-disabled:hover,.pure-button-disabled:focus,.pure-button-disabled:active{border:0;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);filter:alpha(opacity=40);-khtml-opacity:.4;-moz-opacity:.4;opacity:.4;cursor:not-allowed;box-shadow:none}.pure-button-hidden{display:none}.pure-button::-moz-focus-inner{padding:0;border:0}.pure-button-primary,.pure-button-selected,a.pure-button-primary,a.pure-button-selected{background-color:#0078e7;color:#fff}.pure-form input[type=text],.pure-form input[type=password],.pure-form input[type=email],.pure-form input[type=url],.pure-form input[type=date],.pure-form input[type=month],.pure-form input[type=time],.pure-form input[type=datetime],.pure-form input[type=datetime-local],.pure-form input[type=week],.pure-form input[type=number],.pure-form input[type=search],.pure-form input[type=tel],.pure-form input[type=color],.pure-form select,.pure-form textarea{padding:.5em .6em;display:inline-block;border:1px solid #ccc;font-size:.8em;box-shadow:inset 0 1px 3px #ddd;border-radius:4px;-webkit-transition:.3s linear border;-moz-transition:.3s linear border;-ms-transition:.3s linear border;-o-transition:.3s linear border;transition:.3s linear border;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.pure-form input[type=text]:focus,.pure-form input[type=password]:focus,.pure-form input[type=email]:focus,.pure-form input[type=url]:focus,.pure-form input[type=date]:focus,.pure-form input[type=month]:focus,.pure-form input[type=time]:focus,.pure-form input[type=datetime]:focus,.pure-form input[type=datetime-local]:focus,.pure-form input[type=week]:focus,.pure-form input[type=number]:focus,.pure-form input[type=search]:focus,.pure-form input[type=tel]:focus,.pure-form input[type=color]:focus,.pure-form select:focus,.pure-form textarea:focus{outline:0;outline:thin dotted \9;border-color:#129FEA}.pure-form input[type=file]:focus,.pure-form input[type=radio]:focus,.pure-form input[type=checkbox]:focus{outline:thin dotted #333;outline:1px auto #129FEA}.pure-form .pure-checkbox,.pure-form .pure-radio{margin:.5em 0;display:block}.pure-form input[type=text][disabled],.pure-form input[type=password][disabled],.pure-form input[type=email][disabled],.pure-form input[type=url][disabled],.pure-form input[type=date][disabled],.pure-form input[type=month][disabled],.pure-form input[type=time][disabled],.pure-form input[type=datetime][disabled],.pure-form input[type=datetime-local][disabled],.pure-form input[type=week][disabled],.pure-form input[type=number][disabled],.pure-form input[type=search][disabled],.pure-form input[type=tel][disabled],.pure-form input[type=color][disabled],.pure-form select[disabled],.pure-form textarea[disabled]{cursor:not-allowed;background-color:#eaeded;color:#cad2d3}.pure-form input[readonly],.pure-form select[readonly],.pure-form textarea[readonly]{background:#eee;color:#777;border-color:#ccc}.pure-form input:focus:invalid,.pure-form textarea:focus:invalid,.pure-form select:focus:invalid{color:#b94a48;border:1px solid #ee5f5b}.pure-form input:focus:invalid:focus,.pure-form textarea:focus:invalid:focus,.pure-form select:focus:invalid:focus{border-color:#e9322d}.pure-form input[type=file]:focus:invalid:focus,.pure-form input[type=radio]:focus:invalid:focus,.pure-form input[type=checkbox]:focus:invalid:focus{outline-color:#e9322d}.pure-form select{border:1px solid #ccc;background-color:#fff}.pure-form select[multiple]{height:auto}.pure-form label{margin:.5em 0 .2em;font-size:90%}.pure-form fieldset{margin:0;padding:.35em 0 .75em;border:0}.pure-form legend{display:block;width:100%;padding:.3em 0;margin-bottom:.3em;font-size:125%;color:#333;border-bottom:1px solid #e5e5e5}.pure-form-stacked input[type=text],.pure-form-stacked input[type=password],.pure-form-stacked input[type=email],.pure-form-stacked input[type=url],.pure-form-stacked input[type=date],.pure-form-stacked input[type=month],.pure-form-stacked input[type=time],.pure-form-stacked input[type=datetime],.pure-form-stacked input[type=datetime-local],.pure-form-stacked input[type=week],.pure-form-stacked input[type=number],.pure-form-stacked input[type=search],.pure-form-stacked input[type=tel],.pure-form-stacked input[type=color],.pure-form-stacked select,.pure-form-stacked label,.pure-form-stacked textarea{display:block;margin:.25em 0}.pure-form-aligned input,.pure-form-aligned textarea,.pure-form-aligned select,.pure-form-aligned .pure-help-inline,.pure-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.pure-form-aligned .pure-control-group{margin-bottom:.5em}.pure-form-aligned .pure-control-group label{text-align:right;display:inline-block;vertical-align:middle;width:10em;margin:0 1em 0 0}.pure-form-aligned .pure-controls{margin:1.5em 0 0 10em}.pure-form input.pure-input-rounded,.pure-form .pure-input-rounded{border-radius:2em;padding:.5em 1em}.pure-form .pure-group fieldset{margin-bottom:10px}.pure-form .pure-group input{display:block;padding:10px;margin:0;border-radius:0;position:relative;top:-1px}.pure-form .pure-group input:focus{z-index:2}.pure-form .pure-group input:first-child{top:1px;border-radius:4px 4px 0 0}.pure-form .pure-group input:last-child{top:-2px;border-radius:0 0 4px 4px}.pure-form .pure-group button{margin:.35em 0}.pure-form .pure-input-1{width:100%}.pure-form .pure-input-2-3{width:66%}.pure-form .pure-input-1-2{width:50%}.pure-form .pure-input-1-3{width:33%}.pure-form .pure-input-1-4{width:25%}.pure-form .pure-help-inline,.pure-form-message-inline{display:inline-block;padding-left:.3em;color:#666;vertical-align:middle;font-size:90%}.pure-form-message{display:block;color:#666;font-size:90%}@media only screen and (max-width :480px){.pure-form button[type=submit]{margin:.7em 0 0}.pure-form input[type=text],.pure-form input[type=password],.pure-form input[type=email],.pure-form input[type=url],.pure-form input[type=date],.pure-form input[type=month],.pure-form input[type=time],.pure-form input[type=datetime],.pure-form input[type=datetime-local],.pure-form input[type=week],.pure-form input[type=number],.pure-form input[type=search],.pure-form input[type=tel],.pure-form input[type=color],.pure-form label{margin-bottom:.3em;display:block}.pure-group input[type=text],.pure-group input[type=password],.pure-group input[type=email],.pure-group input[type=url],.pure-group input[type=date],.pure-group input[type=month],.pure-group input[type=time],.pure-group input[type=datetime],.pure-group input[type=datetime-local],.pure-group input[type=week],.pure-group input[type=number],.pure-group input[type=search],.pure-group input[type=tel],.pure-group input[type=color]{margin-bottom:0}.pure-form-aligned .pure-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.pure-form-aligned .pure-controls{margin:1.5em 0 0}.pure-form .pure-help-inline,.pure-form-message-inline,.pure-form-message{display:block;font-size:80%;padding:.2em 0 .8em}}.pure-g{letter-spacing:-.31em;*letter-spacing:normal;*word-spacing:-.43em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-flex;-webkit-flex-flow:row wrap;display:-ms-flexbox;-ms-flex-flow:row wrap}.opera-only :-o-prefocus,.pure-g{word-spacing:-.43em}.pure-u{display:inline-block;*display:inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class *="pure-u"]{font-family:sans-serif}.pure-u-1,.pure-u-1-2,.pure-u-1-3,.pure-u-2-3,.pure-u-1-4,.pure-u-3-4,.pure-u-1-5,.pure-u-2-5,.pure-u-3-5,.pure-u-4-5,.pure-u-1-6,.pure-u-5-6,.pure-u-1-8,.pure-u-3-8,.pure-u-5-8,.pure-u-7-8,.pure-u-1-12,.pure-u-5-12,.pure-u-7-12,.pure-u-11-12,.pure-u-1-24,.pure-u-5-24,.pure-u-7-24,.pure-u-11-24,.pure-u-13-24,.pure-u-17-24,.pure-u-19-24,.pure-u-23-24{display:inline-block;*display:inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-u-1{width:100%}.pure-u-1-2{width:50%;*width:49.969%}.pure-u-1-3{width:33.3333%;*width:33.3023%}.pure-u-2-3{width:66.6667%;*width:66.6357%}.pure-u-1-4{width:25%;*width:24.969%}.pure-u-3-4{width:75%;*width:74.969%}.pure-u-1-5{width:20%;*width:19.969%}.pure-u-2-5{width:40%;*width:39.969%}.pure-u-3-5{width:60%;*width:59.969%}.pure-u-4-5{width:80%;*width:79.969%}.pure-u-1-6{width:16.6667%;*width:16.6357%}.pure-u-5-6{width:83.3333%;*width:83.3023%}.pure-u-1-8{width:12.5%;*width:12.469%}.pure-u-3-8{width:37.5%;*width:37.469%}.pure-u-5-8{width:62.5%;*width:62.469%}.pure-u-7-8{width:87.5%;*width:87.469%}.pure-u-1-12{width:8.3333%;*width:8.3023%}.pure-u-5-12{width:41.6667%;*width:41.6357%}.pure-u-7-12{width:58.3333%;*width:58.3023%}.pure-u-11-12{width:91.6667%;*width:91.6357%}.pure-u-1-24{width:4.1667%;*width:4.1357%}.pure-u-5-24{width:20.8333%;*width:20.8023%}.pure-u-7-24{width:29.1667%;*width:29.1357%}.pure-u-11-24{width:45.8333%;*width:45.8023%}.pure-u-13-24{width:54.1667%;*width:54.1357%}.pure-u-17-24{width:70.8333%;*width:70.8023%}.pure-u-19-24{width:79.1667%;*width:79.1357%}.pure-u-23-24{width:95.8333%;*width:95.8023%}.pure-g-r{letter-spacing:-.31em;*letter-spacing:normal;*word-spacing:-.43em;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-flex;-webkit-flex-flow:row wrap;display:-ms-flexbox;-ms-flex-flow:row wrap}.opera-only :-o-prefocus,.pure-g-r{word-spacing:-.43em}.pure-g-r [class *="pure-u"]{font-family:sans-serif}.pure-g-r img{max-width:100%;height:auto}@media (min-width:980px){.pure-visible-phone{display:none}.pure-visible-tablet{display:none}.pure-hidden-desktop{display:none}}@media (max-width:480px){.pure-g-r>.pure-u,.pure-g-r>[class *="pure-u-"]{width:100%}}@media (max-width:767px){.pure-g-r>.pure-u,.pure-g-r>[class *="pure-u-"]{width:100%}.pure-hidden-phone{display:none}.pure-visible-desktop{display:none}}@media (min-width:768px) and (max-width:979px){.pure-hidden-tablet{display:none}.pure-visible-desktop{display:none}}.pure-menu ul{position:absolute;visibility:hidden}.pure-menu.pure-menu-open{visibility:visible;z-index:2;width:100%}.pure-menu ul{left:-10000px;list-style:none;margin:0;padding:0;top:-10000px;z-index:1}.pure-menu>ul{position:relative}.pure-menu-open>ul{left:0;top:0;visibility:visible}.pure-menu-open>ul:focus{outline:0}.pure-menu li{position:relative}.pure-menu a,.pure-menu .pure-menu-heading{display:block;color:inherit;line-height:1.5em;padding:5px 20px;text-decoration:none;white-space:nowrap}.pure-menu.pure-menu-horizontal>.pure-menu-heading{display:inline-block;*display:inline;zoom:1;margin:0;vertical-align:middle}.pure-menu.pure-menu-horizontal>ul{display:inline-block;*display:inline;zoom:1;vertical-align:middle;height:2.4em}.pure-menu li a{padding:5px 20px}.pure-menu-can-have-children>.pure-menu-label:after{content:'\25B8';float:right;font-family:'Lucida Grande','Lucida Sans Unicode','DejaVu Sans',sans-serif;margin-right:-20px;margin-top:-1px}.pure-menu-can-have-children>.pure-menu-label{padding-right:30px}.pure-menu-separator{background-color:#dfdfdf;display:block;height:1px;font-size:0;margin:7px 2px;overflow:hidden}.pure-menu-hidden{display:none}.pure-menu-fixed{position:fixed;top:0;left:0;width:100%}.pure-menu-horizontal li{display:inline-block;*display:inline;zoom:1;vertical-align:middle}.pure-menu-horizontal li li{display:block}.pure-menu-horizontal>.pure-menu-children>.pure-menu-can-have-children>.pure-menu-label:after{content:"\25BE"}.pure-menu-horizontal>.pure-menu-children>.pure-menu-can-have-children>.pure-menu-label{padding-right:30px}.pure-menu-horizontal li.pure-menu-separator{height:50%;width:1px;margin:0 7px}.pure-menu-horizontal li li.pure-menu-separator{height:1px;width:auto;margin:7px 2px}.pure-menu.pure-menu-open,.pure-menu.pure-menu-horizontal li .pure-menu-children{background:#fff;border:1px solid #b7b7b7}.pure-menu.pure-menu-horizontal,.pure-menu.pure-menu-horizontal .pure-menu-heading{border:0}.pure-menu a{border:1px solid transparent;border-left:0;border-right:0}.pure-menu a,.pure-menu .pure-menu-can-have-children>li:after{color:#777}.pure-menu .pure-menu-can-have-children>li:hover:after{color:#fff}.pure-menu .pure-menu-open{background:#dedede}.pure-menu li a:hover,.pure-menu li a:focus{background:#eee}.pure-menu li.pure-menu-disabled a:hover,.pure-menu li.pure-menu-disabled a:focus{background:#fff;color:#bfbfbf}.pure-menu .pure-menu-disabled>a{background-image:none;border-color:transparent;cursor:default}.pure-menu .pure-menu-disabled>a,.pure-menu .pure-menu-can-have-children.pure-menu-disabled>a:after{color:#bfbfbf}.pure-menu .pure-menu-heading{color:#565d64;text-transform:uppercase;font-size:90%;margin-top:.5em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#dfdfdf}.pure-menu .pure-menu-selected a{color:#000}.pure-menu.pure-menu-open.pure-menu-fixed{border:0;border-bottom:1px solid #b7b7b7}.pure-paginator{letter-spacing:-.31em;*letter-spacing:normal;*word-spacing:-.43em;text-rendering:optimizespeed;list-style:none;margin:0;padding:0}.opera-only :-o-prefocus,.pure-paginator{word-spacing:-.43em}.pure-paginator li{display:inline-block;*display:inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-paginator .pure-button{border-radius:0;padding:.8em 1.4em;vertical-align:top;height:1.1em}.pure-paginator .pure-button:focus,.pure-paginator .pure-button:active{outline-style:none}.pure-paginator .prev,.pure-paginator .next{color:#C0C1C3;text-shadow:0 -1px 0 rgba(0,0,0,.45)}.pure-paginator .prev{border-radius:2px 0 0 2px}.pure-paginator .next{border-radius:0 2px 2px 0}@media (max-width:480px){.pure-menu-horizontal{width:100%}.pure-menu-children li{display:block;border-bottom:1px solid #000}}.pure-table{border-collapse:collapse;border-spacing:0;empty-cells:show;border:1px solid #cbcbcb}.pure-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.pure-table td,.pure-table th{border-left:1px solid #cbcbcb;border-width:0 0 0 1px;font-size:inherit;margin:0;overflow:visible;padding:6px 12px}.pure-table td:first-child,.pure-table th:first-child{border-left-width:0}.pure-table thead{background:#e0e0e0;color:#000;text-align:left;vertical-align:bottom}.pure-table td{background-color:transparent}.pure-table-odd td{background-color:#f2f2f2}.pure-table-striped tr:nth-child(2n-1) td{background-color:#f2f2f2}.pure-table-bordered td{border-bottom:1px solid #cbcbcb}.pure-table-bordered tbody>tr:last-child td,.pure-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.pure-table-horizontal td,.pure-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #cbcbcb}.pure-table-horizontal tbody>tr:last-child td{border-bottom-width:0}
|
css/themes/2017.css
CHANGED
@@ -12,4 +12,6 @@ html#ecwid_html body#ecwid_body .ecwid-recently-viewed-products li a:hover {
|
|
12 |
|
13 |
html#ecwid_html body#ecwid_body.ecwid-shopping-cart .entry-content {
|
14 |
width: auto;
|
|
|
|
|
15 |
}
|
12 |
|
13 |
html#ecwid_html body#ecwid_body.ecwid-shopping-cart .entry-content {
|
14 |
width: auto;
|
15 |
+
float: none;
|
16 |
+
clear: both;
|
17 |
}
|
ecwid-shopping-cart.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.ecwid.com?source=wporg
|
|
5 |
Description: Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
|
6 |
Text Domain: ecwid-shopping-cart
|
7 |
Author: Ecwid Team
|
8 |
-
Version: 5.0.
|
9 |
Author URI: http://www.ecwid.com?source=wporg
|
10 |
*/
|
11 |
|
@@ -335,8 +335,7 @@ function ecwid_print_inline_js_config() {
|
|
335 |
<script type="text/javascript">
|
336 |
window.ec = window.ec || Object();
|
337 |
window.ec.config = window.ec.config || Object();
|
338 |
-
window.ec.config.
|
339 |
-
window.ec.config.storefrontUrls = window.ec.config.storefrontUrls || {};
|
340 |
HTML;
|
341 |
|
342 |
do_action('ecwid_print_inline_js_config');
|
@@ -345,12 +344,8 @@ HTML;
|
|
345 |
|
346 |
add_action( 'ecwid_print_inline_js_config', 'ecwid_add_chameleon' );
|
347 |
function ecwid_add_chameleon() {
|
348 |
-
if (!get_option('ecwid_use_chameleon')) {
|
349 |
-
return;
|
350 |
-
}
|
351 |
|
352 |
$colors = array();
|
353 |
-
|
354 |
foreach (array('foreground', 'background', 'link', 'price', 'button') as $kind) {
|
355 |
$color = get_option( 'ecwid_chameleon_colors_' . $kind );
|
356 |
if ( $color ) {
|
@@ -358,34 +353,38 @@ function ecwid_add_chameleon() {
|
|
358 |
}
|
359 |
}
|
360 |
|
361 |
-
if (empty($colors)) {
|
|
|
|
|
|
|
|
|
362 |
$colors = 'auto';
|
363 |
}
|
364 |
|
365 |
$colors = json_encode($colors);
|
366 |
$font = '"auto"';
|
367 |
|
368 |
-
$chameleon = apply_filters( 'ecwid_chameleon_settings', array('colors' => $colors, 'font' => $font));
|
369 |
|
370 |
-
if (!is_array($chameleon)) {
|
371 |
$chameleon = array(
|
372 |
'colors' => $colors,
|
373 |
'font' => $font
|
374 |
);
|
375 |
}
|
376 |
|
377 |
-
if (!isset($chameleon['colors'])) {
|
378 |
$chameleon['colors'] = json_encode($colors);
|
379 |
}
|
380 |
|
381 |
-
if (!isset($chameleon['font'])) {
|
382 |
$chameleon['font'] = $font;
|
383 |
}
|
384 |
|
385 |
echo <<<JS
|
|
|
386 |
window.ec.config.chameleon.font = $chameleon[font];
|
387 |
window.ec.config.chameleon.colors = $chameleon[colors];
|
388 |
-
</script>
|
389 |
JS;
|
390 |
|
391 |
}
|
@@ -527,7 +526,7 @@ function ecwid_check_version()
|
|
527 |
do_action('ecwid_plugin_installed', $current_version);
|
528 |
add_option('ecwid_plugin_version', $current_version);
|
529 |
|
530 |
-
|
531 |
|
532 |
add_option('ecwid_use_new_horizontal_categories', 'Y');
|
533 |
|
@@ -681,7 +680,7 @@ function ecwid_seo_ultimate_compatibility()
|
|
681 |
|
682 |
function ecwid_remove_default_canonical()
|
683 |
{
|
684 |
-
if (
|
685 |
remove_action( 'wp_head','rel_canonical');
|
686 |
}
|
687 |
}
|
@@ -893,7 +892,7 @@ function ecwid_meta() {
|
|
893 |
$store_id = get_ecwid_store_id();
|
894 |
$params = ecwid_get_scriptjs_params();
|
895 |
echo '<link rel="preload" href="https://app.ecwid.com/script.js?'
|
896 |
-
. $store_id .
|
897 |
}
|
898 |
}
|
899 |
|
@@ -1735,7 +1734,8 @@ function ecwid_reset_categories_cache()
|
|
1735 |
return;
|
1736 |
}
|
1737 |
|
1738 |
-
EcwidPlatform::cache_reset('
|
|
|
1739 |
}
|
1740 |
|
1741 |
function ecwid_register_admin_styles($hook_suffix) {
|
@@ -2729,6 +2729,9 @@ function ecwid_get_default_pb_size() {
|
|
2729 |
}
|
2730 |
|
2731 |
function ecwid_update_store_id( $new_store_id ) {
|
|
|
|
|
|
|
2732 |
update_option( 'ecwid_store_id', $new_store_id );
|
2733 |
update_option( 'ecwid_is_api_enabled', 'off' );
|
2734 |
update_option( 'ecwid_api_check_time', 0 );
|
5 |
Description: Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
|
6 |
Text Domain: ecwid-shopping-cart
|
7 |
Author: Ecwid Team
|
8 |
+
Version: 5.0.7
|
9 |
Author URI: http://www.ecwid.com?source=wporg
|
10 |
*/
|
11 |
|
335 |
<script type="text/javascript">
|
336 |
window.ec = window.ec || Object();
|
337 |
window.ec.config = window.ec.config || Object();
|
338 |
+
window.ec.config.enable_canonical_urls = true;
|
|
|
339 |
HTML;
|
340 |
|
341 |
do_action('ecwid_print_inline_js_config');
|
344 |
|
345 |
add_action( 'ecwid_print_inline_js_config', 'ecwid_add_chameleon' );
|
346 |
function ecwid_add_chameleon() {
|
|
|
|
|
|
|
347 |
|
348 |
$colors = array();
|
|
|
349 |
foreach (array('foreground', 'background', 'link', 'price', 'button') as $kind) {
|
350 |
$color = get_option( 'ecwid_chameleon_colors_' . $kind );
|
351 |
if ( $color ) {
|
353 |
}
|
354 |
}
|
355 |
|
356 |
+
if ( !get_option( 'ecwid_use_chameleon' ) && empty( $colors ) ) {
|
357 |
+
return;
|
358 |
+
}
|
359 |
+
|
360 |
+
if ( empty( $colors ) ) {
|
361 |
$colors = 'auto';
|
362 |
}
|
363 |
|
364 |
$colors = json_encode($colors);
|
365 |
$font = '"auto"';
|
366 |
|
367 |
+
$chameleon = apply_filters( 'ecwid_chameleon_settings', array( 'colors' => $colors, 'font' => $font ) );
|
368 |
|
369 |
+
if ( !is_array($chameleon ) ) {
|
370 |
$chameleon = array(
|
371 |
'colors' => $colors,
|
372 |
'font' => $font
|
373 |
);
|
374 |
}
|
375 |
|
376 |
+
if ( !isset( $chameleon['colors'] ) ) {
|
377 |
$chameleon['colors'] = json_encode($colors);
|
378 |
}
|
379 |
|
380 |
+
if ( !isset( $chameleon['font'] ) ) {
|
381 |
$chameleon['font'] = $font;
|
382 |
}
|
383 |
|
384 |
echo <<<JS
|
385 |
+
window.ec.config.chameleon = window.ec.config.chameleon || Object();
|
386 |
window.ec.config.chameleon.font = $chameleon[font];
|
387 |
window.ec.config.chameleon.colors = $chameleon[colors];
|
|
|
388 |
JS;
|
389 |
|
390 |
}
|
526 |
do_action('ecwid_plugin_installed', $current_version);
|
527 |
add_option('ecwid_plugin_version', $current_version);
|
528 |
|
529 |
+
add_option('ecwid_use_chameleon', false);
|
530 |
|
531 |
add_option('ecwid_use_new_horizontal_categories', 'Y');
|
532 |
|
680 |
|
681 |
function ecwid_remove_default_canonical()
|
682 |
{
|
683 |
+
if ( ecwid_page_has_productbrowser() || Ecwid_Store_Page::is_store_page() ) {
|
684 |
remove_action( 'wp_head','rel_canonical');
|
685 |
}
|
686 |
}
|
892 |
$store_id = get_ecwid_store_id();
|
893 |
$params = ecwid_get_scriptjs_params();
|
894 |
echo '<link rel="preload" href="https://app.ecwid.com/script.js?'
|
895 |
+
. $store_id . $params . '" as="script">' . PHP_EOL;
|
896 |
}
|
897 |
}
|
898 |
|
1734 |
return;
|
1735 |
}
|
1736 |
|
1737 |
+
EcwidPlatform::cache_reset( 'nav_categories_posts' );
|
1738 |
+
EcwidPlatform::cache_reset( 'all_categories' );
|
1739 |
}
|
1740 |
|
1741 |
function ecwid_register_admin_styles($hook_suffix) {
|
2729 |
}
|
2730 |
|
2731 |
function ecwid_update_store_id( $new_store_id ) {
|
2732 |
+
|
2733 |
+
EcwidPlatform::cache_reset( 'nav_categories_posts' );
|
2734 |
+
|
2735 |
update_option( 'ecwid_store_id', $new_store_id );
|
2736 |
update_option( 'ecwid_is_api_enabled', 'off' );
|
2737 |
update_option( 'ecwid_api_check_time', 0 );
|
ecwid_menu_icon.png
ADDED
Binary file
|
images/grid-active.png
ADDED
Binary file
|
images/grid-default.png
ADDED
Binary file
|
images/list-active.png
ADDED
Binary file
|
images/list-default.png
ADDED
Binary file
|
images/table-active.png
ADDED
Binary file
|
images/table-default.png
ADDED
Binary file
|
includes/class-ecwid-kissmetrics.php
ADDED
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ecwid_Kissmetrics {
|
4 |
+
|
5 |
+
const API_KEY = '12a19b058a28c5db7b722584d59e60e4f080e142';
|
6 |
+
const STORAGE_OPTION_NAME = 'ecwid_kissmetrics';
|
7 |
+
const EVENT_PREFIX = 'wp-plugin ';
|
8 |
+
|
9 |
+
static $instance;
|
10 |
+
|
11 |
+
public static function init() {
|
12 |
+
self::$instance = new Ecwid_Kissmetrics();
|
13 |
+
}
|
14 |
+
|
15 |
+
public static function record( $event ) {
|
16 |
+
$fire_in_background = array( 'wpPluginDeactivated', 'wpPluginUninstalled' );
|
17 |
+
$raw_names = array( 'Signed Up' );
|
18 |
+
|
19 |
+
$name = in_array( $event, $raw_names ) ? $event : self::EVENT_PREFIX . $event;
|
20 |
+
|
21 |
+
if ( in_array( $event, $fire_in_background ) ) {
|
22 |
+
self::$instance->_record( $name );
|
23 |
+
} else {
|
24 |
+
self::$instance->_enqueue_record( $name );
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
public static function set( $name, $value ) {
|
29 |
+
self::$instance->_enqueue_property( $name, $value );
|
30 |
+
}
|
31 |
+
|
32 |
+
private function __construct() {
|
33 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_script' ) );
|
34 |
+
}
|
35 |
+
|
36 |
+
public function enqueue_script() {
|
37 |
+
wp_enqueue_script('ecwid-kissmetrics', 'https://scripts.kissmetrics.com/' . self::API_KEY . '.2.js');
|
38 |
+
wp_enqueue_script('ecwid-kissmetrics-events', ECWID_PLUGIN_URL . 'js/kissmetrics.js', array( 'ecwid-kissmetrics' ), get_option('ecwid_plugin_version') );
|
39 |
+
|
40 |
+
|
41 |
+
$this->_enqueue_property('Storefront URL', ecwid_get_store_page_url());
|
42 |
+
$this->_enqueue_property('WP Theme', ecwid_get_theme_name());
|
43 |
+
$this->_enqueue_property('WP Chameleon Enabled', get_option('ecwid_use_chameleon') ? 'true' : 'false');
|
44 |
+
|
45 |
+
$woo = 'none';
|
46 |
+
$all_plugins = get_plugins();
|
47 |
+
if (array_key_exists('woocommerce/woocommerce.php', $all_plugins)) {
|
48 |
+
$active_plugins = get_option('active_plugins');
|
49 |
+
if (in_array('woocommerce/woocommerce.php', $active_plugins)) {
|
50 |
+
$woo = 'active';
|
51 |
+
} else {
|
52 |
+
$woo = 'inactive';
|
53 |
+
}
|
54 |
+
}
|
55 |
+
$kissmetrics['woo'] = $woo;
|
56 |
+
$this->_enqueue_property('Woocommerce installed', $woo);
|
57 |
+
|
58 |
+
$kissmetrics = array(
|
59 |
+
'items' => $this->_get_pending(),
|
60 |
+
'key' => self::API_KEY
|
61 |
+
);
|
62 |
+
|
63 |
+
$this->_flush_pending();
|
64 |
+
|
65 |
+
$store_id = get_ecwid_store_id();
|
66 |
+
if ($store_id != ECWID_DEMO_STORE_ID) {
|
67 |
+
$kissmetrics['store_id'] = $store_id;
|
68 |
+
}
|
69 |
+
|
70 |
+
wp_localize_script('ecwid-kissmetrics-events', 'ecwid_kissmetrics', $kissmetrics);
|
71 |
+
}
|
72 |
+
|
73 |
+
protected function _record($event) {
|
74 |
+
|
75 |
+
$params = array(
|
76 |
+
'_k' => self::API_KEY,
|
77 |
+
'_p' => $_COOKIE['km_ai'],
|
78 |
+
'_n' => $event
|
79 |
+
);
|
80 |
+
$query = http_build_query($params);
|
81 |
+
//die(var_dump($_COOKIE));
|
82 |
+
|
83 |
+
$result = wp_remote_get('http://trk.kissmetrics.com/e?' . $query);
|
84 |
+
}
|
85 |
+
|
86 |
+
protected function _enqueue_record( $event ) {
|
87 |
+
$items = $this->_get_pending();
|
88 |
+
|
89 |
+
array_push( $items, array( 'event' => $event ) );
|
90 |
+
|
91 |
+
update_option ( self::STORAGE_OPTION_NAME, $items );
|
92 |
+
}
|
93 |
+
|
94 |
+
protected function _enqueue_property( $name, $value ) {
|
95 |
+
$items = $this->_get_pending();
|
96 |
+
|
97 |
+
array_push( $items, array(
|
98 |
+
'property' => array(
|
99 |
+
$name => $value
|
100 |
+
)
|
101 |
+
)
|
102 |
+
);
|
103 |
+
|
104 |
+
update_option ( self::STORAGE_OPTION_NAME, $items );
|
105 |
+
}
|
106 |
+
|
107 |
+
protected function _get_pending() {
|
108 |
+
$value = get_option( self::STORAGE_OPTION_NAME );
|
109 |
+
|
110 |
+
if ( !is_array($value) ) {
|
111 |
+
$value = array();
|
112 |
+
}
|
113 |
+
|
114 |
+
return $value;
|
115 |
+
}
|
116 |
+
|
117 |
+
protected function _flush_pending() {
|
118 |
+
update_option( self::STORAGE_OPTION_NAME, null );
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
Ecwid_Kissmetrics::init();
|
includes/class-ecwid-nav-menus.php
CHANGED
@@ -217,7 +217,7 @@ class Ecwid_Nav_Menus {
|
|
217 |
}
|
218 |
$counter++;
|
219 |
|
220 |
-
EcwidPlatform::cache_set( 'nav_categories_posts', $posts,
|
221 |
}
|
222 |
}
|
223 |
|
217 |
}
|
218 |
$counter++;
|
219 |
|
220 |
+
EcwidPlatform::cache_set( 'nav_categories_posts', $posts, DAY_IN_SECONDS );
|
221 |
}
|
222 |
}
|
223 |
|
includes/class-ecwid-seo-links.php
CHANGED
@@ -11,6 +11,11 @@ class Ecwid_Seo_Links {
|
|
11 |
// therefore the action must me registered
|
12 |
add_action( 'rewrite_rules_array', array( $this, 'build_rewrite_rules' ), 1, 1 );
|
13 |
|
|
|
|
|
|
|
|
|
|
|
14 |
if ( self::is_enabled() ) {
|
15 |
|
16 |
add_filter( 'redirect_canonical', array( $this, 'redirect_canonical' ), 10, 2 );
|
@@ -125,6 +130,7 @@ class Ecwid_Seo_Links {
|
|
125 |
$url = esc_js( ecwid_get_store_page_base_url() );
|
126 |
|
127 |
echo <<<JS
|
|
|
128 |
window.ec.config.storefrontUrls.cleanUrls = true;
|
129 |
window.ec.config.baseUrl = '$url';
|
130 |
JS;
|
11 |
// therefore the action must me registered
|
12 |
add_action( 'rewrite_rules_array', array( $this, 'build_rewrite_rules' ), 1, 1 );
|
13 |
|
14 |
+
add_action( 'init', array( $this, 'init' ) );
|
15 |
+
}
|
16 |
+
|
17 |
+
public function init() {
|
18 |
+
|
19 |
if ( self::is_enabled() ) {
|
20 |
|
21 |
add_filter( 'redirect_canonical', array( $this, 'redirect_canonical' ), 10, 2 );
|
130 |
$url = esc_js( ecwid_get_store_page_base_url() );
|
131 |
|
132 |
echo <<<JS
|
133 |
+
window.ec.config.storefrontUrls = window.ec.config.storefrontUrls || {};
|
134 |
window.ec.config.storefrontUrls.cleanUrls = true;
|
135 |
window.ec.config.baseUrl = '$url';
|
136 |
JS;
|
includes/class-ecwid-store-page.php
CHANGED
@@ -115,7 +115,12 @@ class Ecwid_Store_Page {
|
|
115 |
return $page_id;
|
116 |
}
|
117 |
|
118 |
-
public static function is_store_page( $page_id ) {
|
|
|
|
|
|
|
|
|
|
|
119 |
return get_option( 'ecwid_store_page_id' ) == $page_id || get_option( 'ecwid_store_page_id_auto' ) == $page_id;
|
120 |
}
|
121 |
|
115 |
return $page_id;
|
116 |
}
|
117 |
|
118 |
+
public static function is_store_page( $page_id = 0 ) {
|
119 |
+
|
120 |
+
if (!$page_id) {
|
121 |
+
$page_id = get_the_ID();
|
122 |
+
}
|
123 |
+
|
124 |
return get_option( 'ecwid_store_page_id' ) == $page_id || get_option( 'ecwid_store_page_id_auto' ) == $page_id;
|
125 |
}
|
126 |
|
js/advanced.js
ADDED
File without changes
|
js/chameleon.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
window.ec = {
|
2 |
+
config: {
|
3 |
+
chameleon: ecwidChameleon
|
4 |
+
}
|
5 |
+
}
|
js/ecwid-chameleon.js
ADDED
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
if (typeof(Ecwid) == 'object') {
|
2 |
+
Ecwid.OnAPILoaded.add(function() {
|
3 |
+
|
4 |
+
var html_id = document.getElementsByTagName("html")[0].id;
|
5 |
+
var body_id = document.getElementsByTagName("body")[0].id;;
|
6 |
+
var css_prefix = 'html#'+html_id+' body#'+body_id+'.chameleon';
|
7 |
+
|
8 |
+
var css = '';
|
9 |
+
var parent = document.querySelector('.ecwid-shopping-cart-product-browser').parentNode;
|
10 |
+
var computedStyle = getComputedStyle(parent, null);
|
11 |
+
|
12 |
+
var primary_color = tinycolor( (typeof ecwidChameleon !== 'undefined' && typeof ecwidChameleon.primary_color !== 'undefined') ? ecwidChameleon.primary_color : computedStyle.color );
|
13 |
+
var primary_background = tinycolor( (typeof ecwidChameleon !== 'undefined' && typeof ecwidChameleon.primary_background !== 'undefined') ? ecwidChameleon.primary_background : getBackground(parent) );
|
14 |
+
|
15 |
+
if (typeof ecwidChameleon !== 'undefined' && typeof ecwidChameleon.primary_background !== 'undefined') {
|
16 |
+
var primary_link = tinycolor( ecwidChameleon.primary_link );
|
17 |
+
}
|
18 |
+
else {
|
19 |
+
var a = document.createElement('a');
|
20 |
+
a.href = a.textContent = url = '';
|
21 |
+
parent.appendChild(a);
|
22 |
+
var primary_link = tinycolor( document.defaultView.getComputedStyle(a, null).color );
|
23 |
+
parent.removeChild(a);
|
24 |
+
}
|
25 |
+
|
26 |
+
if (tinycolor.equals(primary_background, 'transparent')) {
|
27 |
+
primary_background = tinycolor('#fff');
|
28 |
+
}
|
29 |
+
|
30 |
+
var accent_color = tinycolor(primary_link.toString()).darken(15).brighten();
|
31 |
+
var muted_accent_color = tinycolor(primary_link.toString()).darken(15).setAlpha(.6);
|
32 |
+
|
33 |
+
var hover_link = tinycolor(primary_link.toString()).lighten(20);
|
34 |
+
var muted_color = (primary_color.isLight()) ? tinycolor(primary_color.toString()).darken(15) : tinycolor(primary_color.toString()).lighten(20);
|
35 |
+
var muted_link = tinycolor(primary_color.toString()).lighten(20);
|
36 |
+
var secondary_link = tinycolor(primary_link.toString()).darken(20);
|
37 |
+
|
38 |
+
var border_color = tinycolor(primary_color.toString()).setAlpha(.1);
|
39 |
+
|
40 |
+
var muted_background = tinycolor(primary_background.toString());
|
41 |
+
var muted_background = (muted_background.isLight()) ? muted_background.darken(5) : muted_background.lighten(15);
|
42 |
+
var muted_soft_background = tinycolor(primary_background.toString());
|
43 |
+
var muted_soft_background = (muted_soft_background.isLight()) ? muted_soft_background.darken(10) : muted_soft_background.lighten(20);
|
44 |
+
var hover_background = tinycolor(primary_link.toString()).lighten(20).setAlpha(.2);
|
45 |
+
|
46 |
+
var button_border_color = tinycolor(hover_link.toString()).darken(5);
|
47 |
+
var button_hover_top = tinycolor(hover_link.toString()).lighten(5);
|
48 |
+
var button_hover_bottom = tinycolor(primary_link.toString()).lighten(5);
|
49 |
+
var button_shadow = tinycolor(button_border_color.toString()).lighten(15).setAlpha(.3);
|
50 |
+
var button_hover_shadow = tinycolor(button_border_color.toString()).lighten(15).setAlpha(.4);
|
51 |
+
var button_border_hover_color = tinycolor(hover_link.toString());
|
52 |
+
|
53 |
+
// Additional rules
|
54 |
+
if (!tinycolor.isReadable(accent_color, muted_soft_background)) {
|
55 |
+
accent_color = tinycolor(secondary_link.toString()).brighten(20);
|
56 |
+
muted_accent_color = tinycolor(secondary_link.toString()).lighten(20);
|
57 |
+
}
|
58 |
+
if (!tinycolor.isReadable(secondary_link, '#F0F0F0')) {
|
59 |
+
secondary_link = (secondary_link.isLight()) ? tinycolor(secondary_link.toString()).darken() : tinycolor(secondary_link.toString()).lighten();
|
60 |
+
}
|
61 |
+
var button_color = tinycolor('#fff');
|
62 |
+
if (!tinycolor.isReadable(button_color, primary_link)) {
|
63 |
+
button_color = tinycolor(primary_background.toString());
|
64 |
+
}
|
65 |
+
|
66 |
+
// Font family
|
67 |
+
css+= css_prefix + ' .ecwid, ' + css_prefix + ' .ecwid * '+ css_prefix + ' .ecwid-minicart *, ' + css_prefix + ' .ecwid-SearchPanel * { font-family: inherit !important; }\n';
|
68 |
+
|
69 |
+
|
70 |
+
// Primary colors
|
71 |
+
css+= css_prefix + ' div.ecwid-productBrowser-head{ color: '+ primary_color.toString() +'; }\n';
|
72 |
+
css+= css_prefix + ' div.ecwid-productBrowser-productNameLink a, ' + css_prefix + ' div.ecwid-productBrowser-productNameLink a:active, ' + css_prefix + ' div.ecwid-productBrowser-productNameLink a:visited{ color: '+ muted_color.toString() +'; }\n';
|
73 |
+
css+= css_prefix + ' div.ecwid-productBrowser-productsGrid-productMiddleFragment-mouseover div.ecwid-productBrowser-productNameLink a, ' + css_prefix + ' div.ecwid-productBrowser-productsGrid-productMiddleFragment-mouseover div.ecwid-productBrowser-productNameLink a:active, ' + css_prefix + ' div.ecwid-productBrowser-productsGrid-productMiddleFragment-mouseover div.ecwid-productBrowser-productNameLink a:visited{ font-size: 17px; color: '+ primary_color.toString() +'; }\n';
|
74 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart div.ecwid-productBrowser-productNameLink a, ' + css_prefix + ' div.ecwid-productBrowser-cart div.ecwid-productBrowser-productNameLink a:active, ' + css_prefix + ' div.ecwid-productBrowser-cart div.ecwid-productBrowser-productNameLink a:visited{ color: '+ primary_color.toString() +'; }\n';
|
75 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart div.ecwid-productBrowser-price{ color: '+ primary_color.toString() +'; }\n';
|
76 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart-subtotalAmount, ' + css_prefix + ' div.ecwid-productBrowser-cart-subtotalAmountMinus, ' + css_prefix + ' div.ecwid-productBrowser-cart-shippingAmount, ' + css_prefix + ' div.ecwid-productBrowser-cart-taxAmount{ color: '+ primary_color.toString() +'; }\n';
|
77 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart-totalLabel{ color: '+ primary_color.toString() +'; }\n';
|
78 |
+
css+= css_prefix + ' table.ecwid-productBrowser-productsTable-v2 div.ecwid-productBrowser-productNameLink:hover a, ' + css_prefix + ' table.ecwid-productBrowser-productsList-v2 div.ecwid-productBrowser-productNameLink:hover a, ' + css_prefix + ' table.ecwid-productBrowser-productsGrid-v2 div.ecwid-productBrowser-productNameLink:hover a { color: '+ primary_color.toString() +'; }\n';
|
79 |
+
css+= css_prefix + ' table.ecwid-Invoice-itemsTable .ecwid-productBrowser-price, ' + css_prefix + ' table.ecwid-Invoice-itemsTable .ecwid-Invoice-qtyLabel{ color: '+ primary_color.toString() +'; }\n';
|
80 |
+
css+= css_prefix + ' .ecwid-minicart-mini-count{ color: '+ primary_link.toString() +'; }\n';
|
81 |
+
|
82 |
+
// Muted colors
|
83 |
+
css+= css_prefix + ' .ecwid{ color: '+ muted_color.toString() +'; }\n';
|
84 |
+
css+= css_prefix + ' div.ecwid-productBrowser-categoryPath{ color: '+ muted_color.toString() +'; }\n';
|
85 |
+
css+= css_prefix + ' div.ecwid-productBrowser-subcategories-categoryName{ color: '+ muted_color.toString() +'; }\n';
|
86 |
+
css+= css_prefix + ' div.ecwid-results-topPanel div.ecwid-results-topPanel-itemsCountLabel{ color: '+ muted_color.toString() +'; }\n';
|
87 |
+
css+= css_prefix + ' div.ecwid-productBrowser-sku{ color: '+ muted_color.toString() +'; }\n';
|
88 |
+
css+= css_prefix + ' div.ecwid-results-topPanel div{ color: '+ muted_color.toString() +'; }\n';
|
89 |
+
css+= css_prefix + ' div.ecwid-productBrowser-details-optionPanel label.ecwid-fieldLabel{ color: '+ muted_color.toString() +'; }\n';
|
90 |
+
css+= css_prefix + ' div.ecwid-productBrowser-details-qtyLabel{ color: '+ muted_color.toString() +'; }\n';
|
91 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart div.ecwid-productBrowser-sku{ color: '+ muted_color.toString() +'; }\n';
|
92 |
+
css+= css_prefix + ' span.ecwid-productBrowser-cart-weight{ color: '+ muted_color.toString() +'; }\n';
|
93 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart-optionsList{ color: '+ muted_color.toString() +'; }\n';
|
94 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart-subtotalLabel,' + css_prefix + ' div.ecwid-productBrowser-cart-shippingLabel,' + css_prefix + ' div.ecwid-productBrowser-cart-taxLabel{ color: '+ muted_color.toString() +'; }\n';
|
95 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart-estimationNote{ color: '+ muted_color.toString() +'; }\n';
|
96 |
+
css+= css_prefix + ' label.ecwid-fieldLabel{ color: '+ muted_color.toString() +'; }\n';
|
97 |
+
css+= css_prefix + ' div.ecwid-FormPopup-fieldWrapper label.ecwid-fieldLabel{ color: '+ muted_color.toString() +'; }\n';
|
98 |
+
css+= css_prefix + ' div.ecwid-Checkout-PasswordBlock-tip{ color: '+ muted_color.toString() +'; }\n';
|
99 |
+
css+= css_prefix + ' div.ecwid-pager{ color: '+ muted_color.toString() +'; }\n';
|
100 |
+
css+= css_prefix + ' div.ecwid-pager span.ecwid-pager-link-disabled{ color: '+ muted_color.toString() +'; }\n';
|
101 |
+
css+= css_prefix + ' div.ecwid-productBrowser-details-inTheBag div{ color: '+ muted_color.toString() +'; }\n';
|
102 |
+
css+= css_prefix + ' div.ecwid-productBrowser-productsList-descr{ color: '+ muted_color.toString() +'; }\n';
|
103 |
+
css+= css_prefix + ' div.ecwid-productBrowser-productsTable div.ecwid-productBrowser-sku{ color: '+ muted_color.toString() +'; }\n';
|
104 |
+
css+= css_prefix + ' div.ecwid-productBrowser-extraFields-side{ color: '+ muted_color.toString() +'; }\n';
|
105 |
+
css+= css_prefix + ' div.ecwid-Invoice-block{ color: '+ muted_color.toString() +'; }\n';
|
106 |
+
css+= css_prefix + ' table.ecwid-Invoice-itemsTable .ecwid-productBrowser-sku{ color: '+ muted_color.toString() +'; }\n';
|
107 |
+
css+= css_prefix + ' table.ecwid-Invoice-itemsTable .ecwid-Invoice-optionsList{ color: '+ muted_color.toString() +'; }\n';
|
108 |
+
css+= css_prefix + ' table.ecwid-Invoice-itemsTable .ecwid-productBrowser-price,' + css_prefix + ' table.ecwid-Invoice-itemsTable .ecwid-Invoice-qtyLabel{ color: '+ muted_color.toString() +'; }\n';
|
109 |
+
css+= css_prefix + ' div.ecwid-Invoice-Summary-label,' + css_prefix + ' div.ecwid-Invoice-Summary-value{ color: '+ muted_color.toString() +'; }\n';
|
110 |
+
css+= css_prefix + ' div.ecwid-Invoice-header-placeOrder div.gwt-Label,' + css_prefix + ' div.ecwid-Invoice-footer-placeOrder div.gwt-Label,' + css_prefix + ' td.ecwid-Invoice-header-orderConfirmation-text,' + css_prefix + ' td.ecwid-Invoice-footer-orderConfirmation-text{ color: '+ muted_color.toString() +'; }\n';
|
111 |
+
css+= css_prefix + ' div.ecwid-productBrowser-details-outOfStockLabel{ color: '+ muted_color.toString() +'; }\n';
|
112 |
+
|
113 |
+
// Borders
|
114 |
+
css+= css_prefix + ' div.ecwid-productBrowser-productsGrid-productTopFragment-mouseover,' + css_prefix + ' div.ecwid-productBrowser-productsGrid-productBottomFragment-mouseover{ border-color: '+ border_color.toString() +'; }\n';
|
115 |
+
css+= css_prefix + ' .ecwid-productBrowser-productsGrid-v2 td.ecwid-productBrowser-productsGrid-productInside.ecwid-productBrowser-productsGrid-hover{ border-color: '+ border_color.toString() +'; }\n';
|
116 |
+
css+= css_prefix + ' td.ecwid-productBrowser-productsList-mouseover{ border-color: '+ border_color.toString() +'; }\n';
|
117 |
+
css+= css_prefix + ' .ecwid-productBrowser-relatedProducts .ecwid-productBrowser-relatedProducts-item-top-hover{ border-color: '+ border_color.toString() +'; }\n';
|
118 |
+
css+= css_prefix + ' .ecwid-productBrowser-relatedProducts .ecwid-productBrowser-relatedProducts-item-bottom-hover{ border-color: '+ border_color.toString() +'; }\n';
|
119 |
+
css+= css_prefix + ' table.ecwid-categoriesTabBar div.gwt-TabBarFirst,' + css_prefix + ' table.ecwid-categoriesTabBar div.gwt-TabBarRest,' + css_prefix + ' table.ecwid-categoriesTabBar table.gwt-TabBarItem,' + css_prefix + ' div.ecwid-categories-horizontal-menuBarContainer,' + css_prefix + ' td.ecwid-categories-vertical-table-cell,' + css_prefix + ' div.ecwid-categories-MenuBarPopup div.menuSeparatorInner{ border-color: '+ border_color.toString() +'; }\n';
|
120 |
+
|
121 |
+
// Accents
|
122 |
+
css+= css_prefix + ' div.ecwid-productBrowser-price{ color: '+ accent_color.toString() +'; }\n';
|
123 |
+
css+= css_prefix + ' div.ecwid-productBrowser-details-inStockLabel{ color: '+ muted_accent_color.toString() +'; }\n';
|
124 |
+
css+= css_prefix + ' div.ecwid-Checkout-blockTitle,' + css_prefix + ' table.ecwid-Checkout-blockTitle div.gwt-Label,' + css_prefix + ' table.ecwid-Checkout-blockTitle div.gwt-HTML{ color: '+ muted_accent_color.toString() +'; }\n';
|
125 |
+
css+= css_prefix + ' div.ecwid-Checkout-BreadCrumbs-link-visited{ color: '+ muted_accent_color.toString() +'; }\n';
|
126 |
+
css+= css_prefix + ' div.ecwid-Checkout-BreadCrumbs-link-current{ color: '+ muted_accent_color.toString() +'; border-color: '+ muted_accent_color.toString() +'; }\n';
|
127 |
+
css+= css_prefix + ' div.ecwid-fieldEnvelope-label{ color: '+ accent_color.toString() +'; }\n';
|
128 |
+
css+= css_prefix + ' input.gwt-PasswordTextBox,' + css_prefix + ' textarea.gwt-TextArea,' + css_prefix + ' input.gwt-DateBox{ color: '+ accent_color.toString() +'; }\n';
|
129 |
+
css+= css_prefix + ' .ecwid div.ecwid-AccentedContinueButton-label{ color: '+ accent_color.toString() +'; }\n';
|
130 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart-termsCheckbox-rollover{ background-color: '+ hover_background.toString() +'; }\n';
|
131 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart-estimationNote span{ color: '+ muted_accent_color.toString() +'; }\n';
|
132 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart-asterisk{ color: '+ muted_accent_color.toString() +'; }\n';
|
133 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart-totalAmount{ color: '+ accent_color.toString() +'; }\n';
|
134 |
+
|
135 |
+
// Primary links
|
136 |
+
css+= css_prefix + ' div.ecwid-productBrowser-categoryPath a,' + css_prefix + ' div.ecwid-productBrowser-categoryPath a:active,' + css_prefix + ' div.ecwid-productBrowser-categoryPath a:visited{ color: '+ primary_link.toString() +'; }\n';
|
137 |
+
css+= css_prefix + ' .ecwid a,' + css_prefix + ' .ecwid a:active, ' + css_prefix + ' .ecwid a:visited{ color: '+ primary_link.toString() +'; }\n';
|
138 |
+
css+= css_prefix + ' div.ecwid-results-topPanel div.ecwid-results-topPanel-viewAsPanel-link{ color: '+ primary_link.toString() +'; }\n';
|
139 |
+
css+= css_prefix + ' div.ecwid-pager span.ecwid-pager-link-enabled{ color: '+ primary_link.toString() +'; }\n';
|
140 |
+
css+= css_prefix + ' div.ecwid-productBrowser-productsTable-addToBagLink{ color: '+ primary_link.toString() +'; }\n';
|
141 |
+
|
142 |
+
// Hover links
|
143 |
+
css+= css_prefix + ' div.ecwid-productBrowser-categoryPath a:hover{ color: '+ hover_link.toString() +'; }\n';
|
144 |
+
css+= css_prefix + ' .ecwid a:hover{ color: '+ hover_link.toString() +'; }\n';
|
145 |
+
css+= css_prefix + ' div.ecwid-results-topPanel div.ecwid-results-topPanel-viewAsPanel-link:hover{ color: '+ hover_link.toString() +'; }\n';
|
146 |
+
|
147 |
+
// Backgrounds
|
148 |
+
css+= css_prefix + ' .ecwid .ecwid-ProductDetails-gray-panel-bottom,' + css_prefix + ' .ecwid .ecwid-productBrowser-ask-advice-panel{ background-color: '+ muted_background.toString() +'; }\n';
|
149 |
+
css+= css_prefix + ' .ecwid-productBrowser-details-rightPanel div.ecwid-productBrowser-sharePanel-header{ background-color: '+ muted_background.toString() +'; }\n';
|
150 |
+
css+= css_prefix + ' a.ecwid-productBrowser-nav-left,' + css_prefix + ' a.ecwid-productBrowser-nav-right{ background-color: '+ muted_background.toString() +'; }\n';
|
151 |
+
css+= css_prefix + ' .ecwid .ecwid-productBrowser-ask-advice-panel{ background-color: '+ muted_background.toString() +'; }\n';
|
152 |
+
css+= css_prefix + ' .ecwid .ecwid-productBrowser-ask-advice-panel .ecwid-productBrowser-ask-advice-panel-icon{ background-color: '+ muted_background.toString() +'; }\n';
|
153 |
+
css+= css_prefix + ' div.ecwid-productBrowser-backgroundedPanel{ background-color: '+ muted_soft_background.toString() +'; }\n';
|
154 |
+
css+= css_prefix + ' .ecwid-productBrowser-details-rightPanel .ecwid-productBrowser-sharePanel-buttonsContainer{ background-color: '+ muted_soft_background.toString() +'; border-color: '+ tinycolor(muted_color.toString()).setAlpha(.2).toString() +'}\n';
|
155 |
+
css+= css_prefix + ' tr.ecwid-productBrowser-cart-itemsTable-row-selected,' + css_prefix + ' td.ecwid-productBrowser-cart-itemsTable-cell-selected{ background-color: '+ muted_background.toString() +'; }\n';
|
156 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart-EnterCouponBox{ background-color: '+ muted_background.toString() +'; border-color: transparent; }\n';
|
157 |
+
css+= css_prefix + ' div.ecwid-form{ background-color: '+ muted_background.toString() +'; }\n';
|
158 |
+
css+= css_prefix + ' .ecwid input.ecwid-productBrowser-details-qtyTextField{ color: '+ primary_color.toString() +'; }\n';
|
159 |
+
css+= css_prefix + ' td.ecwid-productBrowser-productsTable-cell{ background-color: '+ primary_background.toString() +'; }\n';
|
160 |
+
css+= css_prefix + ' td.ecwid-productBrowser-productsTable-cellOdd{ background-color: '+ muted_background.toString() +'; }\n';
|
161 |
+
css+= css_prefix + ' input.gwt-TextBox, ' + css_prefix + ' input.gwt-PasswordTextBox, ' + css_prefix + ' textarea.gwt-TextArea, ' + css_prefix + ' input.gwt-DateBox, ' + css_prefix + ' .ecwid-SearchPanel-field{ background-color: '+ primary_background.toString() +'; }\n';
|
162 |
+
css+= css_prefix + ' div.ecwid-Invoice-cell-title{ color: '+ muted_color +';background-color: '+ muted_background.toString() +'; }\n';
|
163 |
+
css+= css_prefix + ' div.ecwid-Invoice-blockTitle{ color: '+ muted_color +';background-color: '+ muted_background.toString() +'; }\n';
|
164 |
+
css+= css_prefix + ' td.ecwid-Invoice-cell{ background-color: '+ muted_background.toString() +'; }\n';
|
165 |
+
css+= css_prefix + ' td.ecwid-Invoice-edgeCell{ background-color: '+ muted_background.toString() +'; }\n';
|
166 |
+
|
167 |
+
// Buttons
|
168 |
+
css+= css_prefix + ' div.ecwid-AddToBagButton::after { content: "' + msg('TableProductsContainer.add_to_bag', 'Add To Bag') + '"; white-space: nowrap; }\n';
|
169 |
+
css+= css_prefix + ' div.ecwid-ContinueShoppingButton::after { content: "' + msg('ShoppingCartView.continue', 'Continue Shopping') + '"; white-space: nowrap; }\n';
|
170 |
+
css+= css_prefix + ' div.ecwid-productBrowser-cart-checkoutButton:after { content: "' + msg('FBAutofillCheckout.Breadcrumbs.checkout', 'Checkout') + '"; white-space: nowrap; }\n';
|
171 |
+
css+= css_prefix + ' div.ecwid-Checkout-placeOrderButton::after { content: "' + msg('FBAutofillCheckout.Breadcrumbs.checkout', 'Place Order') + '"; white-space: nowrap; }\n';
|
172 |
+
|
173 |
+
css+= css_prefix + ' div.ecwid-ContinueShoppingButton::after,' + css_prefix + ' div.ecwid-Checkout-placeOrderButton::after, ' + css_prefix + ' div.ecwid-AddToBagButton::after, ' + css_prefix + ' div.ecwid-productBrowser-cart-checkoutButton::after, ' + css_prefix + ' button.ecwid-AccentedButton span, ' + css_prefix + ' div.ecwid-Checkout-placeOrderButton::after{ color: '+ button_color +'; }\n';
|
174 |
+
|
175 |
+
css+= css_prefix + ' button.ecwid-AccentedButton,' + css_prefix + ' div.ecwid-AddToBagButton-up, ' + css_prefix + ' div.ecwid-productBrowser-cart-checkoutButton-up,' + css_prefix + ' div.ecwid-Checkout-placeOrderButton-up,' + css_prefix + ' div.ecwid-ContinueShoppingButton-up,' + css_prefix + ' div.ecwid-AddToBagButton-up-hovering,' + css_prefix + ' div.ecwid-AddToBagButton-down-hovering,' + css_prefix + ' div.ecwid-productBrowser-cart-checkoutButton-up-hovering,' + css_prefix + ' div.ecwid-productBrowser-cart-checkoutButton-down-hovering,' + css_prefix + ' div.ecwid-Checkout-placeOrderButton-down-hovering,' + css_prefix + ' div.ecwid-Checkout-placeOrderButton-up-hovering,' + css_prefix + ' div.ecwid-ContinueShoppingButton-up-hovering,' + css_prefix + ' div.ecwid-ContinueShoppingButton-down-hovering,' + css_prefix + ' button.ecwid-AccentedButton:hover { -webkit-box-sizing: border-box; box-sizing: border-box; width: auto; min-width: 160px; height: auto; padding: 11px 40px; background-color: '+primary_link+'; background-image: -webkit-gradient(linear, left top, left bottom, from('+hover_link+'), to('+primary_link+')); background-image: -webkit-linear-gradient(top, '+hover_link+', '+primary_link+'); background-image: -moz-linear-gradient(top, '+hover_link+', '+primary_link+'); background-image: -ms-linear-gradient(top, '+hover_link+', '+primary_link+'); background-image: -o-linear-gradient(top, '+hover_link+', '+primary_link+'); background-image: linear-gradient(to bottom, '+hover_link+', '+primary_link+'); border: 1px solid '+button_border_color+'; -webkit-box-shadow: inset 0 1px 0 '+button_shadow+'; box-shadow: inset 0 1px 0 '+button_shadow+'; text-decoration: none; text-shadow: 0 1px 0 rgba(0,0,0,0.1); border-radius: 3px; padding-left: 20px; padding-right: 20px; }\n';
|
176 |
+
|
177 |
+
css+= css_prefix + ' div.ecwid-AddToBagButton-up-hovering,' + css_prefix + ' div.ecwid-productBrowser-cart-checkoutButton-up-hovering,' + css_prefix + ' div.ecwid-Checkout-placeOrderButton-up-hovering,' + css_prefix + ' div.ecwid-ContinueShoppingButton-up-hovering { background-image: -webkit-gradient(linear, left top, left bottom, from('+button_hover_top+'), to('+button_hover_bottom+')); background-image: -webkit-linear-gradient(top, '+button_hover_top+', '+button_hover_bottom+'); background-image: -moz-linear-gradient(top, '+button_hover_top+', '+button_hover_bottom+'); background-image: -ms-linear-gradient(top, '+button_hover_top+', '+button_hover_bottom+'); background-image: -o-linear-gradient(top, '+button_hover_top+', '+button_hover_bottom+'); background-image: linear-gradient(to bottom, '+button_hover_top+', '+button_hover_bottom+'); border: 1px solid '+button_border_hover_color+'; -webkit-box-shadow: inset 0 1px 0 '+button_hover_shadow+'; box-shadow: inset 0 1px 0 '+button_hover_shadow+'; text-decoration: none; text-shadow: 0 -1px 0 rgba(0,0,0,0.2); } \n';
|
178 |
+
|
179 |
+
|
180 |
+
css+= css_prefix + ' button.gwt-Button,' + css_prefix + ' #wrapper button.gwt-Button{ color: '+ secondary_link +'; }\n';
|
181 |
+
css+= css_prefix + ' button.ecwid-AccentedButton{ line-height: 1; }\n';
|
182 |
+
|
183 |
+
// Search
|
184 |
+
css+= css_prefix + ' .ecwid-SearchPanel-button { background-color: '+ muted_background.toString() +'; border: 1px solid '+ border_color +'; border-radius: 2px; color: '+ primary_color +'; cursor: pointer; font-size: 12px; height: 26px; outline: medium none; padding: 2px 5px; text-decoration: none; vertical-align: baseline; white-space: nowrap; }\n';
|
185 |
+
|
186 |
+
// Categories
|
187 |
+
css+= css_prefix + ' span.ecwid-categories-category{ color: '+ muted_color.toString() +'; }\n';
|
188 |
+
css+= css_prefix + ' div.ecwid-categoriesMenuBar td.gwt-MenuItem-selected span.ecwid-categories-category,' + css_prefix + ' div.ecwid-categoriesMenuBar td.gwt-MenuItem-current span.ecwid-categories-category,' + css_prefix + ' td.ecwid-categories-vertical-table-cell-selected span.ecwid-categories-category,' + css_prefix + ' table.ecwid-categoriesTabBar table.gwt-TabBarItem-selected span.ecwid-categories-category{ color: '+ primary_link.toString() +'; }\n';
|
189 |
+
|
190 |
+
css+= css_prefix + ' table.ecwid-categoriesTabBar table.gwt-TabBarItem-selected td { background: none !important; }\n';
|
191 |
+
css+= css_prefix + ' table.ecwid-categoriesTabBar table.gwt-TabBarItem-selected { border: 1px solid; border-bottom: 0px; border-color: '+ border_color.toString() +'; }\n';
|
192 |
+
css+= css_prefix + ' .ecwid .ecwid-productBrowser-ask-advice-panel { min-height: 18px; height: auto; }\n';
|
193 |
+
|
194 |
+
head = document.getElementsByTagName('head')[0],
|
195 |
+
style = document.createElement('style');
|
196 |
+
style.type = 'text/css';
|
197 |
+
if (style.styleSheet) {
|
198 |
+
style.styleSheet.cssText = css;
|
199 |
+
} else {
|
200 |
+
style.appendChild(document.createTextNode(css));
|
201 |
+
}
|
202 |
+
head.appendChild(style);
|
203 |
+
document.getElementsByTagName("body")[0].className += ' chameleon';
|
204 |
+
});
|
205 |
+
}
|
206 |
+
|
207 |
+
function getLinkColor(url) {
|
208 |
+
var a = document.createElement('a');
|
209 |
+
a.href = a.textContent = url;
|
210 |
+
document.body.appendChild(a);
|
211 |
+
return document.defaultView.getComputedStyle(a, null).color;
|
212 |
+
}
|
213 |
+
|
214 |
+
function toCamelCase(s){
|
215 |
+
for(var exp=/-([a-z])/; exp.test(s); s=s.replace(exp,RegExp.$1.toUpperCase()));
|
216 |
+
return s;
|
217 |
+
}
|
218 |
+
|
219 |
+
function getStyle(e,a){
|
220 |
+
var v=null;
|
221 |
+
if(document.defaultView && document.defaultView.getComputedStyle){
|
222 |
+
var cs = document.defaultView.getComputedStyle(e, null);
|
223 |
+
if(cs && cs.getPropertyValue)
|
224 |
+
v = cs.getPropertyValue(a);
|
225 |
+
}
|
226 |
+
if(!v && e.currentStyle)
|
227 |
+
v = e.currentStyle[toCamelCase(a)];
|
228 |
+
return v;
|
229 |
+
}
|
230 |
+
|
231 |
+
function getBackground(e){
|
232 |
+
var v = getStyle(e,'background-color');
|
233 |
+
while (!v || v=='transparent' || v=='#000000' || v=='rgba(0, 0, 0, 0)'){
|
234 |
+
if( e == document.body )
|
235 |
+
v = '#fff';
|
236 |
+
else {
|
237 |
+
e = e.parentNode;
|
238 |
+
v = getStyle(e, 'background-color');
|
239 |
+
}
|
240 |
+
}
|
241 |
+
return v;
|
242 |
+
}
|
243 |
+
|
244 |
+
function msg(label, defaultValue) {
|
245 |
+
var messageBundles = (window.Ecwid && window.Ecwid.MessageBundles) ? window.Ecwid.MessageBundles : {};
|
246 |
+
var bundle = messageBundles['ru.cdev.xnext.client'] ? messageBundles['ru.cdev.xnext.client'] : {};
|
247 |
+
return bundle[label] || defaultValue;
|
248 |
+
}
|
249 |
+
|
250 |
+
// TinyColor v1.1.2
|
251 |
+
// https://github.com/bgrins/TinyColor
|
252 |
+
// Brian Grinstead, MIT License
|
253 |
+
!function(){function t(r,n){if(r=r?r:"",n=n||{},r instanceof t)return r;if(!(this instanceof t))return new t(r,n);var a=e(r);this._originalInput=r,this._r=a.r,this._g=a.g,this._b=a.b,this._a=a.a,this._roundA=j(100*this._a)/100,this._format=n.format||a.format,this._gradientType=n.gradientType,this._r<1&&(this._r=j(this._r)),this._g<1&&(this._g=j(this._g)),this._b<1&&(this._b=j(this._b)),this._ok=a.ok,this._tc_id=I++}function e(t){var e={r:0,g:0,b:0},n=1,i=!1,o=!1;return"string"==typeof t&&(t=q(t)),"object"==typeof t&&(t.hasOwnProperty("r")&&t.hasOwnProperty("g")&&t.hasOwnProperty("b")?(e=r(t.r,t.g,t.b),i=!0,o="%"===String(t.r).substr(-1)?"prgb":"rgb"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("v")?(t.s=O(t.s),t.v=O(t.v),e=s(t.h,t.s,t.v),i=!0,o="hsv"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("l")&&(t.s=O(t.s),t.l=O(t.l),e=a(t.h,t.s,t.l),i=!0,o="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=k(n),{ok:i,format:t.format||o,r:T(255,$(e.r,0)),g:T(255,$(e.g,0)),b:T(255,$(e.b,0)),a:n}}function r(t,e,r){return{r:255*A(t,255),g:255*A(e,255),b:255*A(r,255)}}function n(t,e,r){t=A(t,255),e=A(e,255),r=A(r,255);var n,a,i=$(t,e,r),s=T(t,e,r),o=(i+s)/2;if(i==s)n=a=0;else{var f=i-s;switch(a=o>.5?f/(2-i-s):f/(i+s),i){case t:n=(e-r)/f+(r>e?6:0);break;case e:n=(r-t)/f+2;break;case r:n=(t-e)/f+4}n/=6}return{h:n,s:a,l:o}}function a(t,e,r){function n(t,e,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?t+6*(e-t)*r:.5>r?e:2/3>r?t+(e-t)*(2/3-r)*6:t}var a,i,s;if(t=A(t,360),e=A(e,100),r=A(r,100),0===e)a=i=s=r;else{var o=.5>r?r*(1+e):r+e-r*e,f=2*r-o;a=n(f,o,t+1/3),i=n(f,o,t),s=n(f,o,t-1/3)}return{r:255*a,g:255*i,b:255*s}}function i(t,e,r){t=A(t,255),e=A(e,255),r=A(r,255);var n,a,i=$(t,e,r),s=T(t,e,r),o=i,f=i-s;if(a=0===i?0:f/i,i==s)n=0;else{switch(i){case t:n=(e-r)/f+(r>e?6:0);break;case e:n=(r-t)/f+2;break;case r:n=(t-e)/f+4}n/=6}return{h:n,s:a,v:o}}function s(t,e,r){t=6*A(t,360),e=A(e,100),r=A(r,100);var n=N.floor(t),a=t-n,i=r*(1-e),s=r*(1-a*e),o=r*(1-(1-a)*e),f=n%6,h=[r,s,i,i,o,r][f],u=[o,r,r,s,i,i][f],l=[i,i,o,r,r,s][f];return{r:255*h,g:255*u,b:255*l}}function o(t,e,r,n){var a=[M(j(t).toString(16)),M(j(e).toString(16)),M(j(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function f(t,e,r,n){var a=[M(P(n)),M(j(t).toString(16)),M(j(e).toString(16)),M(j(r).toString(16))];return a.join("")}function h(e,r){r=0===r?0:r||10;var n=t(e).toHsl();return n.s-=r/100,n.s=H(n.s),t(n)}function u(e,r){r=0===r?0:r||10;var n=t(e).toHsl();return n.s+=r/100,n.s=H(n.s),t(n)}function l(e){return t(e).desaturate(100)}function c(e,r){r=0===r?0:r||10;var n=t(e).toHsl();return n.l+=r/100,n.l=H(n.l),t(n)}function g(e,r){r=0===r?0:r||10;var n=t(e).toRgb();return n.r=$(0,T(255,n.r-j(255*-(r/100)))),n.g=$(0,T(255,n.g-j(255*-(r/100)))),n.b=$(0,T(255,n.b-j(255*-(r/100)))),t(n)}function d(e,r){r=0===r?0:r||10;var n=t(e).toHsl();return n.l-=r/100,n.l=H(n.l),t(n)}function b(e,r){var n=t(e).toHsl(),a=(j(n.h)+r)%360;return n.h=0>a?360+a:a,t(n)}function p(e){var r=t(e).toHsl();return r.h=(r.h+180)%360,t(r)}function m(e){var r=t(e).toHsl(),n=r.h;return[t(e),t({h:(n+120)%360,s:r.s,l:r.l}),t({h:(n+240)%360,s:r.s,l:r.l})]}function _(e){var r=t(e).toHsl(),n=r.h;return[t(e),t({h:(n+90)%360,s:r.s,l:r.l}),t({h:(n+180)%360,s:r.s,l:r.l}),t({h:(n+270)%360,s:r.s,l:r.l})]}function v(e){var r=t(e).toHsl(),n=r.h;return[t(e),t({h:(n+72)%360,s:r.s,l:r.l}),t({h:(n+216)%360,s:r.s,l:r.l})]}function y(e,r,n){r=r||6,n=n||30;var a=t(e).toHsl(),i=360/n,s=[t(e)];for(a.h=(a.h-(i*r>>1)+720)%360;--r;)a.h=(a.h+i)%360,s.push(t(a));return s}function w(e,r){r=r||6;for(var n=t(e).toHsv(),a=n.h,i=n.s,s=n.v,o=[],f=1/r;r--;)o.push(t({h:a,s:i,v:s})),s=(s+f)%1;return o}function x(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function k(t){return t=parseFloat(t),(isNaN(t)||0>t||t>1)&&(t=1),t}function A(t,e){R(t)&&(t="100%");var r=F(t);return t=T(e,$(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),N.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function H(t){return T(1,$(0,t))}function S(t){return parseInt(t,16)}function R(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function F(t){return"string"==typeof t&&-1!=t.indexOf("%")}function M(t){return 1==t.length?"0"+t:""+t}function O(t){return 1>=t&&(t=100*t+"%"),t}function P(t){return Math.round(255*parseFloat(t)).toString(16)}function C(t){return S(t)/255}function q(t){t=t.replace(z,"").replace(E,"").toLowerCase();var e=!1;if(B[t])t=B[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=U.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=U.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=U.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=U.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=U.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=U.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=U.hex8.exec(t))?{a:C(r[1]),r:S(r[2]),g:S(r[3]),b:S(r[4]),format:e?"name":"hex8"}:(r=U.hex6.exec(t))?{r:S(r[1]),g:S(r[2]),b:S(r[3]),format:e?"name":"hex"}:(r=U.hex3.exec(t))?{r:S(r[1]+""+r[1]),g:S(r[2]+""+r[2]),b:S(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function L(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var z=/^[\s,#]+/,E=/\s+$/,I=0,N=Math,j=N.round,T=N.min,$=N.max,D=N.random;t.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n,a,i,s=this.toRgb();return t=s.r/255,e=s.g/255,r=s.b/255,n=.03928>=t?t/12.92:Math.pow((t+.055)/1.055,2.4),a=.03928>=e?e/12.92:Math.pow((e+.055)/1.055,2.4),i=.03928>=r?r/12.92:Math.pow((r+.055)/1.055,2.4),.2126*n+.7152*a+.0722*i},setAlpha:function(t){return this._a=k(t),this._roundA=j(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=j(360*t.h),r=j(100*t.s),n=j(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=j(360*t.h),r=j(100*t.s),a=j(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+a+"%)":"hsla("+e+", "+r+"%, "+a+"%, "+this._roundA+")"},toHex:function(t){return o(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return f(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:j(this._r),g:j(this._g),b:j(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+j(this._r)+", "+j(this._g)+", "+j(this._b)+")":"rgba("+j(this._r)+", "+j(this._g)+", "+j(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:j(100*A(this._r,255))+"%",g:j(100*A(this._g,255))+"%",b:j(100*A(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+j(100*A(this._r,255))+"%, "+j(100*A(this._g,255))+"%, "+j(100*A(this._b,255))+"%)":"rgba("+j(100*A(this._r,255))+"%, "+j(100*A(this._g,255))+"%, "+j(100*A(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":this._a<1?!1:G[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+f(this._r,this._g,this._b,this._a),n=r,a=this._gradientType?"GradientType = 1, ":"";if(e){var i=t(e);n=i.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0,a=!e&&n&&("hex"===t||"hex6"===t||"hex3"===t||"name"===t);return a?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),("hex"===t||"hex6"===t)&&(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(c,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(d,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(u,arguments)},greyscale:function(){return this._applyModification(l,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(w,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(m,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},t.fromRatio=function(e,r){if("object"==typeof e){var n={};for(var a in e)e.hasOwnProperty(a)&&(n[a]="a"===a?e[a]:O(e[a]));e=n}return t(e,r)},t.equals=function(e,r){return e&&r?t(e).toRgbString()==t(r).toRgbString():!1},t.random=function(){return t.fromRatio({r:D(),g:D(),b:D()})},t.mix=function(e,r,n){n=0===n?0:n||50;var a,i=t(e).toRgb(),s=t(r).toRgb(),o=n/100,f=2*o-1,h=s.a-i.a;a=f*h==-1?f:(f+h)/(1+f*h),a=(a+1)/2;var u=1-a,l={r:s.r*a+i.r*u,g:s.g*a+i.g*u,b:s.b*a+i.b*u,a:s.a*o+i.a*(1-o)};return t(l)},t.readability=function(e,r){var n=t(e),a=t(r);return(Math.max(n.getLuminance(),a.getLuminance())+.05)/(Math.min(n.getLuminance(),a.getLuminance())+.05)},t.isReadable=function(e,r,n){var a,i,s=t.readability(e,r);switch(i=!1,a=L(n),a.level+a.size){case"AAsmall":case"AAAlarge":i=s>=4.5;break;case"AAlarge":i=s>=3;break;case"AAAsmall":i=s>=7}return i},t.mostReadable=function(e,r,n){var a,i,s,o,f=null,h=0;n=n||{},i=n.includeFallbackColors,s=n.level,o=n.size;for(var u=0;u<r.length;u++)a=t.readability(e,r[u]),a>h&&(h=a,f=t(r[u]));return t.isReadable(e,f,{level:s,size:o})||!i?f:(n.includeFallbackColors=!1,t.mostReadable(e,["#fff","#000"],n))};var B=t.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},G=t.hexNames=x(B),U=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",a="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+a),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd?define(function(){return t}):window.tinycolor=t}();
|
js/kissmetrics.js
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
if ( typeof ecwid_kissmetrics.store_id != 'undefined' ) {
|
2 |
+
_kmq.push([ 'identify', ecwid_kissmetrics.store_id ] );
|
3 |
+
}
|
4 |
+
|
5 |
+
function ecwid_kissmetrics_set(nameValue) {
|
6 |
+
ecwid_kissmetrics.items.push({'property' : nameValue });
|
7 |
+
|
8 |
+
ecwid_kissmetrics_flush();
|
9 |
+
}
|
10 |
+
|
11 |
+
function ecwid_kissmetrics_record(event) {
|
12 |
+
if (typeof this.fired == 'undefined') {
|
13 |
+
this.fired = [];
|
14 |
+
}
|
15 |
+
|
16 |
+
event = 'wp-plugin ' + event;
|
17 |
+
|
18 |
+
if (this.fired.indexOf(event) != -1) return;
|
19 |
+
|
20 |
+
ecwid_kissmetrics.items.push({event: event});
|
21 |
+
this.fired.push(event);
|
22 |
+
|
23 |
+
ecwid_kissmetrics_flush();
|
24 |
+
}
|
25 |
+
|
26 |
+
function ecwid_kissmetrics_flush() {
|
27 |
+
if (typeof _kmq == 'undefined') {
|
28 |
+
return;
|
29 |
+
}
|
30 |
+
|
31 |
+
for (var i = 0; i < ecwid_kissmetrics.items.length; i++) {
|
32 |
+
var item = ecwid_kissmetrics.items[i];
|
33 |
+
if (typeof item.event != 'undefined') {
|
34 |
+
_kmq.push(['record', ecwid_kissmetrics.items[i].event]);
|
35 |
+
} else if (typeof item.property != 'undefined') {
|
36 |
+
_kmq.push( [ 'set', ecwid_kissmetrics.items[i].property ] );
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
ecwid_kissmetrics.items = [];
|
41 |
+
}
|
42 |
+
|
43 |
+
jQuery(document).ready(function() {
|
44 |
+
|
45 |
+
jQuery.getScript('https://i.kissmetrics.com/i.js', function() {
|
46 |
+
jQuery.getScript('https://scripts.kissmetrics.com/' + ecwid_kissmetrics.key + '.2.js', function() {
|
47 |
+
ecwid_kissmetrics_flush();
|
48 |
+
})
|
49 |
+
});
|
50 |
+
});
|
lib/EcwidCatalog.php
ADDED
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class EcwidCatalog
|
4 |
+
{
|
5 |
+
var $store_id = 0;
|
6 |
+
var $store_base_url = '';
|
7 |
+
var $ecwid_api = null;
|
8 |
+
|
9 |
+
function __construct($store_id, $store_base_url)
|
10 |
+
{
|
11 |
+
$this->store_id = intval($store_id);
|
12 |
+
$this->store_base_url = $store_base_url;
|
13 |
+
$this->ecwid_api = new EcwidProductApi($this->store_id);
|
14 |
+
}
|
15 |
+
|
16 |
+
function EcwidCatalog($store_id)
|
17 |
+
{
|
18 |
+
if(version_compare(PHP_VERSION,"5.0.0","<"))
|
19 |
+
$this->__construct($store_id);
|
20 |
+
}
|
21 |
+
|
22 |
+
function _l($code, $indent_change = 0)
|
23 |
+
{
|
24 |
+
static $indent = 0;
|
25 |
+
|
26 |
+
if ($indent_change < 0) $indent -= 1;
|
27 |
+
$str = str_repeat(' ', $indent) . $code . "\n";
|
28 |
+
if ($indent_change > 0) $indent += 1;
|
29 |
+
|
30 |
+
return $str;
|
31 |
+
}
|
32 |
+
|
33 |
+
function get_product($id)
|
34 |
+
{
|
35 |
+
$params = array
|
36 |
+
(
|
37 |
+
array("alias" => "p", "action" => "product", "params" => array("id" => $id)),
|
38 |
+
array("alias" => "pf", "action" => "profile")
|
39 |
+
);
|
40 |
+
|
41 |
+
$batch_result = $this->ecwid_api->get_batch_request($params);
|
42 |
+
$product = $batch_result["p"];
|
43 |
+
$profile = $batch_result["pf"];
|
44 |
+
|
45 |
+
$return = $this->_l('');
|
46 |
+
|
47 |
+
if (is_array($product))
|
48 |
+
{
|
49 |
+
|
50 |
+
$return .= $this->_l('<div itemscope itemtype="http://schema.org/Product">', 1);
|
51 |
+
$return .= $this->_l('<h2 class="ecwid_catalog_product_name" itemprop="name">' . esc_html($product["name"]) . '</h2>');
|
52 |
+
$return .= $this->_l('<p class="ecwid_catalog_product_sku" itemprop="sku">' . esc_html($product["sku"]) . '</p>');
|
53 |
+
|
54 |
+
if (!empty($product["thumbnailUrl"]))
|
55 |
+
{
|
56 |
+
$return .= $this->_l('<div class="ecwid_catalog_product_image">', 1);
|
57 |
+
$return .= $this->_l(
|
58 |
+
sprintf(
|
59 |
+
'<img itemprop="image" src="%s" alt="%s" />',
|
60 |
+
esc_attr($product['thumbnailUrl']),
|
61 |
+
esc_attr($product['name'] . ' ' . $product['sku'])
|
62 |
+
)
|
63 |
+
);
|
64 |
+
$return .= $this->_l('</div>', -1);
|
65 |
+
}
|
66 |
+
|
67 |
+
if(is_array($product["categories"]))
|
68 |
+
{
|
69 |
+
foreach ($product["categories"] as $ecwid_category)
|
70 |
+
{
|
71 |
+
if($ecwid_category["defaultCategory"] == true)
|
72 |
+
{
|
73 |
+
$return .= $this->_l('<div class="ecwid_catalog_product_category">' . esc_html($ecwid_category['name']) . '</div>');
|
74 |
+
}
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
$return .= $this->_l('<div class="ecwid_catalog_product_price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">', 1);
|
79 |
+
$return .= $this->_l(__('Price', 'ecwid-shopping-cart') . ': <span itemprop="price">' . esc_html($product["price"]) . '</span>');
|
80 |
+
|
81 |
+
$return .= $this->_l('<span itemprop="priceCurrency">' . esc_html($profile['currency']) . '</span>');
|
82 |
+
if (!isset($product['quantity']) || (isset($product['quantity']) && $product['quantity'] > 0)) {
|
83 |
+
$return .= $this->_l('<link itemprop="availability" href="http://schema.org/InStock" />In stock');
|
84 |
+
}
|
85 |
+
$return .= $this->_l('</div>', -1);
|
86 |
+
|
87 |
+
$return .= $this->_l('<div class="ecwid_catalog_product_description" itemprop="description">', 1);
|
88 |
+
$return .= $this->_l($product['description']);
|
89 |
+
$return .= $this->_l('</div>', -1);
|
90 |
+
|
91 |
+
if (is_array($product['attributes']) && !empty($product['attributes'])) {
|
92 |
+
|
93 |
+
foreach ($product['attributes'] as $attribute) {
|
94 |
+
if (trim($attribute['value']) != '') {
|
95 |
+
$return .= $this->_l('<div class="ecwid_catalog_product_attribute">', 1);
|
96 |
+
|
97 |
+
$attr_string = $attribute['name'] . ':';
|
98 |
+
|
99 |
+
if (isset($attribute['internalName']) && $attribute['internalName'] == 'Brand') {
|
100 |
+
$attr_string .= '<span itemprop="brand">' . $attribute['value'] . '</span>';
|
101 |
+
} else {
|
102 |
+
$attr_string .= $attribute['value'];
|
103 |
+
}
|
104 |
+
|
105 |
+
$return .= $this->_l($attr_string);
|
106 |
+
$return .= $this->_l('</div>', -1);
|
107 |
+
}
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
if (is_array($product["options"]))
|
112 |
+
{
|
113 |
+
$allowed_types = array('TEXTFIELD', 'DATE', 'TEXTAREA', 'SELECT', 'RADIO', 'CHECKBOX');
|
114 |
+
foreach($product["options"] as $product_options)
|
115 |
+
{
|
116 |
+
if (!in_array($product_options['type'], $allowed_types)) continue;
|
117 |
+
|
118 |
+
$return .= $this->_l('<div class="ecwid_catalog_product_options">', 1);
|
119 |
+
$return .=$this->_l('<span>' . esc_html($product_options["name"]) . '</span>');
|
120 |
+
|
121 |
+
if($product_options["type"] == "TEXTFIELD" || $product_options["type"] == "DATE")
|
122 |
+
{
|
123 |
+
$return .=$this->_l('<input type="text" size="40" name="'. esc_attr($product_options["name"]) . '">');
|
124 |
+
}
|
125 |
+
if($product_options["type"] == "TEXTAREA")
|
126 |
+
{
|
127 |
+
$return .=$this->_l('<textarea name="' . esc_attr($product_options["name"]) . '></textarea>');
|
128 |
+
}
|
129 |
+
if ($product_options["type"] == "SELECT")
|
130 |
+
{
|
131 |
+
$return .= $this->_l('<select name='. $product_options["name"].'>', 1);
|
132 |
+
foreach ($product_options["choices"] as $options_param)
|
133 |
+
{
|
134 |
+
$return .= $this->_l(
|
135 |
+
sprintf(
|
136 |
+
'<option value="%s">%s (%s)</option>',
|
137 |
+
esc_attr($options_param['text']),
|
138 |
+
esc_html($options_param['text']),
|
139 |
+
esc_html($options_param['priceModifier'])
|
140 |
+
)
|
141 |
+
);
|
142 |
+
}
|
143 |
+
$return .= $this->_l('</select>', -1);
|
144 |
+
}
|
145 |
+
if($product_options["type"] == "RADIO")
|
146 |
+
{
|
147 |
+
foreach ($product_options["choices"] as $options_param)
|
148 |
+
{
|
149 |
+
$return .= $this->_l(
|
150 |
+
sprintf(
|
151 |
+
'<input type="radio" name="%s" value="%s" />%s (%s)',
|
152 |
+
esc_attr($product_options['name']),
|
153 |
+
esc_attr($options_param['text']),
|
154 |
+
esc_html($options_param['text']),
|
155 |
+
esc_html($options_param['priceModifier'])
|
156 |
+
)
|
157 |
+
);
|
158 |
+
}
|
159 |
+
}
|
160 |
+
if($product_options["type"] == "CHECKBOX")
|
161 |
+
{
|
162 |
+
foreach ($product_options["choices"] as $options_param)
|
163 |
+
{
|
164 |
+
$return .= $this->_l(
|
165 |
+
sprintf(
|
166 |
+
'<input type="checkbox" name="%s" value="%s" />%s (%s)',
|
167 |
+
esc_attr($product_options['name']),
|
168 |
+
esc_attr($options_param['text']),
|
169 |
+
esc_html($options_param['text']),
|
170 |
+
esc_html($options_param['priceModifier'])
|
171 |
+
)
|
172 |
+
);
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
$return .= $this->_l('</div>', -1);
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
if (is_array($product["galleryImages"]))
|
181 |
+
{
|
182 |
+
foreach ($product["galleryImages"] as $galleryimage)
|
183 |
+
{
|
184 |
+
if (empty($galleryimage["alt"])) $galleryimage["alt"] = htmlspecialchars($product["name"]);
|
185 |
+
$return .= $this->_l(
|
186 |
+
sprintf(
|
187 |
+
'<img src="%s" alt="%s" title="%s" />',
|
188 |
+
esc_attr($galleryimage['url']),
|
189 |
+
esc_attr($galleryimage['alt']),
|
190 |
+
esc_attr($galleryimage['alt'])
|
191 |
+
)
|
192 |
+
);
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
$return .= $this->_l("</div>", -1);
|
197 |
+
}
|
198 |
+
|
199 |
+
return $return;
|
200 |
+
}
|
201 |
+
|
202 |
+
function get_category($id)
|
203 |
+
{
|
204 |
+
$params = array
|
205 |
+
(
|
206 |
+
array("alias" => "c", "action" => "categories", "params" => array("parent" => $id)),
|
207 |
+
array("alias" => "p", "action" => "products", "params" => array("category" => $id)),
|
208 |
+
array("alias" => "pf", "action" => "profile")
|
209 |
+
);
|
210 |
+
if ($id > 0) {
|
211 |
+
$params[] = array('alias' => 'category', "action" => "category", "params" => array("id" => $id));
|
212 |
+
}
|
213 |
+
|
214 |
+
$batch_result = $this->ecwid_api->get_batch_request($params);
|
215 |
+
|
216 |
+
$category = $id > 0 ? $batch_result['category'] : null;
|
217 |
+
$categories = $batch_result["c"];
|
218 |
+
$products = $batch_result["p"];
|
219 |
+
$profile = $batch_result["pf"];
|
220 |
+
|
221 |
+
$return = $this->_l('');
|
222 |
+
|
223 |
+
if (!is_null($category)) {
|
224 |
+
$return .= $this->_l('<h2>' . esc_html($category['name']) . '</h2>');
|
225 |
+
$return .= $this->_l('<div>' . $category['description'] . '</div>');
|
226 |
+
}
|
227 |
+
|
228 |
+
if (is_array($categories))
|
229 |
+
{
|
230 |
+
foreach ($categories as $category)
|
231 |
+
{
|
232 |
+
$category_url = ecwid_get_category_url($category);
|
233 |
+
|
234 |
+
$category_name = $category["name"];
|
235 |
+
$return .= $this->_l('<div class="ecwid_catalog_category_name">', 1);
|
236 |
+
$return .= $this->_l('<a href="' . esc_attr($category_url) . '">' . esc_html($category_name) . '</a>');
|
237 |
+
$return .= $this->_l('</div>', -1);
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
+
if (is_array($products))
|
242 |
+
{
|
243 |
+
foreach ($products as $product)
|
244 |
+
{
|
245 |
+
|
246 |
+
$product_url = ecwid_get_product_url($product);
|
247 |
+
|
248 |
+
$product_name = $product['name'];
|
249 |
+
$product_price = $product['price'] . ' ' . $profile['currency'];
|
250 |
+
$return .= $this->_l('<div>', 1);
|
251 |
+
$return .= $this->_l('<span class="ecwid_product_name">', 1);
|
252 |
+
$return .= $this->_l('<a href="' . esc_attr($product_url) . '">' . esc_html($product_name) . '</a>');
|
253 |
+
$return .= $this->_l('</span>', -1);
|
254 |
+
$return .= $this->_l('<span class="ecwid_product_price">' . esc_html($product_price) . '</span>');
|
255 |
+
$return .= $this->_l('</div>', -1);
|
256 |
+
}
|
257 |
+
}
|
258 |
+
|
259 |
+
return $return;
|
260 |
+
}
|
261 |
+
|
262 |
+
function build_url($url_from_ecwid)
|
263 |
+
{
|
264 |
+
if (preg_match('/(.*)(#!)(.*)/', $url_from_ecwid, $matches))
|
265 |
+
return $this->store_base_url . $matches[2] . $matches[3];
|
266 |
+
else
|
267 |
+
return '';
|
268 |
+
}
|
269 |
+
}
|
lib/EcwidSitemapBuilder.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname(__FILE__) . '/JSONStreamingParser/Listener.php';
|
4 |
+
require_once dirname(__FILE__) . '/JSONStreamingParser/Parser.php';
|
5 |
+
|
6 |
+
|
7 |
+
class EcwidSitemapBuilder implements JsonStreamingParser_Listener {
|
8 |
+
var $_stack;
|
9 |
+
var $_key;
|
10 |
+
var $callback;
|
11 |
+
var $base_url;
|
12 |
+
var $api;
|
13 |
+
var $type;
|
14 |
+
|
15 |
+
public function __construct($base_url, $callback, $api) {
|
16 |
+
$this->callback = $callback;
|
17 |
+
$this->base_url = $base_url;
|
18 |
+
$this->api = $api;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function generate() {
|
22 |
+
|
23 |
+
foreach (array('products', 'categories') as $type) {
|
24 |
+
$this->type = $type;
|
25 |
+
$stream = $this->api->get_method_response_stream($type);
|
26 |
+
if (!is_null($stream)) {
|
27 |
+
try {
|
28 |
+
$parser = new JsonStreamingParser_Parser($stream, $this);
|
29 |
+
$parser->parse();
|
30 |
+
} catch (Exception $e) {
|
31 |
+
fclose($stream);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
return true;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function file_position($line, $char) {
|
40 |
+
|
41 |
+
}
|
42 |
+
|
43 |
+
public function start_document() {
|
44 |
+
$this->_stack = array();
|
45 |
+
|
46 |
+
$this->_key = null;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function end_document() {
|
50 |
+
}
|
51 |
+
|
52 |
+
public function start_object() {
|
53 |
+
array_push($this->_stack, array());
|
54 |
+
}
|
55 |
+
|
56 |
+
public function end_object() {
|
57 |
+
|
58 |
+
$obj = array_pop($this->_stack);
|
59 |
+
if (is_array($obj) && array_key_exists('url', $obj)) {
|
60 |
+
$callback = $this->callback;
|
61 |
+
|
62 |
+
$callback(
|
63 |
+
ecwid_get_entity_url($obj, $this->type == 'products' ? 'p' : 'c'),
|
64 |
+
$this->type == 'products' ? 0.6 : 0.5,
|
65 |
+
'weekly'
|
66 |
+
);
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
public function start_array() {
|
71 |
+
}
|
72 |
+
|
73 |
+
public function end_array() {
|
74 |
+
}
|
75 |
+
|
76 |
+
public function key($key) {
|
77 |
+
$this->_key = $key;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function value($value) {
|
81 |
+
if ($this->_key == 'url') {
|
82 |
+
$this->_stack[0]['url'] = $value;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
lib/class-ecwid-message-manager.php
ADDED
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ecwid_Message_Manager
|
4 |
+
{
|
5 |
+
protected $messages = array();
|
6 |
+
|
7 |
+
protected function Ecwid_Message_Manager()
|
8 |
+
{
|
9 |
+
$this->init_messages();
|
10 |
+
}
|
11 |
+
|
12 |
+
public static function show_messages()
|
13 |
+
{
|
14 |
+
$mm = self::get_instance();
|
15 |
+
|
16 |
+
foreach ($mm->messages as $name => $message) {
|
17 |
+
if ($mm->need_to_show_message($name)) {
|
18 |
+
$mm->show_message($name);
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
public static function show_message($name, $params = array())
|
24 |
+
{
|
25 |
+
$mm = self::get_instance();
|
26 |
+
|
27 |
+
$mm->need_to_show_message($name);
|
28 |
+
|
29 |
+
if (!isset($mm->messages[$name]) && empty($params)) {
|
30 |
+
trigger_error('Ecwid plugin error: unknown message ' . $name);
|
31 |
+
return;
|
32 |
+
}
|
33 |
+
|
34 |
+
$params = $mm->get_message_params($name, $params);
|
35 |
+
|
36 |
+
$type = $params['type'];
|
37 |
+
|
38 |
+
$title = $params['title'];
|
39 |
+
$message = $params['message'];
|
40 |
+
|
41 |
+
$primary_button = isset($params['primary_title']);
|
42 |
+
if ($primary_button) {
|
43 |
+
$primary_title = $params['primary_title'];
|
44 |
+
$primary_url = $params['primary_url'];
|
45 |
+
$primary_blank = @$params['primary_blank'];
|
46 |
+
}
|
47 |
+
$secondary_button = isset($params['secondary_title']);
|
48 |
+
if ($secondary_button) {
|
49 |
+
$secondary_title = $params['secondary_title'];
|
50 |
+
$secondary_url = $params['secondary_url'];
|
51 |
+
$secondary_blank = $params['secondary_blank'];
|
52 |
+
}
|
53 |
+
|
54 |
+
$do_not_show_again = true == $params['hideable'];
|
55 |
+
|
56 |
+
include ECWID_PLUGIN_DIR . '/templates/admin-message.php';
|
57 |
+
}
|
58 |
+
|
59 |
+
public static function disable_message($name)
|
60 |
+
{
|
61 |
+
$messages = get_option('ecwid_disabled_messages');
|
62 |
+
$messages[$name] = true;
|
63 |
+
|
64 |
+
update_option('ecwid_disabled_messages', $messages);
|
65 |
+
}
|
66 |
+
|
67 |
+
public static function enable_message($name)
|
68 |
+
{
|
69 |
+
$messages = get_option('ecwid_disabled_messages');
|
70 |
+
if (isset($messages['name']))
|
71 |
+
unset($messages['name']);
|
72 |
+
|
73 |
+
update_option('ecwid_disabled_messages', $messages);
|
74 |
+
}
|
75 |
+
|
76 |
+
public static function reset_hidden_messages()
|
77 |
+
{
|
78 |
+
$hidden_messages = array();
|
79 |
+
|
80 |
+
$messages = self::get_default_messages();
|
81 |
+
foreach ($messages as $name => $message) {
|
82 |
+
if (isset($message['default']) && $message['default'] == 'hidden') {
|
83 |
+
$hidden_messages[$name] = true;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
update_option('ecwid_disabled_messages', array());
|
88 |
+
}
|
89 |
+
|
90 |
+
protected static function get_instance()
|
91 |
+
{
|
92 |
+
static $instance = null;
|
93 |
+
|
94 |
+
if (is_null($instance)) {
|
95 |
+
$instance = new Ecwid_Message_Manager();
|
96 |
+
}
|
97 |
+
|
98 |
+
return $instance;
|
99 |
+
}
|
100 |
+
|
101 |
+
protected function init_messages()
|
102 |
+
{
|
103 |
+
$this->messages = $this->get_default_messages();
|
104 |
+
|
105 |
+
$hidden_messages = get_option('ecwid_disabled_messages');
|
106 |
+
|
107 |
+
if ( !empty( $hidden_messages ) ) {
|
108 |
+
foreach ($hidden_messages as $name => $message) {
|
109 |
+
unset ($this->messages[$name]);
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
protected function get_message_params($name, $params)
|
115 |
+
{
|
116 |
+
if (is_array($name)) {
|
117 |
+
$params = $name;
|
118 |
+
$name = '';
|
119 |
+
}
|
120 |
+
|
121 |
+
if (isset($this->messages[$name])) {
|
122 |
+
$params = array_merge(
|
123 |
+
array('type' => 'info', 'title' => '', 'message' => '', 'hideable' => false),
|
124 |
+
$this->messages[$name],
|
125 |
+
$params
|
126 |
+
);
|
127 |
+
}
|
128 |
+
|
129 |
+
if ($name == 'on_storeid_set') {
|
130 |
+
$params['primary_url'] = ecwid_get_store_page_url();
|
131 |
+
}
|
132 |
+
|
133 |
+
$types_map = array(
|
134 |
+
'info' => 'updated',
|
135 |
+
'warning' => 'update-nag',
|
136 |
+
'error' => 'error'
|
137 |
+
);
|
138 |
+
$params['type'] = $types_map[$params['type']];
|
139 |
+
|
140 |
+
return $params;
|
141 |
+
}
|
142 |
+
|
143 |
+
protected function get_default_messages()
|
144 |
+
{
|
145 |
+
return array(
|
146 |
+
'on_activate' => array(
|
147 |
+
'title' => __('Greetings! Your Ecwid store is now active.', 'ecwid-shopping-cart'),
|
148 |
+
'message' => __('Take a few simple steps to complete store setup', 'ecwid-shopping-cart'),
|
149 |
+
'primary_title' => __('Set up Ecwid Store', 'ecwid-shopping-cart'),
|
150 |
+
'primary_url' => 'admin.php?page=ecwid',
|
151 |
+
'hideable' => true,
|
152 |
+
'default' => 'disabled'
|
153 |
+
),
|
154 |
+
|
155 |
+
'on_storeid_set' => array(
|
156 |
+
'title' => __('Good job! Your store is set up and you\'re ready to sell.', 'ecwid-shopping-cart'),
|
157 |
+
'message' => __('Now you can fine-tune your store\'s appearance', 'ecwid-shopping-cart'),
|
158 |
+
'primary_title' => __('Visit Storefront', 'ecwid-shopping-cart'),
|
159 |
+
'primary_url' => '',
|
160 |
+
'primary_blank' => true,
|
161 |
+
'secondary_title' => __('Configure Appearance', 'ecwid-shopping-cart'),
|
162 |
+
'secondary_url' => 'admin.php?page=ecwid-appearance',
|
163 |
+
'hideable' => true
|
164 |
+
),
|
165 |
+
|
166 |
+
'no_storeid_on_setup_pages' => array(
|
167 |
+
'type' => 'warning',
|
168 |
+
'title' => __('Your store is almost ready!', 'ecwid-shopping-cart' ),
|
169 |
+
'message' => __('Connect your Ecwid account with this site to complete setup and start selling', 'ecwid-shopping-cart' ),
|
170 |
+
'primary_title' => __('Connect Your Ecwid Store', 'ecwid-shopping-cart' ),
|
171 |
+
'primary_url' => 'admin.php?page=ecwid',
|
172 |
+
'hideable' => true
|
173 |
+
),
|
174 |
+
|
175 |
+
'on_appearance_widgets' => array(
|
176 |
+
'message' => __('To add extra functions to your store, drag and drop Ecwid store elements on your site. When you\'re done, you can get back to modifying your settings.', 'ecwid-shopping-cart' ),
|
177 |
+
'secondary_title' => __('Back to Store Settings', 'ecwid-shopping-cart'),
|
178 |
+
'secondary_url' => 'admin.php?page=ecwid-appearance',
|
179 |
+
'hideable' => true
|
180 |
+
),
|
181 |
+
|
182 |
+
'please_vote' => array(
|
183 |
+
'message' => sprintf(
|
184 |
+
__('Do you like your Ecwid online store? We\'d appreciate it if you add your review and vote for the plugin on Wordpress site.', 'ecwid-shopping-cart'),
|
185 |
+
'target="_blank" href="http://wordpress.org/support/view/plugin-reviews/ecwid-shopping-cart"'
|
186 |
+
),
|
187 |
+
'primary_title' => __('Rate Ecwid at WordPress.org', 'ecwid-shopping-cart'),
|
188 |
+
'primary_url' => 'http://wordpress.org/support/view/plugin-reviews/ecwid-shopping-cart',
|
189 |
+
'hideable' => true
|
190 |
+
)
|
191 |
+
);
|
192 |
+
}
|
193 |
+
|
194 |
+
protected function need_to_show_message($name)
|
195 |
+
{
|
196 |
+
$admin_page = '';
|
197 |
+
if (function_exists('get_current_screen')) {
|
198 |
+
$screen = get_current_screen();
|
199 |
+
$admin_page = $screen->base;
|
200 |
+
}
|
201 |
+
|
202 |
+
switch ($name) {
|
203 |
+
case 'on_activate':
|
204 |
+
return $admin_page == 'plugins' && get_ecwid_store_id() == ECWID_DEMO_STORE_ID;
|
205 |
+
|
206 |
+
case 'on_storeid_set':
|
207 |
+
return get_ecwid_store_id() != ECWID_DEMO_STORE_ID && $_GET['settings-updated'] == 'true' && $admin_page == 'toplevel_page_ecwid';
|
208 |
+
|
209 |
+
case 'no_storeid_on_setup_pages':
|
210 |
+
return get_ecwid_store_id() == ECWID_DEMO_STORE_ID
|
211 |
+
&& in_array($admin_page, array('ecwid-store_page_ecwid-advanced', 'ecwid-store_page_ecwid-appearance'));
|
212 |
+
|
213 |
+
case 'on_appearance_widgets':
|
214 |
+
return isset($_GET['from-ecwid-appearance']) && $admin_page == 'widgets';
|
215 |
+
|
216 |
+
case 'please_vote':
|
217 |
+
$install_date = get_option('ecwid_installation_date');
|
218 |
+
|
219 |
+
$result = false;
|
220 |
+
if (!$install_date) {
|
221 |
+
add_option('ecwid_installation_date', time());
|
222 |
+
} else {
|
223 |
+
$result = ecwid_is_paid_account() && $install_date + 60*60*24*30 < time();
|
224 |
+
}
|
225 |
+
|
226 |
+
foreach ($this->messages as $_name => $message) {
|
227 |
+
if ($_name != $name && $this->need_to_show_message($_name)) {
|
228 |
+
return false;
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
return $result;
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
}
|
lib/class-ecwid-theme-manager.php
ADDED
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ecwid_Theme_Manager
|
4 |
+
{
|
5 |
+
protected $themes_map = array();
|
6 |
+
|
7 |
+
protected $current_theme = '';
|
8 |
+
|
9 |
+
protected $theme_name = '';
|
10 |
+
|
11 |
+
public function Ecwid_Theme_Manager()
|
12 |
+
{
|
13 |
+
$this->init_themes_map();
|
14 |
+
$this->detect_current_theme();
|
15 |
+
|
16 |
+
add_filter('ecwid_minicart_shortcode_content', array($this, 'minicart_shortcode_content'));
|
17 |
+
add_filter('ecwid_categories_shortcode_content', array($this, 'categories_shortcode_content'));
|
18 |
+
add_filter('ecwid_search_shortcode_content', array($this, 'search_shortcode_content'));
|
19 |
+
}
|
20 |
+
|
21 |
+
public static function get_instance()
|
22 |
+
{
|
23 |
+
static $instance = null;
|
24 |
+
|
25 |
+
if (is_null($instance)) {
|
26 |
+
$instance = new Ecwid_Theme_Manager();
|
27 |
+
}
|
28 |
+
|
29 |
+
return $instance;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function get_theme_name()
|
33 |
+
{
|
34 |
+
return $this->theme_name;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function apply_adjustments()
|
38 |
+
{
|
39 |
+
if ( empty( $this->themes ) ) {
|
40 |
+
return;
|
41 |
+
}
|
42 |
+
|
43 |
+
if ($this->theme_needs_scrolling_adjustment()) {
|
44 |
+
wp_enqueue_script(
|
45 |
+
'ecwid-scroller',
|
46 |
+
plugins_url( 'ecwid-shopping-cart/js/create_scroller.js' ),
|
47 |
+
array( 'jquery' )
|
48 |
+
);
|
49 |
+
}
|
50 |
+
|
51 |
+
if ( !array_key_exists( $this->current_theme, $this->themes ) ) {
|
52 |
+
return;
|
53 |
+
}
|
54 |
+
|
55 |
+
$theme_data = $this->themes[$this->current_theme];
|
56 |
+
|
57 |
+
if ( $theme_data['callback'] ) {
|
58 |
+
$method = 'apply_theme_' . $this->current_theme;
|
59 |
+
return $this->$method();
|
60 |
+
}
|
61 |
+
|
62 |
+
wp_enqueue_style(
|
63 |
+
'ecwid-theme-css',
|
64 |
+
plugins_url( 'ecwid-shopping-cart/css/themes/' . $this->current_theme . '.css' ),
|
65 |
+
isset( $theme_data['base_css'] ) ? array( $theme_data['base_css'] ) : array(),
|
66 |
+
false,
|
67 |
+
'all'
|
68 |
+
);
|
69 |
+
|
70 |
+
if ( $theme_data['js'] ) {
|
71 |
+
wp_enqueue_script(
|
72 |
+
'ecwid-theme-js',
|
73 |
+
plugins_url( 'ecwid-shopping-cart/js/themes/' . $this->current_theme . '.js' ),
|
74 |
+
array( 'jquery' )
|
75 |
+
);
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
public function minicart_shortcode_content($content)
|
80 |
+
{
|
81 |
+
return $content;
|
82 |
+
|
83 |
+
if ($this->current_theme == 'responsive' && get_option('ecwid_enable_advanced_theme_layout') == 'Y' && get_the_ID() == get_option('ecwid_store_page_id')) {
|
84 |
+
$content = '<script type="text/javascript"> xMinicart("style=","layout=Mini"); </script>';
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
public function categories_shortcode_content($content)
|
89 |
+
{
|
90 |
+
return $content;
|
91 |
+
}
|
92 |
+
|
93 |
+
public function search_shortcode_content($content)
|
94 |
+
{
|
95 |
+
return $content;
|
96 |
+
}
|
97 |
+
|
98 |
+
public function has_advanced_layout()
|
99 |
+
{
|
100 |
+
return false;
|
101 |
+
|
102 |
+
return $this->current_theme == 'responsive';
|
103 |
+
}
|
104 |
+
|
105 |
+
protected function detect_current_theme()
|
106 |
+
{
|
107 |
+
$version = get_bloginfo('version');
|
108 |
+
|
109 |
+
if (version_compare( $version, '3.4' ) < 0) {
|
110 |
+
$this->theme_name = get_current_theme();
|
111 |
+
} else {
|
112 |
+
$theme = wp_get_theme();
|
113 |
+
$this->theme_name = $theme->get('Name');
|
114 |
+
}
|
115 |
+
|
116 |
+
foreach ( $this->themes as $internal_name => $theme ) {
|
117 |
+
if ( $this->theme_name == $theme['name'] ) {
|
118 |
+
$this->current_theme = $internal_name;
|
119 |
+
break;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
protected function init_themes_map()
|
125 |
+
{
|
126 |
+
$this->themes = array(
|
127 |
+
|
128 |
+
'2014' => array(
|
129 |
+
'name' => 'Twenty Fourteen',
|
130 |
+
'base_css' => 'twentyfourteen-style',
|
131 |
+
'js' => false,
|
132 |
+
),
|
133 |
+
'pagelines' => array(
|
134 |
+
'name' => 'PageLines',
|
135 |
+
'base_css' => '',
|
136 |
+
'js' => true,
|
137 |
+
),
|
138 |
+
'responsive' => array(
|
139 |
+
'name' => 'Responsive'
|
140 |
+
)
|
141 |
+
);
|
142 |
+
}
|
143 |
+
|
144 |
+
protected function theme_needs_scrolling_adjustment() {
|
145 |
+
return in_array( $this->current_theme, array( '2014', 'pagelines' ) );
|
146 |
+
}
|
147 |
+
|
148 |
+
protected function __apply_theme_responsive()
|
149 |
+
{
|
150 |
+
wp_enqueue_style( 'ecwid-open-sans-css' , 'http://fonts.googleapis.com/css?family=Open+Sans:400,700&subset=latin,cyrillic-ext,cyrillic,greek-ext,vietnamese,greek,latin-ext');
|
151 |
+
wp_enqueue_style( 'dashicons' );
|
152 |
+
wp_enqueue_style( 'ecwid-theme-fixes-css' , plugins_url( 'ecwid-shopping-cart/css/themes/responsive-fixes.css' ), array(), false, 'all' );
|
153 |
+
if (get_option('ecwid_enable_advanced_theme_layout') == 'Y') {
|
154 |
+
wp_enqueue_style( 'ecwid-theme-adjustments-css' , plugins_url( 'ecwid-shopping-cart/css/themes/responsive-adjustments.css' ), array(), false, 'all' );
|
155 |
+
wp_enqueue_script( 'ecwid-theme-js', plugins_url( 'ecwid-shopping-cart/js/themes/responsive.js' ), array( 'jquery' ), false, true );
|
156 |
+
}
|
157 |
+
|
158 |
+
add_filter('body_class', array($this, 'body_class_responsive'));
|
159 |
+
}
|
160 |
+
|
161 |
+
public function body_class_responsive($classes)
|
162 |
+
{
|
163 |
+
if (get_option('ecwid_enable_minicart')) {
|
164 |
+
$classes[] = 'ecwid-with-minicart';
|
165 |
+
}
|
166 |
+
|
167 |
+
if (get_option('ecwid_show_search_box')) {
|
168 |
+
$classes[] = 'ecwid-with-search';
|
169 |
+
}
|
170 |
+
|
171 |
+
return $classes;
|
172 |
+
}
|
173 |
+
}
|
lib/themes.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
define( 'ECWID_THEMES_DIR', ECWID_PLUGIN_DIR . '/lib/themes' );
|
4 |
+
|
5 |
+
add_action('after_switch_theme', 'ecwid_after_switch_theme');
|
6 |
+
|
7 |
+
function ecwid_get_theme_name()
|
8 |
+
{
|
9 |
+
$version = get_bloginfo('version');
|
10 |
+
|
11 |
+
if (version_compare( $version, '3.4' ) < 0) {
|
12 |
+
$theme_name = get_current_theme();
|
13 |
+
} else {
|
14 |
+
$theme = wp_get_theme();
|
15 |
+
$theme_name = $theme->get('Name');
|
16 |
+
}
|
17 |
+
|
18 |
+
return $theme_name;
|
19 |
+
}
|
20 |
+
|
21 |
+
function ecwid_apply_theme($theme_name = null)
|
22 |
+
{
|
23 |
+
$themes = array(
|
24 |
+
'Bretheon' => 'bretheon',
|
25 |
+
'Responsive' => 'responsive',
|
26 |
+
'Twenty Fourteen' => '2014',
|
27 |
+
'PageLines' => 'pagelines'
|
28 |
+
);
|
29 |
+
|
30 |
+
if (empty($theme_name)) {
|
31 |
+
$theme_name = ecwid_get_theme_name();
|
32 |
+
}
|
33 |
+
|
34 |
+
$theme_file = '';
|
35 |
+
|
36 |
+
if (array_key_exists($theme_name, $themes)) {
|
37 |
+
|
38 |
+
$theme_file = ECWID_THEMES_DIR . '/class-ecwid-theme-' . $themes[$theme_name] . '.php';
|
39 |
+
}
|
40 |
+
|
41 |
+
$theme_file = apply_filters( 'ecwid_get_theme_file', $theme_file );
|
42 |
+
|
43 |
+
if ( !empty( $theme_file ) && is_file( $theme_file ) && is_readable( $theme_file ) ) {
|
44 |
+
require_once( $theme_file );
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
function ecwid_after_switch_theme()
|
49 |
+
{
|
50 |
+
ecwid_apply_theme();
|
51 |
+
|
52 |
+
global $ecwid_current_theme;
|
53 |
+
|
54 |
+
update_option(
|
55 |
+
'ecwid_advanced_theme_layout',
|
56 |
+
isset($ecwid_current_theme) && $ecwid_current_theme->has_advanced_layout ? 'Y' : 'N'
|
57 |
+
);
|
58 |
+
}
|
lib/themes/class-ecwid-theme-2014.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once ECWID_THEMES_DIR . '/class-ecwid-theme-base.php';
|
4 |
+
|
5 |
+
class Ecwid_Theme_2014 extends Ecwid_Theme_Base
|
6 |
+
{
|
7 |
+
protected $name = 'Twenty Fourteen';
|
8 |
+
|
9 |
+
protected $adjust_pb_scroll = true;
|
10 |
+
|
11 |
+
public function __construct()
|
12 |
+
{
|
13 |
+
parent::__construct();
|
14 |
+
|
15 |
+
if (ecwid_page_has_productbrowser()) {
|
16 |
+
wp_enqueue_style( 'ecwid-theme', plugins_url( 'ecwid-shopping-cart/css/themes/2014.css' ), array('twentyfourteen-style') );
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
$ecwid_current_theme = new Ecwid_Theme_2014();
|
lib/themes/class-ecwid-theme-base.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ecwid_Theme_Base {
|
4 |
+
|
5 |
+
public $has_advanced_layout = false;
|
6 |
+
|
7 |
+
protected $adjust_pb_scroll = false;
|
8 |
+
|
9 |
+
public function __construct()
|
10 |
+
{
|
11 |
+
if ( $this->adjust_pb_scroll ) {
|
12 |
+
wp_enqueue_script(
|
13 |
+
'ecwid-scroller',
|
14 |
+
plugins_url( 'ecwid-shopping-cart/js/create_scroller.js' ),
|
15 |
+
array( 'jquery' )
|
16 |
+
);
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
protected function need_advanced_layout()
|
21 |
+
{
|
22 |
+
return get_option('ecwid_advanced_theme_layout') == 'Y';
|
23 |
+
}
|
24 |
+
}
|
lib/themes/class-ecwid-theme-bretheon.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once ECWID_THEMES_DIR . '/class-ecwid-theme-base.php';
|
4 |
+
|
5 |
+
class Ecwid_Theme_Bretheon extends Ecwid_Theme_Base
|
6 |
+
{
|
7 |
+
protected $name = 'Bretheon';
|
8 |
+
|
9 |
+
public function __construct()
|
10 |
+
{
|
11 |
+
parent::__construct();
|
12 |
+
|
13 |
+
add_filter( 'ecwid_page_has_product_browser', array( $this, 'has_product_browser' ) );
|
14 |
+
}
|
15 |
+
|
16 |
+
public function has_product_browser( $value )
|
17 |
+
{
|
18 |
+
if ( $value ) {
|
19 |
+
return $value;
|
20 |
+
}
|
21 |
+
|
22 |
+
$meta = get_post_meta( get_the_ID(), 'mfn-page-items' );
|
23 |
+
if ( is_array( $meta ) ) {
|
24 |
+
$meta = base64_decode( $meta[0] );
|
25 |
+
|
26 |
+
// not exactly the intended usage, but quite simple and still works
|
27 |
+
// $meta is a serialized array that has the actual content
|
28 |
+
// a right way is to walk through the structure and run has_shortcode against all fields
|
29 |
+
$result = has_shortcode( $meta, 'ecwid_productbrowser' );
|
30 |
+
}
|
31 |
+
|
32 |
+
return $result;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
$ecwid_current_theme = new Ecwid_Theme_Bretheon();
|
lib/themes/class-ecwid-theme-pagelines.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once ECWID_THEMES_DIR . '/class-ecwid-theme-base.php';
|
4 |
+
|
5 |
+
class Ecwid_Theme_Pagelines extends Ecwid_Theme_Base
|
6 |
+
{
|
7 |
+
protected $name = 'Pagelines';
|
8 |
+
|
9 |
+
protected $adjust_pb_scroll = true;
|
10 |
+
|
11 |
+
public function __construct()
|
12 |
+
{
|
13 |
+
parent::__construct();
|
14 |
+
|
15 |
+
wp_enqueue_script( 'ecwid-theme-js', plugins_url( 'ecwid-shopping-cart/js/themes/pagelines.js' ), array( 'jquery' ), false, true );
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
$ecwid_current_theme = new Ecwid_Theme_Pagelines();
|
lib/themes/class-ecwid-theme-responsive.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once ECWID_THEMES_DIR . '/class-ecwid-theme-base.php';
|
4 |
+
|
5 |
+
class Ecwid_Theme_Responsive extends Ecwid_Theme_Base
|
6 |
+
{
|
7 |
+
public $has_advanced_layout = true;
|
8 |
+
|
9 |
+
public function __construct()
|
10 |
+
{
|
11 |
+
parent::__construct();
|
12 |
+
|
13 |
+
if ( $this->need_advanced_layout() ) {
|
14 |
+
wp_enqueue_style( 'ecwid-theme-adjustments' , plugins_url( 'ecwid-shopping-cart/css/themes/responsive-adjustments.css' ), array(), false, 'all' );
|
15 |
+
wp_enqueue_script( 'ecwid-theme', plugins_url( 'ecwid-shopping-cart/js/themes/responsive.js' ), array( 'jquery' ), false, true );
|
16 |
+
|
17 |
+
add_filter( 'ecwid_minicart_shortcode_content', array( $this, 'minicart_shortcode_content' ) );
|
18 |
+
}
|
19 |
+
|
20 |
+
wp_enqueue_style( 'ecwid-open-sans' , 'http://fonts.googleapis.com/css?family=Open+Sans:400,700&subset=latin,cyrillic-ext,cyrillic,greek-ext,vietnamese,greek,latin-ext');
|
21 |
+
wp_enqueue_style( 'dashicons' );
|
22 |
+
wp_enqueue_style( 'ecwid-theme-fixes' , plugins_url( 'ecwid-shopping-cart/css/themes/responsive.css' ), array(), false, 'all' );
|
23 |
+
|
24 |
+
add_filter('body_class', array($this, 'body_class'));
|
25 |
+
|
26 |
+
add_action('ecwid_store_page_created', array($this, 'on_create_store_page'));
|
27 |
+
add_action('switch_theme', array($this, 'switch_theme'));
|
28 |
+
}
|
29 |
+
|
30 |
+
public function minicart_shortcode_content( $content )
|
31 |
+
{
|
32 |
+
|
33 |
+
if ( get_the_ID() == get_option( 'ecwid_store_page_id' ) ) {
|
34 |
+
$content = '<script type="text/javascript"> xMinicart("style=","layout=Mini"); </script>';
|
35 |
+
}
|
36 |
+
|
37 |
+
return $content;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function body_class($classes)
|
41 |
+
{
|
42 |
+
if (get_option('ecwid_show_search_box')) {
|
43 |
+
$classes[] = 'ecwid-with-search';
|
44 |
+
}
|
45 |
+
|
46 |
+
return $classes;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function on_create_store_page($page_id)
|
50 |
+
{
|
51 |
+
update_post_meta($page_id, '_wp_page_template', 'full-width-page.php');
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
global $ecwid_current_theme;
|
56 |
+
$ecwid_current_theme = new Ecwid_Theme_Responsive();
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Ecwid
|
|
3 |
Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 4.7
|
6 |
-
Stable tag: 5.0.
|
7 |
|
8 |
Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
|
9 |
|
@@ -149,6 +149,10 @@ You can use Ecwid’s built-in import tools to copy your store products from any
|
|
149 |
* [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
|
150 |
|
151 |
== Changelog ==
|
|
|
|
|
|
|
|
|
152 |
= 5.0.6 =
|
153 |
- **Fixed a loading speed issue.** Some sites with the Ecwid ecommerce plugin might have troubles with loading speed, when store categories menu was enabled. We optimized the way Ecwid renders and displays the store categories navigation so the issue should be fixed now.
|
154 |
|
3 |
Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 4.7
|
6 |
+
Stable tag: 5.0.7
|
7 |
|
8 |
Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
|
9 |
|
149 |
* [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
|
150 |
|
151 |
== Changelog ==
|
152 |
+
= 5.0.7 =
|
153 |
+
- **SEO improvement for canonical tags on the product and category pages.** The Ecwid ecommerce plugin now hides the store root page canonical and dynamically adds corresponding canonical tags to the product and category pages as you browse the store. This is to improve the pages visibility for search engines, when the new clean URLs option is enabled.
|
154 |
+
- **Fixed layout issue in the Wordpress 2017 theme.** We found an issue with the way Ecwid online stores are displayed in the default Wordpress “Twenty Seventeen” theme — the stores pages appeared too narrow. We fixed that.
|
155 |
+
|
156 |
= 5.0.6 =
|
157 |
- **Fixed a loading speed issue.** Some sites with the Ecwid ecommerce plugin might have troubles with loading speed, when store categories menu was enabled. We optimized the way Ecwid renders and displays the store categories navigation so the issue should be fixed now.
|
158 |
|
templates/advanced-settings.php
CHANGED
@@ -44,8 +44,6 @@
|
|
44 |
</div>
|
45 |
</div>
|
46 |
|
47 |
-
<hr />
|
48 |
-
|
49 |
<?php if (get_option('ecwid_hide_appearance_menu') != 'Y'): ?>
|
50 |
<div class="pure-control-group bottom-border">
|
51 |
|
@@ -123,6 +121,8 @@
|
|
123 |
</div>
|
124 |
</div>
|
125 |
|
|
|
|
|
126 |
<hr />
|
127 |
|
128 |
<div class="pure-control-group checkbox">
|
@@ -147,6 +147,7 @@
|
|
147 |
<?php echo sprintf(__('Please note this functionality is in beta. So if you run into difficulties or find problems with Chameleon, please <a %s>let us know</a>.', 'ecwid-shopping-cart'), ' target="_blank" href="' . __('https://support.ecwid.com/hc/en-us/requests/new', 'ecwid-shopping-cart') . '"'); ?>
|
148 |
</div>
|
149 |
</div>
|
|
|
150 |
|
151 |
|
152 |
<?php $show_categories = ecwid_migrations_is_original_plugin_version_older_than('3.3') || get_option('ecwid_use_new_horizontal_categories') != 'Y'; ?>
|
@@ -222,4 +223,4 @@
|
|
222 |
</div>
|
223 |
</fieldset>
|
224 |
</form>
|
225 |
-
</div>
|
44 |
</div>
|
45 |
</div>
|
46 |
|
|
|
|
|
47 |
<?php if (get_option('ecwid_hide_appearance_menu') != 'Y'): ?>
|
48 |
<div class="pure-control-group bottom-border">
|
49 |
|
121 |
</div>
|
122 |
</div>
|
123 |
|
124 |
+
<?php if ( get_option( 'ecwid_use_chameleon' ) ): ?>
|
125 |
+
|
126 |
<hr />
|
127 |
|
128 |
<div class="pure-control-group checkbox">
|
147 |
<?php echo sprintf(__('Please note this functionality is in beta. So if you run into difficulties or find problems with Chameleon, please <a %s>let us know</a>.', 'ecwid-shopping-cart'), ' target="_blank" href="' . __('https://support.ecwid.com/hc/en-us/requests/new', 'ecwid-shopping-cart') . '"'); ?>
|
148 |
</div>
|
149 |
</div>
|
150 |
+
<?php endif; ?>
|
151 |
|
152 |
|
153 |
<?php $show_categories = ecwid_migrations_is_original_plugin_version_older_than('3.3') || get_option('ecwid_use_new_horizontal_categories') != 'Y'; ?>
|
223 |
</div>
|
224 |
</fieldset>
|
225 |
</form>
|
226 |
+
</div>
|
templates/general-settings-initial.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="wrap">
|
2 |
+
|
3 |
+
<form method="POST" action="options.php" class="pure-form ecwid-settings general-settings">
|
4 |
+
<h2><?php _e('Ecwid Shopping Cart — General settings', 'ecwid-shopping-cart'); ?></h2>
|
5 |
+
<?php settings_fields('ecwid_options_page'); ?>
|
6 |
+
<fieldset>
|
7 |
+
|
8 |
+
<input type="hidden" name="settings_section" value="general" />
|
9 |
+
|
10 |
+
<div class="greeting-box">
|
11 |
+
|
12 |
+
<div class="image-container">
|
13 |
+
<img class="greeting-image" src="<?php echo(esc_attr(ECWID_PLUGIN_URL)); ?>/images/store_inprogress.png" width="142" />
|
14 |
+
</div>
|
15 |
+
|
16 |
+
<div class="messages-container">
|
17 |
+
<div class="main-message">
|
18 |
+
|
19 |
+
<?php _e('Thank you for choosing Ecwid to build your online store', 'ecwid-shopping-cart'); ?>
|
20 |
+
</div>
|
21 |
+
<div class="secondary-message">
|
22 |
+
<?php _e('The first step towards opening your online business: <br />Let’s get started and add a store to your WordPress website in <strong>3</strong> simple steps.', 'ecwid-shopping-cart'); ?>
|
23 |
+
</div>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
</div>
|
27 |
+
<hr />
|
28 |
+
|
29 |
+
<ol>
|
30 |
+
<li>
|
31 |
+
<h4><?php _e('Register at Ecwid', 'ecwid-shopping-cart'); ?></h4>
|
32 |
+
<div>
|
33 |
+
<?php _e('Create a new Ecwid account which you will use to manage your store and inventory. The registration is free.', 'ecwid-shopping-cart'); ?>
|
34 |
+
</div>
|
35 |
+
<div class="ecwid-account-buttons">
|
36 |
+
<a class="pure-button pure-button-secondary" target="_blank" href="https://my.ecwid.com/cp/?source=wporg#register">
|
37 |
+
<?php _e('Create new Ecwid account', 'ecwid-shopping-cart'); ?>
|
38 |
+
</a>
|
39 |
+
<a class="pure-button pure-button-secondary" target="_blank" href="https://my.ecwid.com/cp/?source=wporg#t1=&t2=Dashboard">
|
40 |
+
<?php _e('I already have Ecwid account, sign in', 'ecwid-shopping-cart'); ?>
|
41 |
+
</a>
|
42 |
+
</div>
|
43 |
+
<div class="note">
|
44 |
+
<?php _e('You will be able to sign up through your existing Google, Facebook or PayPal profiles as well.', 'ecwid-shopping-cart'); ?>
|
45 |
+
</div>
|
46 |
+
</li>
|
47 |
+
<li>
|
48 |
+
<h4><?php _e('Find your Store ID', 'ecwid-shopping-cart'); ?></h4>
|
49 |
+
<div>
|
50 |
+
<?php _e('Store ID is a unique identifier of any Ecwid store, it consists of several digits. You can find it on the "Dashboard" page of Ecwid control panel. Also the Store ID will be sent in the Welcome email after the registration.', 'ecwid-shopping-cart'); ?>
|
51 |
+
</div>
|
52 |
+
</li>
|
53 |
+
<li>
|
54 |
+
<h4>
|
55 |
+
<?php _e('Enter your Store ID', 'ecwid-shopping-cart'); ?>
|
56 |
+
</h4>
|
57 |
+
<div><label for="ecwid_store_id"><?php _e('Enter your Store ID here:', 'ecwid-shopping-cart'); ?></label></div>
|
58 |
+
<div class="pure-control-group store-id">
|
59 |
+
<input
|
60 |
+
id="ecwid_store_id"
|
61 |
+
name="ecwid_store_id"
|
62 |
+
type="text"
|
63 |
+
placeholder="<?php _e('Store ID', 'ecwid-shopping-cart'); ?>"
|
64 |
+
value="<?php if (get_ecwid_store_id() != 1003) echo esc_attr(get_ecwid_store_id()); ?>"
|
65 |
+
/>
|
66 |
+
<button type="submit" class="<?php echo ECWID_MAIN_BUTTON_CLASS; ?>"><?php _e('Save and connect your Ecwid store to the site', 'ecwid-shopping-cart'); ?></button>
|
67 |
+
</div>
|
68 |
+
|
69 |
+
</li>
|
70 |
+
</ol>
|
71 |
+
<hr />
|
72 |
+
<p><?php _e('Questions? Visit <a href="http://help.ecwid.com/?source=wporg">Ecwid support center</a>', 'ecwid-shopping-cart'); ?></p>
|
73 |
+
</fieldset>
|
74 |
+
</form>
|
75 |
+
</div>
|
templates/general-settings.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="wrap">
|
2 |
+
|
3 |
+
<form method="POST" action="options.php" class="pure-form ecwid-settings general-settings" name="settings">
|
4 |
+
<h2><?php _e('Ecwid Shopping Cart — General settings', 'ecwid-shopping-cart'); ?></h2>
|
5 |
+
<?php settings_fields('ecwid_options_page'); ?>
|
6 |
+
<fieldset>
|
7 |
+
|
8 |
+
<input type="hidden" name="settings_section" value="general" />
|
9 |
+
|
10 |
+
<div class="greeting-box complete">
|
11 |
+
<div class="image-container">
|
12 |
+
<img class="greeting-image" src="<?php echo(esc_attr(ECWID_PLUGIN_URL)); ?>/images/store_ready.png" width="142" />
|
13 |
+
</div>
|
14 |
+
|
15 |
+
<div class="messages-container">
|
16 |
+
<?php if (array_key_exists('settings-updated', $_GET)): ?>
|
17 |
+
|
18 |
+
<div class="main-message"><?php _e('Congratulations!', 'ecwid-shopping-cart'); ?></div>
|
19 |
+
<div class="secondary-message"?><?php _e('Your Ecwid store is now connected to your WordPress website', 'ecwid-shopping-cart'); ?></div>
|
20 |
+
|
21 |
+
<?php else: ?>
|
22 |
+
|
23 |
+
<div class="main-message"><?php _e('Greetings!', 'ecwid-shopping-cart'); ?></div>
|
24 |
+
<div class="secondary-message"?><?php _e('Your Ecwid store is connected to your WordPress website', 'ecwid-shopping-cart'); ?></div>
|
25 |
+
<?php endif; ?>
|
26 |
+
</div>
|
27 |
+
</div>
|
28 |
+
<hr />
|
29 |
+
<div class="section">
|
30 |
+
<div class="left">
|
31 |
+
<span class="main-info">
|
32 |
+
<?php _e('Store ID', 'ecwid-shopping-cart'); ?>: <strong><?php echo esc_attr(get_ecwid_store_id()); ?></strong>
|
33 |
+
</span>
|
34 |
+
</div>
|
35 |
+
<div class="right two-buttons">
|
36 |
+
<a class="pure-button" target="_blank" href="https://my.ecwid.com/cp/?source=wporg#t1=&t2=Dashboard">
|
37 |
+
<?php _e('Control panel', 'ecwid-shopping-cart'); ?>
|
38 |
+
</a>
|
39 |
+
<a class="pure-button" target="_blank" href="<?php echo esc_attr(get_page_link(get_option('ecwid_store_page_id'))); ?>">
|
40 |
+
<?php _e('Visit storefront', 'ecwid-shopping-cart'); ?>
|
41 |
+
</a>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
|
45 |
+
<?php if (!ecwid_is_paid_account()): ?>
|
46 |
+
<div class="section account-section">
|
47 |
+
<div class="left">
|
48 |
+
<div class="secondary-info">
|
49 |
+
<?php _e('Upgrade your account to get access to more Ecwid plugin features', 'ecwid-shopping-cart'); ?>
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
|
53 |
+
<div class="right">
|
54 |
+
<a class="<?php echo ECWID_MAIN_BUTTON_CLASS; ?>" target="_blank" href="http://www.ecwid.com/plans-and-pricing.html">
|
55 |
+
<?php _e('Upgrade', 'ecwid-shopping-cart'); ?>
|
56 |
+
</a>
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
<?php endif; ?>
|
60 |
+
|
61 |
+
<div class="note grayed-links">
|
62 |
+
<?php
|
63 |
+
echo sprintf(
|
64 |
+
__('If you want to connect another Ecwid store, you can <a %s>disconnect the current one and change Store ID</a>.', 'ecwid-shopping-cart'),
|
65 |
+
'href="#" onClick="javascript:document.forms[\'settings\'].submit(); return false;"'
|
66 |
+
);
|
67 |
+
?>
|
68 |
+
|
69 |
+
</div>
|
70 |
+
|
71 |
+
<hr />
|
72 |
+
<p><?php _e('Questions? Visit <a href="http://help.ecwid.com/?source=wporg">Ecwid support center</a>', 'ecwid-shopping-cart'); ?></p>
|
73 |
+
</fieldset>
|
74 |
+
</form>
|
75 |
+
</div>
|
templates/setup.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="wrap">
|
2 |
+
|
3 |
+
<form method="POST" action="options.php" class="pure-form ecwid-settings general-settings">
|
4 |
+
<h2><?php _e('Ecwid Shopping Cart — Connect', 'ecwid-shopping-cart'); ?></h2>
|
5 |
+
<?php settings_fields('ecwid_options_page'); ?>
|
6 |
+
<fieldset>
|
7 |
+
|
8 |
+
<input type="hidden" name="settings_section" value="general" />
|
9 |
+
|
10 |
+
<div class="greeting-box">
|
11 |
+
|
12 |
+
<div class="image-container">
|
13 |
+
<img class="greeting-image" src="<?php echo(esc_attr(ECWID_PLUGIN_URL)); ?>/images/store_inprogress.png" width="142" />
|
14 |
+
</div>
|
15 |
+
|
16 |
+
<div class="messages-container">
|
17 |
+
<div class="main-message">
|
18 |
+
|
19 |
+
<?php _e('Thank you for choosing Ecwid to build your online store', 'ecwid-shopping-cart'); ?>
|
20 |
+
</div>
|
21 |
+
<div class="secondary-message">
|
22 |
+
<?php _e('The first step towards opening your online business: <br />Let’s get started and add a store to your WordPress website in <strong>3</strong> simple steps.', 'ecwid-shopping-cart'); ?>
|
23 |
+
</div>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
</div>
|
27 |
+
<hr />
|
28 |
+
|
29 |
+
<ol>
|
30 |
+
<li>
|
31 |
+
<h4><?php _e('Register at Ecwid', 'ecwid-shopping-cart'); ?></h4>
|
32 |
+
<div>
|
33 |
+
<?php _e('Create a new Ecwid account which you will use to manage your store and inventory. The registration is free.', 'ecwid-shopping-cart'); ?>
|
34 |
+
</div>
|
35 |
+
<div class="ecwid-account-buttons">
|
36 |
+
<a class="pure-button pure-button-secondary" target="_blank" href="https://my.ecwid.com/cp/?source=wporg#register">
|
37 |
+
<?php _e('Create new Ecwid account', 'ecwid-shopping-cart'); ?>
|
38 |
+
</a>
|
39 |
+
<a class="pure-button pure-button-secondary" target="_blank" href="https://my.ecwid.com/cp/?source=wporg#t1=&t2=Dashboard">
|
40 |
+
<?php _e('I already have Ecwid account, sign in', 'ecwid-shopping-cart'); ?>
|
41 |
+
</a>
|
42 |
+
</div>
|
43 |
+
<div class="note">
|
44 |
+
<?php _e('You will be able to sign up through your existing Google, Facebook or PayPal profiles as well.', 'ecwid-shopping-cart'); ?>
|
45 |
+
</div>
|
46 |
+
</li>
|
47 |
+
<li>
|
48 |
+
<h4><?php _e('Find your Store ID', 'ecwid-shopping-cart'); ?></h4>
|
49 |
+
<div>
|
50 |
+
<?php _e('Store ID is a unique identifier of any Ecwid store, it consists of several digits. You can find it on the "Dashboard" page of Ecwid control panel. Also the Store ID will be sent in the Welcome email after the registration.', 'ecwid-shopping-cart'); ?>
|
51 |
+
</div>
|
52 |
+
</li>
|
53 |
+
<li>
|
54 |
+
<h4>
|
55 |
+
<?php _e('Enter your Store ID', 'ecwid-shopping-cart'); ?>
|
56 |
+
</h4>
|
57 |
+
<div><label for="ecwid_store_id"><?php _e('Enter your Store ID here:', 'ecwid-shopping-cart'); ?></label></div>
|
58 |
+
<div class="pure-control-group store-id">
|
59 |
+
<input
|
60 |
+
id="ecwid_store_id"
|
61 |
+
name="ecwid_store_id"
|
62 |
+
type="text"
|
63 |
+
placeholder="<?php _e('Store ID', 'ecwid-shopping-cart'); ?>"
|
64 |
+
value="<?php if (get_ecwid_store_id() != 1003) echo esc_attr(get_ecwid_store_id()); ?>"
|
65 |
+
/>
|
66 |
+
<button type="submit" class="<?php echo ECWID_MAIN_BUTTON_CLASS; ?>"><?php _e('Save and connect your Ecwid store to the site', 'ecwid-shopping-cart'); ?></button>
|
67 |
+
</div>
|
68 |
+
|
69 |
+
</li>
|
70 |
+
</ol>
|
71 |
+
<hr />
|
72 |
+
<p><?php _e('Questions? Visit <a href="http://help.ecwid.com/?source=wporg">Ecwid support center</a>', 'ecwid-shopping-cart'); ?></p>
|
73 |
+
</fieldset>
|
74 |
+
</form>
|
75 |
+
</div>
|
templates/wp-dashboard-widget.php
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<table style="width: 100%; border: 0px solid #C0C0C0; background-color: #FFFFFF" cellSpacing=0 cellPadding=3>
|
2 |
+
<tr><td height=80 style="background-color: #FFFFFF">
|
3 |
+
<!-- Begin Ad Code -->
|
4 |
+
<script data-cfasync="false" type="text/javascript">
|
5 |
+
function loadTextAd(sparkCounter, id, setID) {
|
6 |
+
output179716="http://ab166273.adbutler-alion.com/adserve/;ID=" + id + ";setID=" + setID + ";type=textad;pid=" + rnd + ";layoutID=" + sparkCounter;
|
7 |
+
document.writeln("<SCR" + "IPT SRC=" + output179716 + " type=\"text/javascript\"> <\/scr" + "ipt>");
|
8 |
+
}
|
9 |
+
var loadedTextAds179716;
|
10 |
+
if(loadedTextAds179716 == null)
|
11 |
+
loadedTextAds179716= new Array();
|
12 |
+
var d = new Date();
|
13 |
+
var id179716 = 166273;
|
14 |
+
var setID179716 = 179716;
|
15 |
+
var rnd = window.rnd || Math.floor(Math.random()*10e6);
|
16 |
+
var sparkCounter179716;
|
17 |
+
if(sparkCounter179716 == null)
|
18 |
+
sparkCounter179716 = 1;
|
19 |
+
else
|
20 |
+
sparkCounter179716 = sparkCounter179716 + 1;
|
21 |
+
id="abta179716" + sparkCounter179716;
|
22 |
+
document.writeln("<div id='" + id + "'></div>");
|
23 |
+
loadedTextAds179716[sparkCounter179716] = false;
|
24 |
+
loadTextAd(sparkCounter179716, id179716, setID179716);
|
25 |
+
</script>
|
26 |
+
|
27 |
+
<!-- End Ad Code -->
|
28 |
+
</td></tr>
|
29 |
+
<tr><td height=80 style="background-color: #FFFFFF; border-top: 1px dashed #C0C0C0">
|
30 |
+
<!-- Begin Ad Code -->
|
31 |
+
<script data-cfasync="false" type="text/javascript">
|
32 |
+
function loadTextAd(sparkCounter, id, setID) {
|
33 |
+
output179716="http://ab166273.adbutler-alion.com/adserve/;ID=" + id + ";setID=" + setID + ";type=textad;pid=" + rnd + ";layoutID=" + sparkCounter;
|
34 |
+
document.writeln("<SCR" + "IPT SRC=" + output179716 + " type=\"text/javascript\"> <\/scr" + "ipt>");
|
35 |
+
}
|
36 |
+
var loadedTextAds179716;
|
37 |
+
if(loadedTextAds179716 == null)
|
38 |
+
loadedTextAds179716= new Array();
|
39 |
+
var d = new Date();
|
40 |
+
var id179716 = 166273;
|
41 |
+
var setID179716 = 179716;
|
42 |
+
var rnd = window.rnd || Math.floor(Math.random()*10e6);
|
43 |
+
var sparkCounter179716;
|
44 |
+
if(sparkCounter179716 == null)
|
45 |
+
sparkCounter179716 = 1;
|
46 |
+
else
|
47 |
+
sparkCounter179716 = sparkCounter179716 + 1;
|
48 |
+
id="abta179716" + sparkCounter179716;
|
49 |
+
document.writeln("<div id='" + id + "'></div>");
|
50 |
+
loadedTextAds179716[sparkCounter179716] = false;
|
51 |
+
loadTextAd(sparkCounter179716, id179716, setID179716);
|
52 |
+
</script>
|
53 |
+
|
54 |
+
<!-- End Ad Code -->
|
55 |
+
</td></tr>
|
56 |
+
<tr><td height=80 style="background-color: #FFFFFF; border-top: 1px dashed #C0C0C0">
|
57 |
+
<!-- Begin Ad Code -->
|
58 |
+
<script data-cfasync="false" type="text/javascript">
|
59 |
+
function loadTextAd(sparkCounter, id, setID) {
|
60 |
+
output179716="http://ab166273.adbutler-alion.com/adserve/;ID=" + id + ";setID=" + setID + ";type=textad;pid=" + rnd + ";layoutID=" + sparkCounter;
|
61 |
+
document.writeln("<SCR" + "IPT SRC=" + output179716 + " type=\"text/javascript\"> <\/scr" + "ipt>");
|
62 |
+
}
|
63 |
+
var loadedTextAds179716;
|
64 |
+
if(loadedTextAds179716 == null)
|
65 |
+
loadedTextAds179716= new Array();
|
66 |
+
var d = new Date();
|
67 |
+
var id179716 = 166273;
|
68 |
+
var setID179716 = 179716;
|
69 |
+
var rnd = window.rnd || Math.floor(Math.random()*10e6);
|
70 |
+
var sparkCounter179716;
|
71 |
+
if(sparkCounter179716 == null)
|
72 |
+
sparkCounter179716 = 1;
|
73 |
+
else
|
74 |
+
sparkCounter179716 = sparkCounter179716 + 1;
|
75 |
+
id="abta179716" + sparkCounter179716;
|
76 |
+
document.writeln("<div id='" + id + "'></div>");
|
77 |
+
loadedTextAds179716[sparkCounter179716] = false;
|
78 |
+
loadTextAd(sparkCounter179716, id179716, setID179716);
|
79 |
+
</script>
|
80 |
+
|
81 |
+
<!-- End Ad Code -->
|
82 |
+
</td></tr>
|
83 |
+
</table>
|
84 |
+
<div class="ecwid-wp-dashboard-fallback">
|
85 |
+
<div class="item" style="border-bottom: 1px dashed #C0C0C0">
|
86 |
+
<div class="title">
|
87 |
+
<a target="_blank" href="https://itunes.apple.com/bm/app/ecwid/id626731456">
|
88 |
+
<?php _e('Sell On The Go with Ecwid iOS Application', 'ecwid-shopping-cart'); ?>
|
89 |
+
</a>
|
90 |
+
</div>
|
91 |
+
<div class="content">
|
92 |
+
<?php _e('Ecwid iOS app allows you to manage your online store, sell your products on the go, and accept payments with your phone. Just download the Ecwid app, connect it to your Ecwid shop and have your sales at your fingertips!', 'ecwid-shopping-cart'); ?>
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
<div class="item" style="border-bottom: 1px dashed #C0C0C0">
|
96 |
+
<div class="title">
|
97 |
+
<a target="_blank" href="https://wordpress.org/plugins/google-sitemap-generator/">
|
98 |
+
<?php _e('Get Your Products Found on Google using XML Sitemap', 'ecwid-shopping-cart'); ?>
|
99 |
+
</a>
|
100 |
+
</div>
|
101 |
+
<div class="content">
|
102 |
+
<?php _e('Free Google XML Sitemaps plugin creates a sitemap that includes your store product links. This makes your product pages more visible to search engines and appear in the search results.', 'ecwid-shopping-cart'); ?>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
<div class="item">
|
106 |
+
<div class="title">
|
107 |
+
<a target="_blank" href="https://wordpress.org/plugins/ecwid-widgets-avalanche/">
|
108 |
+
<?php _e('Add Product Slider to Your Store', 'ecwid-shopping-cart'); ?>
|
109 |
+
</a>
|
110 |
+
</div>
|
111 |
+
<div class="content">
|
112 |
+
<?php _e('Add a fancy product slider to your site using a free WP Widgets Avalanche plugin which works perfectly with Ecwid', 'ecwid-shopping-cart'); ?>
|
113 |
+
</div>
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
<script data-cfasync="false" type="text/javascript">
|
117 |
+
<!--
|
118 |
+
(function() {
|
119 |
+
function is_ad_loaded() {
|
120 |
+
return jQuery('#abta1797161 table').length > 0;
|
121 |
+
}
|
122 |
+
|
123 |
+
function check_ads() {
|
124 |
+
if (is_ad_loaded()) {
|
125 |
+
jQuery('#ecwid_dashboard_widget div.inside > table').show();
|
126 |
+
jQuery('#ecwid_dashboard_widget .ecwid-wp-dashboard-fallback').hide();
|
127 |
+
} else {
|
128 |
+
jQuery('#ecwid_dashboard_widget div.inside > table').hide();
|
129 |
+
jQuery('#ecwid_dashboard_widget .ecwid-wp-dashboard-fallback').show();
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
var ecwid_wp_dashboard_interval = setInterval(function() {
|
134 |
+
check_ads();
|
135 |
+
}, 500);
|
136 |
+
|
137 |
+
check_ads();
|
138 |
+
|
139 |
+
setTimeout(function() {
|
140 |
+
if (!is_ad_loaded()) {
|
141 |
+
clearInterval(ecwid_wp_dashboard_interval);
|
142 |
+
}
|
143 |
+
}, 3000);
|
144 |
+
})();
|
145 |
+
-->
|
146 |
+
</script>
|