Ecwid Ecommerce Shopping Cart - Version 6.4

Version Description

  • Oct 29, 2018 =
  • New storefront appearance settings in Gutenberg. The new WordPress page editor (Gutenberg) now has plenty of e-commerce design settings: product thumbnails format and size, button and text colors, category images behavior, product page layout, store navigation elements and a lot more. We previously added these appearance options to your Ecwid store control panel: https://www.ecwid.com/blog/new-ecwid-design-settings-dozens-of-customization-options-no-coding.html.. Now they are a part of real-time page building experience: you tweak the appearance, preview changes and publish them right from the page editor. To see the new appearance options, please make sure you enabled the Gutenberg editor in your WordPress admin backend.
  • SEO fix: 404 status for removed products and categories. Previously, Ecwid didn't mark removed products and categories with correct 404 responses it just displayed a customer-friendly message saying the product is not available. Google recommends making removed pages clearly marked with a special 404 response code available for search robots to read. We added it to make sure unavailable products will be quicker removed from the Google search results giving more customer attention to the available products.
  • Minor fixes and improvements.
Download this release

Release Info

Developer Ecwid
Plugin Icon 128x128 Ecwid Ecommerce Shopping Cart
Version 6.4
Comparing to
See all releases

Code changes from version 6.3.2 to 6.4

css/gutenberg-store.css CHANGED
@@ -130,3 +130,87 @@
130
  padding-left: 20px;
131
  padding-top: 40px;
132
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  padding-left: 20px;
131
  padding-top: 40px;
132
  }
133
+
134
+
135
+ .ecwid-store-block-icon {
136
+ background: url('../images/wordpress_20x20.svg');
137
+ background-size: contain;
138
+ width: 20px;
139
+ height: 20px;
140
+ margin-bottom: 3px;
141
+ }
142
+
143
+ .ecwid-store-block {
144
+ position: relative;
145
+ }
146
+
147
+ .ecwid-store-block-button {
148
+ font-family: Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;
149
+ position: relative;
150
+ top:135px;
151
+ font-size: 14px;
152
+ }
153
+
154
+ .ecwid-product-block-icon {
155
+ background: url('../images/gutenberg-block-product.svg');
156
+ background-size: contain;
157
+ width: 20px;
158
+ height: 20px;
159
+ margin-bottom: 3px;
160
+ }
161
+
162
+ .ec-store-block {
163
+ text-align: center;
164
+ font-size: 13px;
165
+ font-family: 'Open Sans';
166
+ padding: 1em;
167
+ background-color: #f8f9f9;
168
+ display: flex;
169
+ flex-direction: column;
170
+ justify-content: center;
171
+ min-height: 220px;
172
+ }
173
+
174
+ .ec-store-block > div {
175
+ display: flex;
176
+ justify-content: center;
177
+ }
178
+
179
+ .ec-store-block .ec-store-block-header {
180
+ font-weight: 600;
181
+ margin-bottom: 1em;
182
+ }
183
+
184
+ .ec-store-block .ec-store-block-header svg {
185
+ max-height: 20px;
186
+ margin-right: 1ch;
187
+ }
188
+
189
+ .ec-store-block .ec-store-store-block-icon,
190
+ .ec-store-block .ec-store-product-block-icon {
191
+ margin-right: 10px;
192
+ }
193
+
194
+ .ec-store-block .ec-store-block-image {
195
+ height: 90px;
196
+ background-repeat: no-repeat;
197
+ background-size: contain;
198
+ background-position: 50% 50%;
199
+ }
200
+
201
+ .ec-store-block .ec-store-block-image img {
202
+ width: auto;
203
+ max-height: 100%;
204
+ -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
205
+ -moz-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
206
+ box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
207
+ }
208
+
209
+ .ec-store-block .ec-store-block-title {
210
+ margin-top: 11px;
211
+ margin-bottom: 1em;
212
+ }
213
+
214
+ .ec-store-block .ec-store-block-button {
215
+ font-weight: 400;
216
+ }
css/gutenberg/blocks.editor.build.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ .components-toolbar__control.components-button:not(:disabled).is-active>svg rect{fill:white}.components-toolbar__control.components-button.ecwid-toolbar-icon>svg{padding:0}.ecwid-store-block-icon{background:url("../images/wordpress_20x20.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ecwid-store-block{position:relative}.ecwid-store-block-button{font-family:Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;position:relative;top:135px;font-size:14px}.ecwid-product-block-icon{background:url("../images/gutenberg-block-product.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ecwid-block{text-align:center;font-size:13px;font-family:'Open Sans';padding:1em;background-color:#f8f9f9;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;min-height:220px}.ecwid-block>div{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.ecwid-block .ecwid-block-header{font-weight:600;margin-bottom:1em}.ecwid-block .ecwid-block-header svg{max-height:20px;margin-right:1ch}.ecwid-block .ecwid-store-block-icon,.ecwid-block .ecwid-product-block-icon{margin-right:10px}.ecwid-block .ecwid-block-image{height:90px;background-repeat:no-repeat;background-size:contain;background-position:50% 50%}.ecwid-block .ecwid-block-image img{width:auto;max-height:100%;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,0.1);box-shadow:0 2px 5px 0 rgba(0,0,0,0.1)}.ecwid-block .ecwid-block-title{margin-top:11px;margin-bottom:1em}.ecwid-block .ecwid-block-button{font-weight:400}.ecwid-selected-product{font-family:Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif}.ecwid-selected-product>div{display:table-cell}.ecwid-selected-product .ecwid-selected-product-image img{-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,0.1);box-shadow:0 2px 5px 0 rgba(0,0,0,0.1)}.ecwid-selected-product .ecwid-selected-product-image{padding-right:25px;vertical-align:top}.ecwid-selected-product .ecwid-selected-product-details{vertical-align:middle}.ecwid-selected-product .ecwid-selected-product-name{font-size:20px;font-weight:600;margin-bottom:0.5em}.ecwid-selected-product .ecwid-selected-product-sku{font-size:16px;margin-bottom:1em}.media-frame-content.has-selected-product form,.media-frame-content.has-selected-product .products,.media-frame-content.has-selected-product .tablenav{display:none}#ecwid-product-popup-content .media-frame-content.ecwid-selected-product{padding-left:20px;padding-top:40px}.ecwid-store-block-icon{background:url("../images/wordpress_20x20.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ecwid-store-block{position:relative}.ecwid-store-block-button{font-family:Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;position:relative;top:135px;font-size:14px}.ecwid-product-block-icon{background:url("../../images/gutenberg-block-product.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ec-store-block{text-align:center;font-size:13px;font-family:'Open Sans';padding:1em;background-color:#f8f9f9;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;min-height:220px}.ec-store-block>div{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.ec-store-block .ec-store-block-header{font-weight:600;margin-bottom:1em}.ec-store-block .ec-store-block-header svg{max-height:20px;margin-right:1ch}.ec-store-block .ec-store-store-block-icon,.ec-store-block .ec-store-product-block-icon{margin-right:10px}.ec-store-block .ec-store-block-image{height:90px;background-repeat:no-repeat;background-size:contain;background-position:50% 50%}.ec-store-block .ec-store-block-image img{width:auto;max-height:100%;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,0.1);box-shadow:0 2px 5px 0 rgba(0,0,0,0.1)}.ec-store-block .ec-store-block-title{margin-top:11px;margin-bottom:1em}.ec-store-block .ec-store-block-button{font-weight:400}.ec-store-color-picker .component-color-indicator{vertical-align:text-bottom}.ec-store-color-picker .components-color-palette{margin-top:.6rem}.ec-store-inspector-subheader{color:#555d66;font-weight:600;padding:15px 0}
2
+ .wp-block-cgb-block-my-block2{background:#bada55;border:0.2rem solid #292929;color:#292929;margin:0 auto;max-width:740px;padding:2rem}
css/gutenberg/blocks.style.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ .wp-block-cgb-block-my-block{background:#ff4500;border:0.2rem solid #292929;color:#292929;margin:0 auto;max-width:740px;padding:2rem}
2
+ .wp-block-cgb-block-my-block2{background:#ff4500;border:0.2rem solid #292929;color:#292929;margin:0 auto;max-width:740px;padding:2rem}
css/gutenberg/editor.scss ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * #.# Editor Styles
3
+ *
4
+ * CSS for just Backend enqueued after style.scss
5
+ * which makes it higher in priority.
6
+ */
7
+
8
+ .components-toolbar__control.components-button:not(:disabled).is-active>svg rect {
9
+ fill: white;
10
+ }
11
+
12
+ .components-toolbar__control.components-button.ecwid-toolbar-icon>svg {
13
+ padding: 0;
14
+ }
15
+
16
+ .ecwid-store-block-icon {
17
+ background: url('../images/wordpress_20x20.svg');
18
+ background-size: contain;
19
+ width: 20px;
20
+ height: 20px;
21
+ margin-bottom: 3px;
22
+ }
23
+
24
+ .ecwid-store-block {
25
+ position: relative;
26
+ }
27
+
28
+ .ecwid-store-block-button {
29
+ font-family: Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;
30
+ position: relative;
31
+ top:135px;
32
+ font-size: 14px;
33
+ }
34
+
35
+ .ecwid-product-block-icon {
36
+ background: url('../images/gutenberg-block-product.svg');
37
+ background-size: contain;
38
+ width: 20px;
39
+ height: 20px;
40
+ margin-bottom: 3px;
41
+ }
42
+
43
+ .ecwid-block {
44
+ text-align: center;
45
+ font-size: 13px;
46
+ font-family: 'Open Sans';
47
+ padding: 1em;
48
+ background-color: #f8f9f9;
49
+ display: flex;
50
+ flex-direction: column;
51
+ justify-content: center;
52
+ min-height: 220px;
53
+ }
54
+
55
+ .ecwid-block > div {
56
+ display: flex;
57
+ justify-content: center;
58
+ }
59
+
60
+ .ecwid-block .ecwid-block-header {
61
+ font-weight: 600;
62
+ margin-bottom: 1em;
63
+ }
64
+
65
+ .ecwid-block .ecwid-block-header svg {
66
+ max-height: 20px;
67
+ margin-right: 1ch;
68
+ }
69
+
70
+ .ecwid-block .ecwid-store-block-icon,
71
+ .ecwid-block .ecwid-product-block-icon {
72
+ margin-right: 10px;
73
+ }
74
+
75
+ .ecwid-block .ecwid-block-image {
76
+ height: 90px;
77
+ background-repeat: no-repeat;
78
+ background-size: contain;
79
+ background-position: 50% 50%;
80
+ }
81
+
82
+ .ecwid-block .ecwid-block-image img {
83
+ width: auto;
84
+ max-height: 100%;
85
+ -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
86
+ -moz-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
87
+ box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
88
+ }
89
+
90
+ .ecwid-block .ecwid-block-title {
91
+ margin-top: 11px;
92
+ margin-bottom: 1em;
93
+ }
94
+
95
+ .ecwid-block .ecwid-block-button {
96
+ font-weight: 400;
97
+ }
98
+
99
+ /*
100
+ Popup styles for selected product block
101
+ */
102
+
103
+ .ecwid-selected-product {
104
+ font-family: Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;
105
+ }
106
+
107
+ .ecwid-selected-product > div {
108
+ display: table-cell;
109
+ }
110
+
111
+ .ecwid-selected-product .ecwid-selected-product-image img {
112
+ -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
113
+ -moz-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
114
+ box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
115
+ }
116
+
117
+ .ecwid-selected-product .ecwid-selected-product-image {
118
+ padding-right: 25px;
119
+ vertical-align: top;
120
+ }
121
+
122
+ .ecwid-selected-product .ecwid-selected-product-details {
123
+ vertical-align: middle;
124
+ }
125
+
126
+ .ecwid-selected-product .ecwid-selected-product-name {
127
+ font-size: 20px;
128
+ font-weight: 600;
129
+ margin-bottom: 0.5em;
130
+ }
131
+
132
+ .ecwid-selected-product .ecwid-selected-product-sku {
133
+ font-size: 16px;
134
+ margin-bottom: 1em;
135
+ }
136
+
137
+ .media-frame-content.has-selected-product form,
138
+ .media-frame-content.has-selected-product .products,
139
+ .media-frame-content.has-selected-product .tablenav
140
+ {
141
+ display: none;
142
+ }
143
+
144
+ #ecwid-product-popup-content .media-frame-content.ecwid-selected-product {
145
+ padding-left: 20px;
146
+ padding-top: 40px;
147
+ }
148
+
149
+
150
+ .ecwid-store-block-icon {
151
+ background: url('../images/wordpress_20x20.svg');
152
+ background-size: contain;
153
+ width: 20px;
154
+ height: 20px;
155
+ margin-bottom: 3px;
156
+ }
157
+
158
+ .ecwid-store-block {
159
+ position: relative;
160
+ }
161
+
162
+ .ecwid-store-block-button {
163
+ font-family: Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;
164
+ position: relative;
165
+ top:135px;
166
+ font-size: 14px;
167
+ }
168
+
169
+ .ecwid-product-block-icon {
170
+ background: url('../../images/gutenberg-block-product.svg');
171
+ background-size: contain;
172
+ width: 20px;
173
+ height: 20px;
174
+ margin-bottom: 3px;
175
+ }
176
+
177
+ .ec-store-block {
178
+ text-align: center;
179
+ font-size: 13px;
180
+ font-family: 'Open Sans';
181
+ padding: 1em;
182
+ background-color: #f8f9f9;
183
+ display: flex;
184
+ flex-direction: column;
185
+ justify-content: center;
186
+ min-height: 220px;
187
+ }
188
+
189
+ .ec-store-block > div {
190
+ display: flex;
191
+ justify-content: center;
192
+ }
193
+
194
+ .ec-store-block .ec-store-block-header {
195
+ font-weight: 600;
196
+ margin-bottom: 1em;
197
+ }
198
+
199
+ .ec-store-block .ec-store-block-header svg {
200
+ max-height: 20px;
201
+ margin-right: 1ch;
202
+ }
203
+
204
+ .ec-store-block .ec-store-store-block-icon,
205
+ .ec-store-block .ec-store-product-block-icon {
206
+ margin-right: 10px;
207
+ }
208
+
209
+ .ec-store-block .ec-store-block-image {
210
+ height: 90px;
211
+ background-repeat: no-repeat;
212
+ background-size: contain;
213
+ background-position: 50% 50%;
214
+ }
215
+
216
+ .ec-store-block .ec-store-block-image img {
217
+ width: auto;
218
+ max-height: 100%;
219
+ -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
220
+ -moz-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
221
+ box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
222
+ }
223
+
224
+ .ec-store-block .ec-store-block-title {
225
+ margin-top: 11px;
226
+ margin-bottom: 1em;
227
+ }
228
+
229
+ .ec-store-block .ec-store-block-button {
230
+ font-weight: 400;
231
+ }
232
+
233
+ .ec-store-color-picker .component-color-indicator {
234
+ vertical-align: text-bottom;
235
+ }
236
+
237
+ .ec-store-color-picker .components-color-palette {
238
+ margin-top: .6rem;
239
+ }
240
+
241
+ .ec-store-inspector-subheader {
242
+ color: #555d66;
243
+ font-weight: 600;
244
+ padding: 15px 0;
245
+ }
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 Ecommerce
8
- Version: 6.3.2
9
  Author URI: https://ecwid.to/ecwid-site
10
  */
11
 
@@ -49,7 +49,7 @@ if ( is_admin() ){
49
  add_action('admin_init', 'ecwid_settings_api_init');
50
 
51
  add_action('admin_init', 'ecwid_check_version');
52
- add_action('admin_init', 'ecwid_process_oauth_params');
53
  add_action('admin_notices', 'ecwid_show_admin_messages');
54
  add_action('admin_enqueue_scripts', 'ecwid_common_admin_scripts');
55
  add_action('admin_enqueue_scripts', 'ecwid_register_admin_styles');
@@ -1101,7 +1101,7 @@ function ecwid_canonical() {
1101
 
1102
  $link = false;
1103
  if ( ecwid_is_applicable_escaped_fragment() ) {
1104
-
1105
  $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
1106
 
1107
  if ($params['mode'] == 'product') {
@@ -1140,7 +1140,6 @@ function ecwid_canonical() {
1140
  }
1141
 
1142
  function ecwid_is_applicable_escaped_fragment() {
1143
-
1144
  if (!Ecwid_Api_V3::is_available() ) {
1145
  return false;
1146
  }
@@ -1148,6 +1147,7 @@ function ecwid_is_applicable_escaped_fragment() {
1148
  if (!isset($_GET['_escaped_fragment_'])) return false;
1149
 
1150
  $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
 
1151
  if (!$params) return false;
1152
 
1153
  if (!in_array($params['mode'], array('category', 'product')) || !isset($params['id'])) return false;
@@ -1642,8 +1642,9 @@ function ecwid_parse_escaped_fragment($escaped_fragment) {
1642
 
1643
  $fragment = urldecode( $escaped_fragment );
1644
  $return = array();
1645
-
1646
  if ( preg_match( '/^(\/~\/)([a-z]+)\/(.*)$/', $fragment, $matches ) ) {
 
1647
  parse_str( $matches[3], $return );
1648
  $return['mode'] = $matches[2];
1649
  } elseif ( preg_match( '!.*/(p|c)/([0-9]*)!', $fragment, $matches ) ) {
@@ -1681,11 +1682,11 @@ function ecwid_store_activate() {
1681
  $shortcode = Ecwid_Shortcode_Base::get_current_store_shortcode_name();
1682
 
1683
  $content = <<<EOT
1684
- [$shortcode widgets="productbrowser" default_category_id="0" default_product_id="0"]
1685
  EOT;
1686
 
1687
  $content = <<<EOT
1688
- <!-- wp:ecwid/store-block {"widgets":"productbrowser","default_category_id":0,"default_product_id":0} -->
1689
  $content
1690
  <!-- /wp:ecwid/store-block -->
1691
  EOT;
@@ -2147,7 +2148,7 @@ function ecwid_common_admin_scripts() {
2147
  function ecwid_is_legacy_appearance_used() {
2148
  $api = new Ecwid_Api_V3();
2149
 
2150
- return Ecwid_Api_V3::get_token() && !$api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_PRODUCT_LIST );
2151
  }
2152
 
2153
  function ecwid_get_register_link()
@@ -2469,7 +2470,7 @@ function ecwid_help_do_page() {
2469
  }
2470
 
2471
  function ecwid_process_oauth_params() {
2472
-
2473
  if (strtoupper($_SERVER['REQUEST_METHOD']) != 'GET' || !isset($_GET['page'])) {
2474
  return false;
2475
  }
@@ -2885,8 +2886,17 @@ function ecwid_get_category_url($category)
2885
 
2886
  function ecwid_get_entity_url($entity, $type) {
2887
 
2888
- $link = Ecwid_Store_Page::get_store_url();
2889
-
 
 
 
 
 
 
 
 
 
2890
  if (is_numeric($entity)) {
2891
  return $link . '#!/' . $type . '/' . $entity;
2892
  } elseif (is_array($entity) && isset($entity['url'])) {
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 Ecommerce
8
+ Version: 6.4
9
  Author URI: https://ecwid.to/ecwid-site
10
  */
11
 
49
  add_action('admin_init', 'ecwid_settings_api_init');
50
 
51
  add_action('admin_init', 'ecwid_check_version');
52
+ add_action('template_redirect', 'ecwid_process_oauth_params');
53
  add_action('admin_notices', 'ecwid_show_admin_messages');
54
  add_action('admin_enqueue_scripts', 'ecwid_common_admin_scripts');
55
  add_action('admin_enqueue_scripts', 'ecwid_register_admin_styles');
1101
 
1102
  $link = false;
1103
  if ( ecwid_is_applicable_escaped_fragment() ) {
1104
+
1105
  $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
1106
 
1107
  if ($params['mode'] == 'product') {
1140
  }
1141
 
1142
  function ecwid_is_applicable_escaped_fragment() {
 
1143
  if (!Ecwid_Api_V3::is_available() ) {
1144
  return false;
1145
  }
1147
  if (!isset($_GET['_escaped_fragment_'])) return false;
1148
 
1149
  $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
1150
+
1151
  if (!$params) return false;
1152
 
1153
  if (!in_array($params['mode'], array('category', 'product')) || !isset($params['id'])) return false;
1642
 
1643
  $fragment = urldecode( $escaped_fragment );
1644
  $return = array();
1645
+
1646
  if ( preg_match( '/^(\/~\/)([a-z]+)\/(.*)$/', $fragment, $matches ) ) {
1647
+
1648
  parse_str( $matches[3], $return );
1649
  $return['mode'] = $matches[2];
1650
  } elseif ( preg_match( '!.*/(p|c)/([0-9]*)!', $fragment, $matches ) ) {
1682
  $shortcode = Ecwid_Shortcode_Base::get_current_store_shortcode_name();
1683
 
1684
  $content = <<<EOT
1685
+ [$shortcode]
1686
  EOT;
1687
 
1688
  $content = <<<EOT
1689
+ <!-- wp:ecwid/store-block -->
1690
  $content
1691
  <!-- /wp:ecwid/store-block -->
1692
  EOT;
2148
  function ecwid_is_legacy_appearance_used() {
2149
  $api = new Ecwid_Api_V3();
2150
 
2151
+ return Ecwid_Api_V3::is_available() && !ecwid_is_demo_store() && !$api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_PRODUCT_LIST );
2152
  }
2153
 
2154
  function ecwid_get_register_link()
2470
  }
2471
 
2472
  function ecwid_process_oauth_params() {
2473
+
2474
  if (strtoupper($_SERVER['REQUEST_METHOD']) != 'GET' || !isset($_GET['page'])) {
2475
  return false;
2476
  }
2886
 
2887
  function ecwid_get_entity_url($entity, $type) {
2888
 
2889
+ if ( Ecwid_Store_page::is_store_page() ) {
2890
+ $link = get_permalink();
2891
+ } else {
2892
+ $link = Ecwid_Store_Page::get_store_url();
2893
+ }
2894
+
2895
+ if ( is_object( $entity ) ) {
2896
+ // If a newer object is passed, fall back to default hash url
2897
+ $entity = $entity->id;
2898
+ }
2899
+
2900
  if (is_numeric($entity)) {
2901
  return $link . '#!/' . $type . '/' . $entity;
2902
  } elseif (is_array($entity) && isset($entity['url'])) {
includes/class-ecwid-admin-main-page.php CHANGED
@@ -13,9 +13,6 @@ class Ecwid_Admin_Main_Page
13
  {
14
  if ( $this->_is_forced_reconnect() ) {
15
  ecwid_update_store_id( ecwid_get_demo_store_id() );
16
- if (! ecwid_process_oauth_params() ) {
17
- wp_redirect( 'admin.php?page=' . Ecwid_Admin::ADMIN_SLUG );
18
- }
19
  }
20
 
21
  $is_demo = ecwid_is_demo_store();
13
  {
14
  if ( $this->_is_forced_reconnect() ) {
15
  ecwid_update_store_id( ecwid_get_demo_store_id() );
 
 
 
16
  }
17
 
18
  $is_demo = ecwid_is_demo_store();
includes/class-ecwid-customizer.php CHANGED
@@ -1,9 +1,12 @@
1
  <?php
2
 
3
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-floating-minicart.php';
 
4
 
5
  class Ecwid_Customizer
6
  {
 
 
7
  public function __construct()
8
  {
9
  add_action( 'customize_register', array( $this, 'customize_register' ) );
@@ -21,14 +24,13 @@ class Ecwid_Customizer
21
  public function customize_register( $wp_customize )
22
  {
23
  $panel = 'ec-store';
24
- $section = 'ec-store-minicart';
25
 
26
  $wp_customize->add_panel( $panel, array(
27
  'title' => Ecwid_Config::get_brand(),
28
  'capability' => Ecwid_Admin::get_capability()
29
  ) );
30
 
31
- $wp_customize->add_section( $section, array(
32
  'title' => __( 'Shopping Cart Widget', 'ecwid-shopping-cart' ),
33
  'priority' => 50,
34
  'capability' => Ecwid_Admin::get_capability(),
@@ -42,7 +44,7 @@ class Ecwid_Customizer
42
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_WIDGET_DISPLAY, array(
43
  'type' => 'select',
44
  'label' => __( 'Display shopping cart', 'ecwid-shopping-cart' ),
45
- 'section' => $section,
46
  'description' => __( 'Note: when enabled, the cart widget is always displayed in preview to make it easier to customize it. The "Show on store pages" and "Show when empty" options will apply to the cart widget on site when published', 'ecwid-shopping-cart' ),
47
  'settings' => Ecwid_Floating_Minicart::OPTION_WIDGET_DISPLAY,
48
  'choices' => Ecwid_Floating_Minicart::get_display_options()
@@ -56,7 +58,7 @@ class Ecwid_Customizer
56
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_SHOW_EMPTY_CART, array(
57
  'type' => 'checkbox',
58
  'label' => __( 'Show when empty', 'ecwid-shopping-cart' ),
59
- 'section' => $section,
60
  'settings' => Ecwid_Floating_Minicart::OPTION_SHOW_EMPTY_CART,
61
  ) ) );
62
 
@@ -67,7 +69,7 @@ class Ecwid_Customizer
67
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_LAYOUT, array(
68
  'type' => 'select',
69
  'label' => __( 'Layout', 'ecwid-shopping-cart' ),
70
- 'section' => $section,
71
  'settings' => Ecwid_Floating_Minicart::OPTION_LAYOUT,
72
  'choices' => Ecwid_Floating_Minicart::get_layouts()
73
  ) ) );
@@ -80,12 +82,11 @@ class Ecwid_Customizer
80
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_FIXED_SHAPE, array(
81
  'type' => 'select',
82
  'label' => __( 'Border', 'ecwid-shopping-cart' ),
83
- 'section' => $section,
84
  'settings' => Ecwid_Floating_Minicart::OPTION_FIXED_SHAPE,
85
  'choices' => Ecwid_Floating_Minicart::get_fixed_shapes()
86
  ) ) );
87
-
88
-
89
  $wp_customize->add_setting( Ecwid_Floating_Minicart::OPTION_ICON, array(
90
  'type' => 'option',
91
  'transport' => 'postMessage'
@@ -93,7 +94,7 @@ class Ecwid_Customizer
93
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_ICON, array(
94
  'type' => 'select',
95
  'label' => __( 'Icon', 'ecwid-shopping-cart' ),
96
- 'section' => $section,
97
  'settings' => Ecwid_Floating_Minicart::OPTION_ICON,
98
  'choices' => Ecwid_Floating_Minicart::get_icons()
99
  ) ) );
@@ -106,7 +107,7 @@ class Ecwid_Customizer
106
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_FIXED_POSITION, array(
107
  'type' => 'select',
108
  'label' => __( 'Position', 'ecwid-shopping-cart' ),
109
- 'section' => $section,
110
  'settings' => Ecwid_Floating_Minicart::OPTION_FIXED_POSITION,
111
  'choices' => Ecwid_Floating_Minicart::get_fixed_positions()
112
  ) ) );
@@ -119,7 +120,7 @@ class Ecwid_Customizer
119
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_HORIZONTAL_INDENT, array(
120
  'type' => 'number',
121
  'label' => __( 'Horizontal indent', 'ecwid-shopping-cart' ),
122
- 'section' => $section,
123
  'settings' => Ecwid_Floating_Minicart::OPTION_HORIZONTAL_INDENT,
124
  ) ) );
125
 
@@ -130,7 +131,7 @@ class Ecwid_Customizer
130
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_VERTICAL_INDENT, array(
131
  'type' => 'number',
132
  'label' => __( 'Vertical indent', 'ecwid-shopping-cart' ),
133
- 'section' => $section,
134
  'settings' => Ecwid_Floating_Minicart::OPTION_VERTICAL_INDENT,
135
  ) ) );
136
  }
1
  <?php
2
 
3
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-floating-minicart.php';
4
+ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-customizer.php';
5
 
6
  class Ecwid_Customizer
7
  {
8
+ const SECTION_MINICART = 'ec-store-minicart';
9
+
10
  public function __construct()
11
  {
12
  add_action( 'customize_register', array( $this, 'customize_register' ) );
24
  public function customize_register( $wp_customize )
25
  {
26
  $panel = 'ec-store';
 
27
 
28
  $wp_customize->add_panel( $panel, array(
29
  'title' => Ecwid_Config::get_brand(),
30
  'capability' => Ecwid_Admin::get_capability()
31
  ) );
32
 
33
+ $wp_customize->add_section( self::SECTION_MINICART, array(
34
  'title' => __( 'Shopping Cart Widget', 'ecwid-shopping-cart' ),
35
  'priority' => 50,
36
  'capability' => Ecwid_Admin::get_capability(),
44
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_WIDGET_DISPLAY, array(
45
  'type' => 'select',
46
  'label' => __( 'Display shopping cart', 'ecwid-shopping-cart' ),
47
+ 'section' => self::SECTION_MINICART,
48
  'description' => __( 'Note: when enabled, the cart widget is always displayed in preview to make it easier to customize it. The "Show on store pages" and "Show when empty" options will apply to the cart widget on site when published', 'ecwid-shopping-cart' ),
49
  'settings' => Ecwid_Floating_Minicart::OPTION_WIDGET_DISPLAY,
50
  'choices' => Ecwid_Floating_Minicart::get_display_options()
58
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_SHOW_EMPTY_CART, array(
59
  'type' => 'checkbox',
60
  'label' => __( 'Show when empty', 'ecwid-shopping-cart' ),
61
+ 'section' => self::SECTION_MINICART,
62
  'settings' => Ecwid_Floating_Minicart::OPTION_SHOW_EMPTY_CART,
63
  ) ) );
64
 
69
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_LAYOUT, array(
70
  'type' => 'select',
71
  'label' => __( 'Layout', 'ecwid-shopping-cart' ),
72
+ 'section' => self::SECTION_MINICART,
73
  'settings' => Ecwid_Floating_Minicart::OPTION_LAYOUT,
74
  'choices' => Ecwid_Floating_Minicart::get_layouts()
75
  ) ) );
82
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_FIXED_SHAPE, array(
83
  'type' => 'select',
84
  'label' => __( 'Border', 'ecwid-shopping-cart' ),
85
+ 'section' => self::SECTION_MINICART,
86
  'settings' => Ecwid_Floating_Minicart::OPTION_FIXED_SHAPE,
87
  'choices' => Ecwid_Floating_Minicart::get_fixed_shapes()
88
  ) ) );
89
+
 
90
  $wp_customize->add_setting( Ecwid_Floating_Minicart::OPTION_ICON, array(
91
  'type' => 'option',
92
  'transport' => 'postMessage'
94
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_ICON, array(
95
  'type' => 'select',
96
  'label' => __( 'Icon', 'ecwid-shopping-cart' ),
97
+ 'section' => self::SECTION_MINICART,
98
  'settings' => Ecwid_Floating_Minicart::OPTION_ICON,
99
  'choices' => Ecwid_Floating_Minicart::get_icons()
100
  ) ) );
107
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_FIXED_POSITION, array(
108
  'type' => 'select',
109
  'label' => __( 'Position', 'ecwid-shopping-cart' ),
110
+ 'section' => self::SECTION_MINICART,
111
  'settings' => Ecwid_Floating_Minicart::OPTION_FIXED_POSITION,
112
  'choices' => Ecwid_Floating_Minicart::get_fixed_positions()
113
  ) ) );
120
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_HORIZONTAL_INDENT, array(
121
  'type' => 'number',
122
  'label' => __( 'Horizontal indent', 'ecwid-shopping-cart' ),
123
+ 'section' => self::SECTION_MINICART,
124
  'settings' => Ecwid_Floating_Minicart::OPTION_HORIZONTAL_INDENT,
125
  ) ) );
126
 
131
  $wp_customize->add_control( new WP_Customize_Control( $wp_customize, Ecwid_Floating_Minicart::OPTION_VERTICAL_INDENT, array(
132
  'type' => 'number',
133
  'label' => __( 'Vertical indent', 'ecwid-shopping-cart' ),
134
+ 'section' => self::SECTION_MINICART,
135
  'settings' => Ecwid_Floating_Minicart::OPTION_VERTICAL_INDENT,
136
  ) ) );
137
  }
includes/class-ecwid-oauth.php CHANGED
@@ -132,6 +132,7 @@ class Ecwid_OAuth {
132
  update_option( 'ecwid_public_token', $result->public_token );
133
  update_option( self::OPTION_JUST_CONNECTED, true );
134
  EcwidPlatform::cache_reset( 'all_categories' );
 
135
  Ecwid_Api_V3::reset_api_status();
136
 
137
  $this->api->save_token($result->access_token);
@@ -294,7 +295,9 @@ class Ecwid_OAuth {
294
  }
295
 
296
  protected function _save_state() {
297
- setcookie('ecwid_oauth_state', json_encode($this->state), strtotime('+1 day'), ADMIN_COOKIE_PATH, COOKIE_DOMAIN);
 
 
298
  }
299
 
300
  public function get_reconnect_error() {
132
  update_option( 'ecwid_public_token', $result->public_token );
133
  update_option( self::OPTION_JUST_CONNECTED, true );
134
  EcwidPlatform::cache_reset( 'all_categories' );
135
+ ecwid_invalidate_cache( true );
136
  Ecwid_Api_V3::reset_api_status();
137
 
138
  $this->api->save_token($result->access_token);
295
  }
296
 
297
  protected function _save_state() {
298
+ if ( !headers_sent( ) ) {
299
+ setcookie('ecwid_oauth_state', json_encode($this->state), strtotime('+1 day'), ADMIN_COOKIE_PATH, COOKIE_DOMAIN);
300
+ }
301
  }
302
 
303
  public function get_reconnect_error() {
includes/class-ecwid-popup-deactivate.php CHANGED
@@ -43,6 +43,7 @@ class Ecwid_Popup_Deactivate extends Ecwid_Popup {
43
 
44
  $body_lines[] = 'Store URL: ' . Ecwid_Store_Page::get_store_url();
45
  $body_lines[] = 'Plugin installed: ' . strftime( '%d %b %Y', get_option( 'ecwid_installation_date' ) );
 
46
  $body_lines[] = 'Reason:' . $reason['text'] . "\n" . ( !empty( $_GET['message'] ) ? $_GET['message'] : '[no message]' );
47
 
48
  $api = new Ecwid_Api_V3();
43
 
44
  $body_lines[] = 'Store URL: ' . Ecwid_Store_Page::get_store_url();
45
  $body_lines[] = 'Plugin installed: ' . strftime( '%d %b %Y', get_option( 'ecwid_installation_date' ) );
46
+ $body_lines[] = 'Plugin version: ' . get_option('ecwid_plugin_version');
47
  $body_lines[] = 'Reason:' . $reason['text'] . "\n" . ( !empty( $_GET['message'] ) ? $_GET['message'] : '[no message]' );
48
 
49
  $api = new Ecwid_Api_V3();
includes/class-ecwid-product-browser.php ADDED
@@ -0,0 +1,448 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecwid_Product_Browser
4
+ {
5
+ public static function get_attributes()
6
+ {
7
+ return array(
8
+ 'product_list_show_product_images' => array(
9
+ 'name' => 'product_list_show_product_images',
10
+ 'title' => __( 'Show product thumbnails', 'ecwid-shopping-cart' ),
11
+ 'type' => 'boolean',
12
+ 'default' => true,
13
+ 'is_storefront_api' => true
14
+ ),
15
+
16
+ 'product_list_image_size' => array(
17
+ 'name' => 'product_list_image_size',
18
+ 'title' => __( 'Product thumbnail size', 'ecwid-shopping-cart' ),
19
+ 'values' => self::_get_sizes(),
20
+ 'default' => 'MEDIUM',
21
+ 'is_storefront_api' => true
22
+ ),
23
+
24
+ 'product_list_image_aspect_ratio' => array(
25
+ 'name' => 'product_list_image_aspect_ratio',
26
+ 'title' => __( 'Product thumbnail aspect ratio', 'ecwid-shopping-cart' ),
27
+ 'values' => self::_get_aspect_ratios(),
28
+ 'default' => 'SQUARE_1',
29
+ 'is_storefront_api' => true
30
+ ),
31
+
32
+ 'product_list_show_frame' => array(
33
+ 'name' => 'product_list_show_frame',
34
+ 'title' => __( 'Show product card border', 'ecwid-shopping-cart' ),
35
+ 'type' => 'boolean',
36
+ 'default' => false,
37
+ 'is_storefront_api' => true
38
+ ),
39
+
40
+ 'product_list_product_info_layout' => array(
41
+ 'name' => 'product_list_product_info_layout',
42
+ 'title' => __( 'Product card text align', 'ecwid-shopping-cart' ),
43
+ 'values' => array(
44
+ array(
45
+ 'value' => 'LEFT',
46
+ 'title' => __( 'Left', 'ecwid-shopping-cart' ),
47
+ 'icon' => 'textalignleft',
48
+ ),
49
+ array(
50
+ 'value' => 'CENTER',
51
+ 'title' => __( 'Center', 'ecwid-shopping-cart' ),
52
+ 'icon' => 'textaligncenter'
53
+ ),
54
+ array(
55
+ 'value' => 'RIGHT',
56
+ 'title' => __( 'Right', 'ecwid-shopping-cart' ),
57
+ 'icon' => 'textalignright'
58
+ ),
59
+ array(
60
+ 'value' => 'JUSTIFY',
61
+ 'title' => __( 'Justify', 'ecwid-shopping-cart' ),
62
+ 'icon' => 'textalignjustify'
63
+ )
64
+ ),
65
+ 'default' => 'CENTER',
66
+ 'is_storefront_api' => true
67
+ ),
68
+
69
+ 'product_list_title_behavior' => array(
70
+ 'name' => 'product_list_title_behavior',
71
+ 'title' => __( 'Product title', 'ecwid-shopping-cart' ),
72
+ 'values' => self::_get_behaviors(),
73
+ 'default' => 'SHOW',
74
+ 'is_storefront_api' => true
75
+ ),
76
+
77
+ 'product_list_price_behavior' => array(
78
+ 'name' => 'product_list_price_behavior',
79
+ 'title' => __( 'Product price', 'ecwid-shopping-cart' ),
80
+ 'values' => self::_get_behaviors(),
81
+ 'default' => 'SHOW',
82
+ 'is_storefront_api' => true
83
+ ),
84
+
85
+ 'product_list_sku_behavior' => array(
86
+ 'name' => 'product_list_sku_behavior',
87
+ 'title' => __( 'Product SKU', 'ecwid-shopping-cart' ),
88
+ 'values' => self::_get_behaviors(),
89
+ 'default' => 'HIDE',
90
+ 'is_storefront_api' => true
91
+ ),
92
+
93
+ 'product_list_buybutton_behavior' => array(
94
+ 'name' => 'product_list_buybutton_behavior',
95
+ 'title' => __( 'Buy now buttons', 'ecwid-shopping-cart' ),
96
+ 'values' => self::_get_behaviors(),
97
+ 'default' => 'SHOW',
98
+ 'is_storefront_api' => true
99
+ ),
100
+
101
+ 'product_list_show_additional_image_on_hover' => array(
102
+ 'name' => 'product_list_show_additional_image_on_hover',
103
+ 'title' => __( 'Show additional image on hover', 'ecwid-shopping-cart' ),
104
+ 'type' => 'boolean',
105
+ 'default' => false,
106
+ 'is_storefront_api' => true
107
+ ),
108
+
109
+ 'product_list_category_title_behavior' => array(
110
+ 'name' => 'product_list_category_title_behavior',
111
+ 'title' => __( 'Category card layout', 'ecwid-shopping-cart' ),
112
+ 'values' => array(
113
+ array(
114
+ 'value' => 'SHOW_BELOW_IMAGE',
115
+ 'title' => __( 'Title under image', 'ecwid-shopping-cart' )
116
+ ),
117
+ array(
118
+ 'value' => 'SHOW_ON_IMAGE',
119
+ 'title' => __( 'Title on image', 'ecwid-shopping-cart' )
120
+ ),
121
+ array(
122
+ 'value' => 'SHOW_ON_HOVER',
123
+ 'title' => __( 'Image and title on mouse over', 'ecwid-shopping-cart' )
124
+ ),
125
+ array(
126
+ 'value' => 'SHOW_TEXT_ONLY',
127
+ 'title' => __( 'Title only', 'ecwid-shopping-cart' )
128
+ ),
129
+ array(
130
+ 'value' => 'HIDE',
131
+ 'title' => __( 'Image only', 'ecwid-shopping-cart' )
132
+ )
133
+ ),
134
+ 'default' => 'SHOW_ON_HOVER',
135
+ 'is_storefront_api' => true
136
+ ),
137
+
138
+ 'product_list_category_image_size' => array(
139
+ 'name' => 'product_list_category_image_size',
140
+ 'title' => __( 'Category thumbnail size', 'ecwid-shopping-cart' ),
141
+ 'values' => self::_get_sizes(),
142
+ 'default' => 'MEDIUM',
143
+ 'is_storefront_api' => true
144
+ ),
145
+
146
+ 'product_list_category_image_aspect_ratio' => array(
147
+ 'name' => 'product_list_category_image_aspect_ratio',
148
+ 'title' => __( 'Category thumbnail aspect ratio', 'ecwid-shopping-cart' ),
149
+ 'values' => self::_get_aspect_ratios(),
150
+ 'default' => 'SQUARE_1',
151
+ 'is_storefront_api' => true
152
+ ),
153
+
154
+ 'show_categories' => array(
155
+ 'name' => 'show_categories',
156
+ 'title' => __( 'Display categories menu', 'ecwid-shopping-cart' ),
157
+ 'type' => 'boolean',
158
+ 'default' => false
159
+ ),
160
+
161
+ 'show_search' => array(
162
+ 'name' => 'show_search',
163
+ 'title' => __( 'Display search box', 'ecwid-shopping-cart' ),
164
+ 'type' => 'boolean',
165
+ 'default' => false
166
+ ),
167
+
168
+ 'show_breadcrumbs' => array(
169
+ 'name' => 'show_breadcrumbs',
170
+ 'title' => __( 'Display breadcrumbs', 'ecwid-shopping-cart' ),
171
+ 'type' => 'boolean',
172
+ 'default' => true,
173
+ 'is_storefront_api' => true
174
+ ),
175
+
176
+ 'show_footer_menu' => array(
177
+ 'name' => 'show_footer_menu',
178
+ 'title' => __( 'Display footer menu', 'ecwid-shopping-cart' ),
179
+ 'type' => 'boolean',
180
+ 'default' => true,
181
+ 'is_storefront_api' => true
182
+ ),
183
+
184
+ 'show_signin_link' => array(
185
+ 'name' => 'show_signin_link',
186
+ 'title' => __( 'Display sign in link', 'ecwid-shopping-cart' ),
187
+ 'type' => 'boolean',
188
+ 'default' => true,
189
+ 'is_storefront_api' => true
190
+ ),
191
+
192
+ 'product_list_show_sort_viewas_options' => array(
193
+ 'name' => 'product_list_show_sort_viewas_options',
194
+ 'title' => __( 'Display sort by link', 'ecwid-shopping-cart' ),
195
+ 'type' => 'boolean',
196
+ 'default' => true,
197
+ 'is_storefront_api' => true
198
+ ),
199
+
200
+ 'default_category_id' => array(
201
+ 'name' => 'default_category_id',
202
+ 'title' => __( 'Default category ID', 'ecwid-shopping-cart' ),
203
+ 'type' => 'default_category_id',
204
+ 'default' => ''
205
+ ),
206
+
207
+ 'product_details_layout' => array(
208
+ 'name' => 'product_details_layout',
209
+ 'title' => __( 'Product page layout', 'ecwid-shopping-cart' ),
210
+ 'values' => self::_get_product_details_layouts(),
211
+ 'default' => 'TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT',
212
+ 'is_storefront_api' => true
213
+ ),
214
+
215
+ 'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar' => array(
216
+ 'name' => 'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar',
217
+ 'title' => __( 'Show description under the image', 'ecwid-shopping-cart' ),
218
+ 'type' => 'boolean',
219
+ 'default' => false,
220
+ 'is_storefront_api' => true
221
+ ),
222
+
223
+
224
+ 'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar' => array(
225
+ 'name' => 'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar',
226
+ 'title' => __( 'Show description under the image', 'ecwid-shopping-cart' ),
227
+ 'type' => 'boolean',
228
+ 'default' => false,
229
+ 'is_storefront_api' => true
230
+ ),
231
+
232
+ 'product_details_gallery_layout' => array(
233
+ 'name' => 'product_details_gallery_layout',
234
+ 'title' => __( 'Image gallery layout', 'ecwid-shopping-cart' ),
235
+ 'values' => self::_get_gallery_layouts(),
236
+ 'default' => 'IMAGE_SINGLE_THUMBNAILS_HORIZONTAL',
237
+ 'is_storefront_api' => true
238
+ ),
239
+
240
+ 'product_details_show_product_name' => array(
241
+ 'name' => 'product_details_show_product_name',
242
+ 'title' => __( 'Title', 'ecwid-shopping-cart' ),
243
+ 'type' => 'boolean',
244
+ 'default' => true,
245
+ 'is_storefront_api' => true
246
+ ),
247
+
248
+ 'product_details_show_breadcrumbs' => array(
249
+ 'name' => 'product_details_show_breadcrumbs',
250
+ 'title' => __( 'Breadcrumbs', 'ecwid-shopping-cart' ),
251
+ 'type' => 'boolean',
252
+ 'default' => true,
253
+ 'is_storefront_api' => true
254
+ ),
255
+ 'product_details_show_product_sku' => array(
256
+ 'name' => 'product_details_show_product_sku',
257
+ 'title' => _x( 'Product SKU', 'product-browser-attributes', 'ecwid-shopping-cart' ),
258
+ 'type' => 'boolean',
259
+ 'default' => true,
260
+ 'is_storefront_api' => true
261
+ ),
262
+ 'product_details_show_product_price' => array(
263
+ 'name' => 'product_details_show_product_price',
264
+ 'title' => _x( 'Product price', 'product-browser-attributes', 'ecwid-shopping-cart' ),
265
+ 'type' => 'boolean',
266
+ 'default' => true,
267
+ 'is_storefront_api' => true
268
+ ),
269
+ 'product_details_show_qty' => array(
270
+ 'name' => 'product_details_show_qty',
271
+ 'title' => __( 'Product quantity', 'ecwid-shopping-cart' ),
272
+ 'type' => 'boolean',
273
+ 'default' => true,
274
+ 'is_storefront_api' => true
275
+ ),
276
+ 'product_details_show_number_of_items_in_stock' => array(
277
+ 'name' => 'product_details_show_number_of_items_in_stock',
278
+ 'title' => __( 'Available qty in stock', 'ecwid-shopping-cart' ),
279
+ 'type' => 'boolean',
280
+ 'default' => true,
281
+ 'is_storefront_api' => true
282
+ ),
283
+ 'product_details_show_in_stock_label' => array(
284
+ 'name' => 'product_details_show_in_stock_label',
285
+ 'title' => __( '"In stock" label', 'ecwid-shopping-cart' ),
286
+ 'type' => 'boolean',
287
+ 'default' => true,
288
+ 'is_storefront_api' => true
289
+ ),
290
+ 'product_details_show_wholesale_prices' => array(
291
+ 'name' => 'product_details_show_wholesale_prices',
292
+ 'title' => __( 'Wholesale prices', 'ecwid-shopping-cart' ),
293
+ 'type' => 'boolean',
294
+ 'default' => true,
295
+ 'is_storefront_api' => true
296
+ ),
297
+ 'product_details_show_share_buttons' => array(
298
+ 'name' => 'product_details_show_share_buttons',
299
+ 'title' => __( 'Display sign in link', 'ecwid-shopping-cart' ),
300
+ 'type' => 'boolean',
301
+ 'default' => true,
302
+ 'is_storefront_api' => true
303
+ ),
304
+
305
+ 'chameleon_color_button' => array(
306
+ 'name' => 'chameleon_color_button',
307
+ 'title' => __( 'Button color', 'ecwid-shopping-cart' ),
308
+ 'default' => get_option( 'ecwid_chameleon_colors_button' )
309
+ ),
310
+
311
+ 'chameleon_color_foreground' => array(
312
+ 'name' => 'chameleon_color_foreground',
313
+ 'title' => __( 'Text color', 'ecwid-shopping-cart' ),
314
+ 'default' => get_option( 'ecwid_chameleon_colors_foreground' )
315
+ ),
316
+
317
+ 'chameleon_color_price' => array(
318
+ 'name' => 'chameleon_color_price',
319
+ 'title' => __( 'Price color', 'ecwid-shopping-cart' ),
320
+ 'default' => get_option( 'ecwid_chameleon_colors_price' )
321
+ ),
322
+
323
+ 'chameleon_color_link' => array(
324
+ 'name' => 'chameleon_color_link',
325
+ 'title' => __( 'Link color', 'ecwid-shopping-cart' ),
326
+ 'default' => get_option( 'ecwid_chameleon_colors_link' )
327
+ ),
328
+
329
+ 'chameleon_color_background' => array(
330
+ 'name' => 'chameleon_color_background',
331
+ 'title' => __( 'Background color', 'ecwid-shopping-cart' ),
332
+ 'default' => get_option( 'ecwid_chameleon_colors_background' )
333
+ ),
334
+
335
+ );
336
+
337
+ }
338
+
339
+ protected static function _get_behaviors()
340
+ {
341
+ return array(
342
+ array(
343
+ 'value' => 'SHOW',
344
+ 'title' => __( 'Show', 'ecwid-shopping-cart' )
345
+ ),
346
+ array(
347
+ 'value' => 'HIDE',
348
+ 'title' => __( 'Hide', 'ecwid-shopping-cart' )
349
+ ),
350
+ array(
351
+ 'value' => 'SHOW_ON_HOVER',
352
+ 'title' => __( 'Show on hover', 'ecwid-shopping-cart' ),
353
+ )
354
+ );
355
+ }
356
+
357
+ protected static function _get_sizes()
358
+ {
359
+ return array(
360
+ array(
361
+ 'value' => 'SMALL',
362
+ 'title' => __( 'S', 'ecwid-shopping-cart' )
363
+ ),
364
+ array(
365
+ 'value' => 'MEDIUM',
366
+ 'title' => __( 'M', 'ecwid-shopping-cart' )
367
+ ),
368
+ array(
369
+ 'value' => 'LARGE',
370
+ 'title' => __( 'L', 'ecwid-shopping-cart' )
371
+ )
372
+ );
373
+ }
374
+
375
+ protected static function _get_aspect_ratios()
376
+ {
377
+ return array(
378
+ array(
379
+ 'value' => 'PORTRAIT_0667',
380
+ 'title' => __( 'Portrait 2:3', 'ecwid-shopping-cart' ),
381
+ 'icon' => 'aspect916',
382
+ ),
383
+ array(
384
+ 'value' => 'PORTRAIT_075',
385
+ 'title' => __( 'Portrait 3:4', 'ecwid-shopping-cart' ),
386
+ 'icon' => 'aspect34',
387
+ ),
388
+ array(
389
+ 'value' => 'SQUARE_1',
390
+ 'title' => __( 'Square 1:1', 'ecwid-shopping-cart' ),
391
+ 'icon' => 'aspect11'
392
+ ),
393
+ array(
394
+ 'value' => 'LANDSCAPE_1333',
395
+ 'title' => __( 'Landscape 4:3', 'ecwid-shopping-cart' ),
396
+ 'icon' => 'aspect43'
397
+ ),
398
+ array(
399
+ 'value' => 'LANDSCAPE_15',
400
+ 'title' => __( 'Landscape 3:2', 'ecwid-shopping-cart' ),
401
+ 'icon' => 'aspect169'
402
+ )
403
+ );
404
+ }
405
+
406
+ protected static function _get_product_details_layouts()
407
+ {
408
+ return array(
409
+ array(
410
+ 'value' => 'TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT',
411
+ 'title' => __( '2 columns, image on the left', 'ecwid-shopping-cart' )
412
+ ),
413
+ array(
414
+ 'value' => 'TWO_COLUMNS_SIDEBAR_ON_THE_LEFT',
415
+ 'title' => __( '2 columns, image on the right', 'ecwid-shopping-cart' )
416
+ ),
417
+ array(
418
+ 'value' => 'THREE_COLUMNS_SIDEBAR_ON_THE_RIGHT',
419
+ 'title' => __( '3 columns, image on the left', 'ecwid-shopping-cart' )
420
+ ),
421
+ array(
422
+ 'value' => 'THREE_COLUMNS_SIDEBAR_ON_THE_LEFT',
423
+ 'title' => __( '3 columns, image on the right', 'ecwid-shopping-cart' )
424
+ ),
425
+ );
426
+ }
427
+
428
+ protected static function _get_gallery_layouts()
429
+ {
430
+ return array(
431
+ array(
432
+ 'value' => 'IMAGE_SINGLE_THUMBNAILS_HORIZONTAL',
433
+ 'title' => __( 'Horizontal thumbnails', 'ecwid-shopping-cart' ),
434
+ 'icon' => 'galleryLayoutVertical',
435
+ ),
436
+ array(
437
+ 'value' => 'IMAGE_SINGLE_THUMBNAILS_VERTICAL',
438
+ 'title' => __( 'Vertical thumbnails', 'ecwid-shopping-cart' ),
439
+ 'icon' => 'galleryLayoutHorizontal'
440
+ ),
441
+ array(
442
+ 'value' => 'IMAGE_FEED',
443
+ 'title' => __( 'Image feed', 'ecwid-shopping-cart' ),
444
+ 'icon' => 'galleryLayoutFeed'
445
+ )
446
+ );
447
+ }
448
+ }
includes/class-ecwid-seo-links.php CHANGED
@@ -210,6 +210,10 @@ class Ecwid_Seo_Links {
210
  }
211
  }
212
 
 
 
 
 
213
  $url = esc_js( get_permalink( $page_id ) );
214
 
215
  $result = <<<JS
@@ -222,6 +226,42 @@ JS;
222
  return $config;
223
  }
224
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  public static function maybe_extract_html_catalog_params() {
226
 
227
  $current_url = add_query_arg( null, null );
@@ -268,7 +308,7 @@ JS;
268
  foreach ( $links as $link ) {
269
  foreach ( $patterns as $pattern ) {
270
  $link = trim( $link, '/' );
271
- add_rewrite_rule( '^' . $link . '/' . $pattern . '.*', 'index.php?' . $param_name . '=' . $page_id, 'top' );
272
  }
273
  }
274
  }
210
  }
211
  }
212
 
213
+ if ( self::is_404_seo_link() ) {
214
+ return $config;
215
+ }
216
+
217
  $url = esc_js( get_permalink( $page_id ) );
218
 
219
  $result = <<<JS
226
  return $config;
227
  }
228
 
229
+ public static function is_404_seo_link() {
230
+
231
+ if ( ! self::is_product_browser_url() ) {
232
+ return false;
233
+ }
234
+
235
+ $params = self::maybe_extract_html_catalog_params();
236
+ if ( !$params ) return false;
237
+
238
+ // Root is always ok
239
+ $is_root_cat = $params['mode'] == 'category' && $params['id'] == 0;
240
+ if ( $is_root_cat ) {
241
+ return false;
242
+ }
243
+
244
+ $result = false;
245
+
246
+ if ($params['mode'] == 'product') {
247
+ $result = Ecwid_Product::get_by_id( $params['id'] );
248
+ } elseif (!$is_root_cat && $params['mode'] == 'category') {
249
+ $result = Ecwid_Category::get_by_id( $params['id'] );
250
+ }
251
+
252
+ // Can't parse params, assume its ok
253
+ if ( !$result ) {
254
+ return false;
255
+ }
256
+
257
+ // product/category not found, 404
258
+ if ( is_object ( $result ) && ( !isset( $result->id ) || !$result->enabled ) ) {
259
+ return true;
260
+ }
261
+
262
+ return false;
263
+ }
264
+
265
  public static function maybe_extract_html_catalog_params() {
266
 
267
  $current_url = add_query_arg( null, null );
308
  foreach ( $links as $link ) {
309
  foreach ( $patterns as $pattern ) {
310
  $link = trim( $link, '/' );
311
+ add_rewrite_rule( '^' . preg_quote( $link ) . '/' . $pattern . '.*', 'index.php?' . $param_name . '=' . $page_id, 'top' );
312
  }
313
  }
314
  }
includes/integrations/class-ecwid-integration-gutenberg.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  class Ecwid_Integration_Gutenberg {
4
 
5
  const STORE_BLOCK = 'ecwid/store-block';
@@ -11,30 +13,9 @@ class Ecwid_Integration_Gutenberg {
11
 
12
  add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
13
  add_action( 'admin_enqueue_scripts', function() {
14
- EcwidPlatform::enqueue_script( 'store-editor-gutenberg' );
15
  EcwidPlatform::enqueue_style( 'store-popup' );
16
 
17
- wp_localize_script( 'ecwid-store-editor-gutenberg', 'EcwidGutenbergParams',
18
- array(
19
- 'ecwid_pb_defaults' => ecwid_get_default_pb_size(),
20
- 'storeImageUrl' => site_url('?file=ecwid_store_svg.svg'),
21
- 'storeBlockTitle' => sprintf( __( '%s store', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ),
22
- 'storeShortcodeName' => Ecwid_Shortcode_Base::get_current_store_shortcode_name(),
23
- 'storeBlock' => self::STORE_BLOCK,
24
- 'productBlockTitle' => sprintf( __( '%s product', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ),
25
- 'productShortcodeName' => Ecwid_Shortcode_Product::get_shortcode_name(),
26
- 'productBlock' => self::PRODUCT_BLOCK,
27
- 'storeId' => get_ecwid_store_id(),
28
- 'chooseProduct' => __( 'Choose product', 'ecwid-shopping-cart' ),
29
- 'editAppearance' => __( 'Edit Appearance', 'ecwid-shopping-cart' ),
30
- 'yourStoreWill' => __( 'Your store will be shown here', 'ecwid-shopping-cart' ),
31
- 'storeIdLabel' => __( 'Store ID', 'ecwid-shopping-cart' ),
32
- 'yourProductLabel' => __( 'Your product', 'ecwid-shopping-cart' ),
33
- 'storeIcon' => $this->_get_store_icon_path(),
34
- 'productIcon' => $this->_get_product_icon_path(),
35
-
36
- )
37
- );
38
 
39
  } );
40
 
@@ -44,8 +25,8 @@ class Ecwid_Integration_Gutenberg {
44
  register_block_type(self::STORE_BLOCK, array(
45
  'editor_script' => 'ecwid-gutenberg-store',
46
  'render_callback' => array( $this, 'render_callback' ),
47
- ));
48
-
49
  register_block_type(self::PRODUCT_BLOCK, array(
50
  'editor_script' => 'ecwid-gutenberg-product',
51
  'render_callback' => array( $this, 'product_render_callback' ),
@@ -61,26 +42,78 @@ class Ecwid_Integration_Gutenberg {
61
  }
62
 
63
  public function enqueue_block_editor_assets() {
64
- EcwidPlatform::enqueue_script( 'gutenberg-store', array( 'wp-blocks', 'wp-i18n', 'wp-element' ) );
65
- EcwidPlatform::enqueue_style( 'gutenberg-store', array( 'wp-edit-blocks' ) );
66
-
67
  if ( Ecwid_Api_V3::is_available() ) {
68
  EcwidPlatform::enqueue_script( 'gutenberg-product', array( 'wp-blocks', 'wp-i18n', 'wp-element' ) );
69
  }
70
 
71
- $storeImageUrl = site_url('?file=ecwid_store_svg.svg');
 
 
 
 
72
 
73
- wp_add_inline_style('ecwid-gutenberg-store', <<<CSS
74
- .editor-block-list__block[data-type="ecwid/store-block"] .editor-block-list__block-edit {
75
- background-image: url("$storeImageUrl")
76
- }
77
- CSS
78
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  }
80
 
81
- public function product_render_callback($params) {
82
 
83
- if (!@$params['id']) return '';
84
 
85
  $display = array(
86
  'picture', 'title', 'price', 'options', 'qty', 'addtobag'
@@ -102,10 +135,78 @@ CSS
102
  }
103
 
104
  public function render_callback( $params ) {
 
105
  if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
106
  return '';
107
  }
108
- return ecwid_shortcode( $params );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  }
110
 
111
  public function add_popup() {
@@ -123,6 +224,53 @@ CSS
123
  return get_option( 'ecwid_plugin_version' );
124
  }
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  protected function _get_store_icon_path()
127
  {
128
  return 'M15.32,15.58c-0.37,0-0.66,0.3-0.66,0.67c0,0.37,0.3,0.67,0.66,0.67c0.37,0,0.67-0.3,0.67-0.67
1
  <?php
2
 
3
+ require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-product-browser.php';
4
+
5
  class Ecwid_Integration_Gutenberg {
6
 
7
  const STORE_BLOCK = 'ecwid/store-block';
13
 
14
  add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
15
  add_action( 'admin_enqueue_scripts', function() {
16
+ wp_enqueue_script( 'gutenberg-store' );
17
  EcwidPlatform::enqueue_style( 'store-popup' );
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  } );
21
 
25
  register_block_type(self::STORE_BLOCK, array(
26
  'editor_script' => 'ecwid-gutenberg-store',
27
  'render_callback' => array( $this, 'render_callback' ),
28
+ ));
29
+
30
  register_block_type(self::PRODUCT_BLOCK, array(
31
  'editor_script' => 'ecwid-gutenberg-product',
32
  'render_callback' => array( $this, 'product_render_callback' ),
42
  }
43
 
44
  public function enqueue_block_editor_assets() {
45
+ wp_enqueue_script( 'gutenberg-store', ECWID_PLUGIN_URL . 'js/gutenberg/blocks.build.js', array( 'wp-blocks', 'wp-i18n', 'wp-element' ) );
46
+ wp_enqueue_style( 'ecwid-gutenberg-block', ECWID_PLUGIN_URL . 'css/gutenberg/blocks.editor.build.css' );
 
47
  if ( Ecwid_Api_V3::is_available() ) {
48
  EcwidPlatform::enqueue_script( 'gutenberg-product', array( 'wp-blocks', 'wp-i18n', 'wp-element' ) );
49
  }
50
 
51
+ wp_add_inline_script(
52
+ 'gutenberg-store',
53
+ 'wp.i18n.setLocaleData( ' . json_encode( gutenberg_get_jed_locale_data( 'ecwid-shopping-cart' ) ) . ', "ecwid-shopping-cart"' . ');',
54
+ 'before'
55
+ );
56
 
57
+ $api = new Ecwid_Api_V3();
58
+ wp_localize_script( 'gutenberg-store', 'EcwidGutenbergStoreBlockParams',
59
+ array(
60
+ 'attributes' => $this->_get_attributes_for_editor(),
61
+ 'is_new_product_list' => $this->_is_new_product_list(),
62
+ 'is_new_details_page' => $this->_is_new_details_page(),
63
+ 'storeBlockTitle' => _x( 'Store', 'gutenberg-store-block-stub', 'ecwid-shopping-cart' )
64
+ )
65
+ );
66
+
67
+ $is_demo_store = ecwid_is_demo_store();
68
+ wp_localize_script( 'gutenberg-store', 'EcwidGutenbergParams',
69
+ array(
70
+ 'ecwid_pb_defaults' => ecwid_get_default_pb_size(),
71
+ 'storeImageUrl' => site_url('?file=ecwid_store_svg.svg'),
72
+ 'storeBlockTitle' => sprintf( __( '%s Store', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ),
73
+ 'storeShortcodeName' => Ecwid_Shortcode_Base::get_current_store_shortcode_name(),
74
+ 'storeBlock' => self::STORE_BLOCK,
75
+ 'productBlockTitle' => sprintf( __( '%s product', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ),
76
+ 'productShortcodeName' => Ecwid_Shortcode_Product::get_shortcode_name(),
77
+ 'productBlock' => self::PRODUCT_BLOCK,
78
+ 'storeId' => get_ecwid_store_id(),
79
+ 'chooseProduct' => __( 'Choose product', 'ecwid-shopping-cart' ),
80
+ 'editAppearance' => __( 'Edit Appearance', 'ecwid-shopping-cart' ),
81
+ 'yourStoreWill' => __( 'Your store will be shown here', 'ecwid-shopping-cart' ),
82
+ 'storeIdLabel' => __( 'Store ID', 'ecwid-shopping-cart' ),
83
+ 'yourProductLabel' => __( 'Your product', 'ecwid-shopping-cart' ),
84
+ 'storeIcon' => $this->_get_store_icon_path(),
85
+ 'productIcon' => $this->_get_product_icon_path(),
86
+ 'isDemoStore' => $is_demo_store,
87
+ 'customizeMinicartText' =>
88
+ sprintf(
89
+ __(
90
+ 'You can enable an extra shopping bag icon widget that will appear on your site pages. Open “<a href="%1$s">Appearance → Customize → %2$s</a>” menu to enable it.',
91
+ 'ecwid-shopping-cart'
92
+ ),
93
+ 'customize.php?autofocus[section]=' . Ecwid_Customizer::SECTION_MINICART . '&return=' . urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) )
94
+ ),
95
+ Ecwid_Config::get_brand()
96
+ )
97
+ )
98
+ );
99
+
100
+ }
101
+
102
+ protected function _is_new_product_list() {
103
+ $api = new Ecwid_Api_V3();
104
+
105
+ return ecwid_is_demo_store() || !Ecwid_Api_V3::is_available() || $api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_PRODUCT_LIST );
106
+ }
107
+
108
+ protected function _is_new_details_page() {
109
+ $api = new Ecwid_Api_V3();
110
+
111
+ return ecwid_is_demo_store() || !Ecwid_Api_V3::is_available() || $api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_DETAILS_PAGE );
112
  }
113
 
114
+ public function product_render_callback( $params ) {
115
 
116
+ if ( !@$params['id'] ) return '';
117
 
118
  $display = array(
119
  'picture', 'title', 'price', 'options', 'qty', 'addtobag'
135
  }
136
 
137
  public function render_callback( $params ) {
138
+
139
  if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
140
  return '';
141
  }
142
+
143
+ $params['widgets'] = 'productbrowser';
144
+ if ( @$params['show_categories'] ) {
145
+ $params['widgets'] .= ' categories';
146
+ }
147
+ if ( @$params['show_search'] ) {
148
+ $params['widgets'] .= ' search';
149
+ }
150
+
151
+ $result = ecwid_shortcode( $params );
152
+ $result .= '<script type="text/javascript">
153
+ window.ec = window.ec || Object();
154
+ window.ec.storefront = window.ec.storefront || Object();
155
+ ';
156
+
157
+ $attributes = $this->_get_attributes_for_editor();
158
+ foreach ( $attributes as $name => $attribute ) {
159
+ if ( @$attribute['is_storefront_api'] && isset( $params[$name] ) ) {
160
+ $value = $params[$name];
161
+ if ( @$attribute['type'] == 'boolean') {
162
+ $result .= 'window.ec.storefront.' . $name . "=" . ( $value ? 'true' : 'false' ) . ";" . PHP_EOL;
163
+ } else {
164
+ $result .= 'window.ec.storefront.' . $name . "='" . $value . "';" . PHP_EOL;
165
+ }
166
+ }
167
+ }
168
+
169
+ $colors = array();
170
+ foreach ( array( 'foreground', 'background', 'link', 'price', 'button' ) as $kind ) {
171
+ $color = @$params['chameleon_color_' . $kind];
172
+ if ( $color ) {
173
+ $colors['color-' . $kind] = $color;
174
+ } else {
175
+ //$colors['color-' . $kind] = 'auto';
176
+ }
177
+ }
178
+
179
+ if ( empty( $colors ) ) {
180
+ $colors = 'auto';
181
+ }
182
+
183
+ $colors = json_encode($colors);
184
+
185
+ $chameleon = apply_filters( 'ecwid_chameleon_settings', array( 'colors' => $colors ) );
186
+
187
+ if ( !is_array($chameleon ) ) {
188
+ $chameleon = array(
189
+ 'colors' => $colors,
190
+ );
191
+ }
192
+
193
+ if ( !isset( $chameleon['colors'] ) ) {
194
+ $chameleon['colors'] = json_encode($colors);
195
+ }
196
+
197
+ if ( $chameleon['colors'] != 'auto' ) {
198
+ $result .= <<<JS
199
+ window.ec.config.chameleon = window.ec.config.chameleon || Object();
200
+ window.ec.config.chameleon.colors = $chameleon[colors];
201
+ JS;
202
+ }
203
+ $result .= "
204
+ Ecwid.OnAPILoaded.add(function() {
205
+ Ecwid.refreshConfig();
206
+ });
207
+ </script>";
208
+
209
+ return $result;
210
  }
211
 
212
  public function add_popup() {
224
  return get_option( 'ecwid_plugin_version' );
225
  }
226
 
227
+ protected function _get_attributes_for_editor()
228
+ {
229
+ $api = new Ecwid_Api_V3();
230
+
231
+ if ( $api->is_available() && $api->get_store_profile() ) {
232
+ $settings = $api->get_store_profile()->designSettings;
233
+ } else {
234
+ $settings = new stdClass();
235
+ }
236
+
237
+ $attributes = Ecwid_Product_Browser::get_attributes();
238
+ foreach ( $attributes as $key => $attribute ) {
239
+ $name = $attribute['name'];
240
+ if ( property_exists( $settings, $name ) ) {
241
+ $attributes[$key]['default'] = $settings->$name;
242
+ }
243
+ }
244
+
245
+ $categories = ecwid_get_categories_for_selector();
246
+
247
+ if ( $categories ) {
248
+ $attributes['default_category_id']['values'] = array(
249
+ array(
250
+ 'value' => '',
251
+ 'title' => __( 'Store root category', 'ecwid-shopping-cart' )
252
+ )
253
+ );
254
+ foreach ( $categories as $category ) {
255
+ $attributes['default_category_id']['values'][] = array(
256
+ 'value' => $category->id,
257
+ 'title' => $category->name
258
+ );
259
+ }
260
+ } else {
261
+ $api = new Ecwid_Api_V3();
262
+ $cats = $api->get_categories( array() );
263
+
264
+ if ( $cats && $cats->total == 0 ) {
265
+ unset( $attributes['default_category_id'] );
266
+ }
267
+ }
268
+
269
+ $attributes['widgets'] = array( 'type' => 'string', 'default' => '' );
270
+
271
+ return $attributes;
272
+ }
273
+
274
  protected function _get_store_icon_path()
275
  {
276
  return 'M15.32,15.58c-0.37,0-0.66,0.3-0.66,0.67c0,0.37,0.3,0.67,0.66,0.67c0.37,0,0.67-0.3,0.67-0.67
includes/themes/class-ecwid-theme-responsive.php CHANGED
@@ -20,7 +20,7 @@ class Ecwid_Theme_Responsive extends Ecwid_Theme_Base
20
  add_filter( 'ecwid_search_shortcode_content', array( $this, 'search_shortcode_content' ) );
21
  }
22
 
23
- 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');
24
  wp_enqueue_style( 'dashicons' );
25
  wp_enqueue_style( 'ecwid-theme-fixes' , ECWID_PLUGIN_URL . 'css/themes/responsive.css', array(), get_option('ecwid_plugin_version'), 'all' );
26
 
20
  add_filter( 'ecwid_search_shortcode_content', array( $this, 'search_shortcode_content' ) );
21
  }
22
 
23
+ wp_enqueue_style( 'ecwid-open-sans' , 'https://fonts.googleapis.com/css?family=Open+Sans:400,700&subset=latin,cyrillic-ext,cyrillic,greek-ext,vietnamese,greek,latin-ext');
24
  wp_enqueue_style( 'dashicons' );
25
  wp_enqueue_style( 'ecwid-theme-fixes' , ECWID_PLUGIN_URL . 'css/themes/responsive.css', array(), get_option('ecwid_plugin_version'), 'all' );
26
 
js/gutenberg/blocks.build.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){function t(n){if(l[n])return l[n].exports;var r=l[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var l={};t.m=e,t.c=l,t.d=function(e,l,n){t.o(e,l)||Object.defineProperty(e,l,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var l=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(l,"a",l),l},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});l(1),l(5)},function(e,t,l){"use strict";function n(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}var r=l(2),o=(l.n(r),l(3)),a=(l.n(o),l(4)),i=wp.i18n,c=i.__,s=(i._x,a.a,wp.blocks),m=(s.BlockControls,s.registerBlockType),p=wp.editor,u=(p.RichText,p.InspectorControls),d=(p.AlignmentToolbar,p.withColors,wp.components),w=d.PanelBody,h=d.PanelRow,g=d.ToggleControl,_=d.ButtonGroup,f=d.Button,E=(d.IconButton,d.BaseControl),v=d.Toolbar,y=(d.Dropdown,d.ColorPalette),b=d.ColorIndicator,x=wp.compose.withState;wp.element.Fragment;m("ecwid/store-block",{title:EcwidGutenbergParams.storeBlockTitle,icon:wp.element.createElement("svg",{className:"dashicon",viewBox:"0 0 20 20",width:"20",height:"20"},wp.element.createElement("path",{d:EcwidGutenbergParams.storeIcon})),category:"common",attributes:EcwidGutenbergStoreBlockParams.attributes,description:c("Add storefront (product listing)","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e,t,l){return wp.element.createElement(g,{label:l,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})}function l(e,t,l,r){return wp.element.createElement(E,{label:l},wp.element.createElement(v,{controls:r.map(function(l){return{icon:a.a[l.icon],title:l.title,isActive:e.attributes[t]===l.value,className:"ecwid-toolbar-icon",onClick:function(){return e.setAttributes(n({},t,l.value))}}})}))}function r(e,t,l,r){return wp.element.createElement(E,{label:l},wp.element.createElement("select",{onChange:function(l){e.setAttributes(n({},t,l.target.value))}},r.map(function(l){return wp.element.createElement("option",{value:l.value,selected:e.attributes[t]==l.value},l.title)})))}function o(e,t,l){return wp.element.createElement(E,{label:l},wp.element.createElement("input",{type:"text",value:e.attributes[t],onChange:function(l){e.setAttributes(n({},t,l.target.value))}}))}function i(e,t,l,r){return wp.element.createElement(E,{label:l},wp.element.createElement(_,null,r.map(function(l){return wp.element.createElement(f,{isDefault:!0,isButton:!0,isPrimary:C[t]==l.value,onClick:function(){return e.setAttributes(n({},t,l.value))}},l.title)})))}function s(e,t,l){var r=wp.element.createElement("span",null,l,wp.element.createElement(b,{colorValue:C[t]}));return wp.element.createElement(E,{label:r,className:"ec-store-color-picker"},wp.element.createElement(y,{value:C[t],colors:P,onChange:function(l){return e.setAttributes(n({},t,l))}}))}function m(e){function t(e){o(function(t){return{manual:"manual",color:e}}),i.setAttributes(n({},a,e))}var l=e.manual,r=e.color,o=e.setState,a=arguments[0].name,i=arguments[0].props,s=EcwidGutenbergStoreBlockParams.attributes[a].title,m=null===l&&null!==i.attributes[a]&&""!==i.attributes[a]||"manual"===l;m?null!==r&&i.setAttributes(n({},a,r)):i.setAttributes(n({},a,null));var p=i.attributes[a],u=wp.element.createElement("span",null,s,null!==p&&wp.element.createElement(b,{colorValue:C[a]}));return wp.element.createElement(E,{label:u,className:"ec-store-color-picker"},wp.element.createElement("select",{onChange:function(e){return o(function(e){return{manual:event.target.value,color:e.color}})}},wp.element.createElement("option",{value:"auto",selected:!m},c("Detect automatically","ecwid-shopping-cart")),wp.element.createElement("option",{value:"manual",selected:m},c("Set manually","ecwid-shopping-cart"))),m&&wp.element.createElement(y,{value:p,colors:P,onChange:t}))}function p(e){var t=e.count,l=e.setState;return wp.element.createElement("div",null,wp.element.createElement("button",{onClick:function(){return l(function(e){return{count:e.count+1}})}},"text ",t," ",arguments[0].color))}function d(e,t){return wp.element.createElement(E,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}function k(e,n,a){var c=EcwidGutenbergStoreBlockParams.attributes[n];return"undefined"===typeof a&&(a=c.type),"default_category_id"===a&&(a=c.values&&c.values.length>1?"select":"textbox"),"buttonGroup"===a?i(e,c.name,c.title,c.values):"toolbar"===a?l(e,c.name,c.title,c.values):"select"===a?r(e,c.name,c.title,c.values):"colorPalette"===a?s(e,c.name,c.title):"text"===a?d(c.title,c.message):"textbox"===a?o(e,c.name,c.title):t(e,c.name,c.title)}var C=e.attributes;e.setAttributes({widgets:""});var B=wp.element.createElement("div",{className:"ec-store-block ec-store-block-product-browser"},wp.element.createElement("div",{className:"ec-store-block-header"},wp.element.createElement("svg",{className:"dashicon",viewBox:"0 0 20 20",width:"20",height:"20"},wp.element.createElement("path",{d:EcwidGutenbergParams.storeIcon})),EcwidGutenbergParams.isDemoStore&&c("Demo store","ecwid-shopping-cart"),!EcwidGutenbergParams.isDemoStore&&EcwidGutenbergStoreBlockParams.storeBlockTitle),EcwidGutenbergParams.isDemoStore&&wp.element.createElement("div",null,wp.element.createElement("a",{className:"button button-primary",href:"admin.php?page=ec-store"},c("Set up your store","ecwid-shopping-cart")))),P=[{name:c("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:c("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:c("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:c("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:c("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:c("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:c("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:c("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:c("Very light gray"),slug:"very-light-gray",color:"#eeeeee"},{name:c("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:c("Very dark gray"),slug:"very-dark-gray",color:"#313131"}],S=x({manual:null,color:null})(m),G=(x({count:0})(p),d("",c('To improve the look and feel of your store and manage your storefront appearance here, please enable the \u201cNext-gen look and feel of the product list on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart"))),N=d(c("Display cart icon","ecwid-shopping-cart"),EcwidGutenbergParams.customizeMinicartText),O=(d("",c('To improve the look and feel of your product page and manage your its appearance here, please enable the \u201cNext-gen look and feel of the product page on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),EcwidGutenbergStoreBlockParams.is_new_product_list),z=EcwidGutenbergStoreBlockParams.is_new_details_page,L=EcwidGutenbergStoreBlockParams.attributes.default_category_id&&EcwidGutenbergStoreBlockParams.attributes.default_category_id.values&&EcwidGutenbergStoreBlockParams.attributes.default_category_id.values.length>0;return[B,wp.element.createElement(u,null,L&&wp.element.createElement(w,{title:c("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},O&&k(e,"product_list_category_title_behavior","select"),O&&"SHOW_TEXT_ONLY"!==C.product_list_category_title_behavior&&k(e,"product_list_category_image_size","buttonGroup"),O&&"SHOW_TEXT_ONLY"!==C.product_list_category_title_behavior&&k(e,"product_list_category_image_aspect_ratio","toolbar"),!O&&G),wp.element.createElement(w,{title:c("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},z&&k(e,"product_details_layout","select"),z&&"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===C.product_details_layout&&k(e,"product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar","toogle"),z&&"TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===C.product_details_layout&&k(e,"product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar","toogle"),z&&k(e,"product_details_gallery_layout","toolbar"),z&&wp.element.createElement(h,null,wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Product sidebar content","ecwid-shopping-cart"))),z&&k(e,"product_details_show_product_name","toggle"),z&&k(e,"product_details_show_breadcrumbs","toggle"),z&&k(e,"product_details_show_product_sku","toggle"),z&&k(e,"product_details_show_product_price","toggle"),z&&k(e,"product_details_show_qty","toggle"),z&&k(e,"product_details_show_number_of_items_in_stock","toggle"),z&&k(e,"product_details_show_in_stock_label","toggle"),z&&k(e,"product_details_show_wholesale_prices","toggle"),z&&k(e,"product_details_show_share_buttons","toggle"),!z&&G),wp.element.createElement(w,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},O&&k(e,"product_list_show_product_images","toggle"),O&&C.product_list_show_product_images&&k(e,"product_list_image_size","buttonGroup"),O&&C.product_list_show_product_images&&k(e,"product_list_image_aspect_ratio","toolbar"),O&&k(e,"product_list_product_info_layout","toolbar"),O&&k(e,"product_list_title_behavior","select"),O&&k(e,"product_list_price_behavior","select"),O&&k(e,"product_list_sku_behavior","select"),O&&k(e,"product_list_buybutton_behavior","select"),O&&k(e,"product_list_show_additional_image_on_hover","toggle"),O&&k(e,"product_list_show_frame","toggle"),!O&&G),wp.element.createElement(w,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},k(e,"show_categories","toggle"),k(e,"show_search","toggle"),k(e,"show_breadcrumbs","toggle"),O&&k(e,"show_footer_menu","toggle"),k(e,"show_signin_link","toggle"),k(e,"product_list_show_sort_viewas_options","toggle"),N),L&&wp.element.createElement(w,{title:c("Store Front Page","ecwid-shopping-cart"),initialOpen:!1},k(e,"default_category_id","default_category_id")),wp.element.createElement(w,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},wp.element.createElement(S,{props:e,name:"chameleon_color_button"}),wp.element.createElement(S,{props:e,name:"chameleon_color_foreground"}),wp.element.createElement(S,{props:e,name:"chameleon_color_price"}),wp.element.createElement(S,{props:e,name:"chameleon_color_link"}),wp.element.createElement(S,{props:e,name:"chameleon_color_background"})))]},save:function(e){var t=["productbrowser"];e.attributes.show_categories&&(t[t.length]="categories"),e.attributes.show_search&&(t[t.length]="search");var l={widgets:t.join(" "),default_category_id:e.attributes.default_category_id};return new wp.shortcode({tag:EcwidGutenbergParams.storeShortcodeName,attrs:l,type:"single"}).string()},deprecated:[{attributes:{widgets:{type:"string"},categories_per_row:{type:"integer"},grid:{type:"string"},list:{type:"integer"},table:{type:"integer"},default_category_id:{type:"integer"},default_product_id:{type:"integer"},category_view:{type:"string"},search_view:{type:"string"},minicart_layout:{type:"string"}},save:function(e){return null}},{attributes:{widgets:{type:"string",default:"productbrowser"},default_category_id:{type:"integer",default:0}},migrate:function(e){return{widgets:e.widgets,default_category_id:e.default_category_id}},save:function(e){for(var t={},l=["widgets","default_category_id"],n=0;n<l.length;n++)t[l[n]]=e.attributes[l[n]];return t.default_product_id=0,new wp.shortcode({tag:EcwidGutenbergParams.storeShortcodeName,attrs:t,type:"single"}).string()}},{save:function(e){return"[ecwid]"}}],transforms:{from:[{type:"shortcode",tag:["ecwid","ec_store"],attributes:{default_category_id:{type:"integer",shortcode:function(e){return e.default_category_id}},show_categories:{type:"boolean",shortcode:function(e){return-1!==e.named.widgets.indexOf("categories")}},show_search:{type:"boolean",shortcode:function(e){return-1!==e.named.widgets.indexOf("search")}}},priority:10}]}})},function(e,t){},function(e,t){},function(e,t,l){"use strict";l.d(t,"a",function(){return n});var n={store:wp.element.createElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 20 20","enable-background":"new 0 0 20 20"},wp.element.createElement("path",{fill:"#555d66",d:"M15.32,15.58c-0.37,0-0.66,0.3-0.66,0.67c0,0.37,0.3,0.67,0.66,0.67c0.37,0,0.67-0.3,0.67-0.67 C15.98,15.88,15.69,15.58,15.32,15.58z M15.45,0H4.55C2.04,0,0,2.04,0,4.55v10.91C0,17.97,2.04,20,4.55,20h10.91c2.51,0,4.55-2.04,4.55-4.55V4.55 C20,2.04,17.96,0,15.45,0z M12.97,4.94C13.54,4.94,14,5.4,14,5.96s-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03 C11.95,5.4,12.41,4.94,12.97,4.94z M12.97,8.02c0.57,0,1.03,0.46,1.03,1.03c0,0.57-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03 C11.95,8.48,12.41,8.02,12.97,8.02z M9.98,4.94c0.57,0,1.03,0.46,1.03,1.03s-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03 C8.95,5.4,9.41,4.94,9.98,4.94z M9.98,8.02c0.57,0,1.03,0.46,1.03,1.03s-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03 C8.95,8.48,9.41,8.02,9.98,8.02z M7.03,4.94c0.57,0,1.03,0.46,1.03,1.03S7.6,6.99,7.03,6.99C6.46,6.99,6,6.53,6,5.96 C6,5.4,6.46,4.94,7.03,4.94z M7.03,8.02c0.57,0,1.03,0.46,1.03,1.03s-0.46,1.03-1.03,1.03C6.46,10.08,6,9.62,6,9.05 C6,8.48,6.46,8.02,7.03,8.02z M4.6,18.02c-1.02,0-1.86-0.83-1.86-1.86c0-1.03,0.83-1.86,1.86-1.86c1.03,0,1.86,0.83,1.86,1.86 C6.45,17.19,5.62,18.02,4.6,18.02z M15.32,18.1c-1.02,0-1.86-0.83-1.86-1.86c0-1.03,0.83-1.86,1.86-1.86c1.03,0,1.86,0.83,1.86,1.86 C17.17,17.27,16.34,18.1,15.32,18.1z M18.48,2.79l-1.92,7.14c-0.51,1.91-2.03,3.1-4,3.1H7.2c-1.91,0-3.26-1.09-3.84-2.91L1.73,5 C1.7,4.9,1.72,4.79,1.78,4.71c0.06-0.09,0.16-0.14,0.27-0.14l0.31,0c0.75,0,1.41,0.49,1.64,1.2l1.2,3.76 c0.32,1.02,1.26,1.7,2.33,1.7h4.81c1.1,0,2.08-0.74,2.36-1.81l1.55-5.78c0.2-0.75,0.89-1.28,1.67-1.28h0.24 c0.1,0,0.2,0.05,0.26,0.13C18.48,2.58,18.5,2.68,18.48,2.79z M4.6,15.5c-0.37,0-0.66,0.3-0.66,0.67c0,0.37,0.3,0.67,0.66,0.67c0.37,0,0.67-0.3,0.67-0.67 S4.96,15.5,4.6,15.5z"})),product:wp.element.createElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 20 20","enable-background":"new 0 0 20 20"},wp.element.createElement("path",{fill:"#231F20",d:"M16.43,5.12c-0.13-1.19-0.15-1.19-1.35-1.33c-0.21-0.02-0.21-0.02-0.43-0.05c-0.01,0.06,0.06,0.78,0.14,1.13 c0.57,0.37,0.87,0.98,0.87,1.71c0,1.14-0.93,2.07-2.07,2.07s-2.07-0.93-2.07-2.07c0-0.54,0.09-0.97,0.55-1.4 c-0.06-0.61-0.19-1.54-0.18-1.64C10.14,3.46,8.72,3.46,8.58,3.6l-8.17,8.13c-0.56,0.55-0.56,1.43,0,1.97l5.54,5.93 c0.56,0.55,1.46,0.55,2.01,0l8.67-8.14C17.04,11.09,16.68,7.14,16.43,5.12z M16.06,0.04c-1.91,0-3.46,1.53-3.46,3.41c0,0.74,0.4,3.09,0.44,3.28c0.07,0.34,0.52,0.56,0.86,0.49 C14,7.19,14.07,7.15,14.12,7.1c0.24-0.11,0.32-0.39,0.25-0.68c-0.09-0.45-0.39-2.44-0.39-2.94c0-1.16,0.94-2.09,2.11-2.09 c1.24,0,2.11,0.96,2.11,2.34c0,2.43-0.31,4.23-0.32,4.26c-0.1,0.17-0.1,0.38-0.03,0.55c0.03,0.17,0.13,0.31,0.28,0.4 c0.1,0.06,0.22,0.09,0.33,0.09c0.21,0,0.42-0.1,0.54-0.3c0.06-0.09,0.52-2.17,0.52-5.03C19.52,1.61,18.04,0.04,16.06,0.04z"})),aspect169:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"9",y:"14",width:"22",height:"12",rx:"2"}))),aspect916:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"}," ",wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"14",y:"9",width:"12",height:"22",rx:"2"}))),aspect11:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"12",y:"12",width:"16",height:"16",rx:"2"}))),aspect34:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"12",y:"10",width:"16",height:"20",rx:"2"}))),aspect43:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"10",y:"12",width:"20",height:"16",rx:"2"}))),textalignleft:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"16",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"19",width:"13",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"22",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textaligncenter:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"16",y:"16",width:"8",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"14",y:"19",width:"12",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"16",y:"22",width:"8",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textalignright:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"16",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"14",y:"19",width:"13",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"22",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textalignjustify:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",zoomAndPan:"1.5",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"16",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"19",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"22",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),productLayout3Columns:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",transform:"translate(13.000000, 19.500000) rotate(-270.000000) translate(-13.000000, -19.500000) ",x:"3.5",y:"16.5",width:"19",height:"6",rx:"1"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"10",width:"5",height:"19"}),wp.element.createElement("rect",{fill:"#000000",x:"25",y:"10",width:"5",height:"8"}),wp.element.createElement("rect",{fill:"#000000",x:"25",y:"19",width:"5",height:"10"}))),productLayout2ColumnsLeft:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"17",y:"10",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{fill:"#000000",x:"10",y:"10",width:"5",height:"5"}),wp.element.createElement("rect",{fill:"#000000",x:"10",y:"17",width:"5",height:"12"}))),productLayout2ColumnsRight:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(10.000000, 10.000000)",fill:"#000000"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"12"})))),productLayout2ColumnsBottom:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(10.000000, 10.000000)",fill:"#000000"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"12",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"12"}),wp.element.createElement("rect",{x:"0",y:"14",width:"20",height:"5"})))),galleryLayoutVertical:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(20.000000, 20.500000) rotate(-180.000000) translate(-20.000000, -20.500000) translate(10.000000, 11.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"6"}),wp.element.createElement("rect",{x:"15",y:"14",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"6"})))),galleryLayoutHorizontal:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(19.500000, 20.000000) rotate(-270.000000) translate(-19.500000, -20.000000) translate(9.500000, 10.500000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"-1.13686838e-13",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"-1.13686838e-13",width:"5",height:"6"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"13",width:"5",height:"6"})))),galleryLayoutFeed:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(20.500000, 12.500000) rotate(-270.000000) translate(-20.500000, -12.500000) translate(14.000000, 3.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"})),wp.element.createElement("g",{transform:"translate(20.500000, 27.500000) rotate(-270.000000) translate(-20.500000, -27.500000) translate(14.000000, 18.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"}))))}},function(e,t,l){"use strict";var n=l(6),r=(l.n(n),l(7)),o=(l.n(r),wp.i18n.__);(0,wp.blocks.registerBlockType)("cgb/block-my-block2",{title:o("my-block - CGB Block"),icon:"shield",category:"common",keywords:[o("my-block \u2014 CGB Block"),o("CGB Example"),o("create-guten-block")],edit:function(e){return wp.element.createElement("div",{className:e.className},wp.element.createElement("p",null,"\u2014 Hello from the backend."),wp.element.createElement("p",null,"CGB BLOCK: ",wp.element.createElement("code",null,"my-block")," is a new Gutenberg block"),wp.element.createElement("p",null,"It was created via"," ",wp.element.createElement("code",null,wp.element.createElement("a",{href:"https://github.com/ahmadawais/create-guten-block"},"create-guten-block")),"."))},save:function(e){return wp.element.createElement("div",null,wp.element.createElement("p",null,"\u2014 Hello from the frontend."),wp.element.createElement("p",null,"CGB BLOCK: ",wp.element.createElement("code",null,"my-block")," is a new Gutenberg block."),wp.element.createElement("p",null,"It was created via"," ",wp.element.createElement("code",null,wp.element.createElement("a",{href:"https://github.com/ahmadawais/create-guten-block"},"create-guten-block")),"."))}})},function(e,t){},function(e,t){}]);
js/gutenberg/store.jsx ADDED
@@ -0,0 +1,523 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * BLOCK: my-block
3
+ *
4
+ * Registering a basic block with Gutenberg.
5
+ * Simple block, renders and saves the same content without any interactivity.
6
+ */
7
+
8
+ // Import CSS.
9
+ import './style.scss';
10
+ import './editor.scss';
11
+ import {EcwidIcons} from './icons.js';
12
+
13
+ const { __, _x } = wp.i18n; // Import __() from wp.i18n
14
+
15
+ const ecwidIcons = EcwidIcons;
16
+
17
+ const {
18
+ BlockControls,
19
+ registerBlockType,
20
+ } = wp.blocks;
21
+
22
+ const {
23
+ RichText,
24
+ InspectorControls,
25
+ AlignmentToolbar,
26
+ withColors
27
+ } = wp.editor;
28
+
29
+ const {
30
+ PanelBody,
31
+ PanelRow,
32
+ ToggleControl,
33
+ ButtonGroup,
34
+ Button,
35
+ IconButton,
36
+ BaseControl,
37
+ Toolbar,
38
+ Dropdown,
39
+ ColorPalette,
40
+ ColorIndicator
41
+ } = wp.components;
42
+
43
+ const { withState } = wp.compose;
44
+
45
+ const {
46
+ Fragment
47
+ } = wp.element;
48
+ /**
49
+ * Register: aa Gutenberg Block.
50
+ *
51
+ * Registers a new block provided a unique name and an object defining its
52
+ * behavior. Once registered, the block is made editor as an option to any
53
+ * editor interface where blocks are implemented.
54
+ *
55
+ * @link https://wordpress.org/gutenberg/handbook/block-api/
56
+ * @param {string} name Block name.
57
+ * @param {Object} settings Block settings.
58
+ * @return {?WPBlock} The block, if it has been successfully
59
+ * registered; otherwise `undefined`.
60
+ */
61
+ registerBlockType( 'ecwid/store-block', {
62
+ title: EcwidGutenbergParams.storeBlockTitle, // Block title.
63
+ icon: (
64
+ <svg className="dashicon" viewBox="0 0 20 20" width="20" height="20">
65
+ <path d={ EcwidGutenbergParams.storeIcon }></path>
66
+ </svg>
67
+ ),
68
+ category: 'common', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
69
+ attributes: EcwidGutenbergStoreBlockParams.attributes,
70
+ description: __( 'Add storefront (product listing)', 'ecwid-shopping-cart' ),
71
+ supports: {
72
+ customClassName: false,
73
+ className: false,
74
+ html: false,
75
+ multiple: false
76
+ },
77
+
78
+ /**
79
+ * The edit function describes the structure of your block in the context of the editor.
80
+ * This represents what the editor will render when the block is used.
81
+ *
82
+ * The "edit" property must be a valid function.
83
+ *
84
+ * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
85
+ */
86
+ edit: function( props ) {
87
+
88
+ const { attributes } = props;
89
+
90
+ // legacy reset
91
+ props.setAttributes({widgets:''});
92
+
93
+ const editor =
94
+ <div className="ec-store-block ec-store-block-product-browser">
95
+ <div className="ec-store-block-header">
96
+ <svg className="dashicon" viewBox="0 0 20 20" width="20" height="20">
97
+ <path d={ EcwidGutenbergParams.storeIcon }></path>
98
+ </svg>
99
+ { EcwidGutenbergParams.isDemoStore && __( 'Demo store', 'ecwid-shopping-cart' ) }
100
+ { !EcwidGutenbergParams.isDemoStore && EcwidGutenbergStoreBlockParams.storeBlockTitle }
101
+ </div>
102
+ { EcwidGutenbergParams.isDemoStore &&
103
+ <div>
104
+ <a className="button button-primary" href="admin.php?page=ec-store">{ __( 'Set up your store', 'ecwid-shopping-cart') }</a>
105
+ </div>
106
+ }
107
+ </div>
108
+ ;
109
+
110
+ function buildToggle(props, name, label) {
111
+ return <ToggleControl
112
+ label={ label }
113
+ checked={ props.attributes[name] }
114
+ onChange={ () => props.setAttributes( { [name]: ! props.attributes[name] } ) }
115
+ />
116
+ }
117
+
118
+ function buildToolbar(props, name, label, items) {
119
+ return <BaseControl label={label}>
120
+ <Toolbar
121
+ controls={ items.map( function(item) {
122
+ return {
123
+ icon: EcwidIcons[item.icon],
124
+ title: item.title,
125
+ isActive: props.attributes[name] === item.value,
126
+ className: 'ecwid-toolbar-icon',
127
+ onClick: () =>
128
+ props.setAttributes( { [name]: item.value } )
129
+ }
130
+ } ) }
131
+ />
132
+ </BaseControl>;
133
+ }
134
+
135
+ function buildSelect(props, name, label, items) {
136
+ return <BaseControl label={ label }>
137
+ <select onChange={ (event) => { props.setAttributes( { [name]:event.target.value } ) } }>
138
+ { items.map( function(item) {
139
+ return <option value={item.value} selected={ props.attributes[name] == item.value }>{item.title}</option>
140
+ })}
141
+ </select>
142
+ </BaseControl>;
143
+ }
144
+
145
+ function buildTextbox(props, name, label) {
146
+ return <BaseControl label={ label }>
147
+ <input type="text" value={props.attributes[name]} onChange={ (event) => { props.setAttributes( { [name]:event.target.value } ) } } />
148
+ </BaseControl>;
149
+ }
150
+
151
+ function buildButtonGroup(props, name, label, items) {
152
+ return <BaseControl label={label}>
153
+ <ButtonGroup>
154
+ { items.map( function(item) {
155
+ return <Button isDefault isButton
156
+ isPrimary={ attributes[name] == item.value }
157
+ onClick={ () => props.setAttributes( { [name]: item.value } ) }>
158
+ { item.title }
159
+ </Button>
160
+ } ) }
161
+ </ButtonGroup>
162
+ </BaseControl>;
163
+ }
164
+
165
+ const colors = [{
166
+ name: __("Pale pink"),
167
+ slug: "pale-pink",
168
+ color: "#f78da7"
169
+ }, {
170
+ name: __("Vivid red"),
171
+ slug: "vivid-red",
172
+ color: "#cf2e2e"
173
+ }, {
174
+ name: __("Luminous vivid orange"),
175
+ slug: "luminous-vivid-orange",
176
+ color: "#ff6900"
177
+ }, {
178
+ name: __("Luminous vivid amber"),
179
+ slug: "luminous-vivid-amber",
180
+ color: "#fcb900"
181
+ }, {
182
+ name: __("Light green cyan"),
183
+ slug: "light-green-cyan",
184
+ color: "#7bdcb5"
185
+ }, {
186
+ name: __("Vivid green cyan"),
187
+ slug: "vivid-green-cyan",
188
+ color: "#00d084"
189
+ }, {
190
+ name: __("Pale cyan blue"),
191
+ slug: "pale-cyan-blue",
192
+ color: "#8ed1fc"
193
+ }, {
194
+ name: __("Vivid cyan blue"),
195
+ slug: "vivid-cyan-blue",
196
+ color: "#0693e3"
197
+ }, {
198
+ name: __("Very light gray"),
199
+ slug: "very-light-gray",
200
+ color: "#eeeeee"
201
+ }, {
202
+ name: __("Cyan bluish gray"),
203
+ slug: "cyan-bluish-gray",
204
+ color: "#abb8c3"
205
+ }, {
206
+ name: __("Very dark gray"),
207
+ slug: "very-dark-gray",
208
+ color: "#313131"
209
+ }];
210
+
211
+ function buildColorPalette(props, name, label ) {
212
+
213
+ const titleElement = <span>{ label }
214
+ <ColorIndicator colorValue={ attributes[name]} />
215
+ </span>;
216
+
217
+ return <BaseControl label={titleElement} className="ec-store-color-picker">
218
+ <ColorPalette
219
+ value={ attributes[name] }
220
+ colors={ colors }
221
+ onChange={ (color) => props.setAttributes( { [name]: color } ) }
222
+ />
223
+ </BaseControl>;
224
+ }
225
+
226
+ function getChameleonColorControl( { manual, color, setState } ) {
227
+ const name = arguments[0].name;
228
+ const props = arguments[0].props;
229
+ const titleText = EcwidGutenbergStoreBlockParams.attributes[name].title;
230
+
231
+ const isManual = manual === null && props.attributes[name] !== null && props.attributes[name] !== ""
232
+ || manual === 'manual';
233
+ if ( !isManual ) {
234
+ props.setAttributes( { [name]: null } )
235
+ } else if ( color !== null ) {
236
+ props.setAttributes( { [name]: color } );
237
+ }
238
+
239
+ const currentValue = props.attributes[name];
240
+
241
+ const titleElement = <span >{ titleText }
242
+ { currentValue !== null && <ColorIndicator colorValue={ attributes[name] } /> }
243
+ </span>;
244
+
245
+ function colorPaletteChange( newColor ) {
246
+ setState( (state) => ( { manual: 'manual', color: newColor } ) );
247
+ props.setAttributes( { [name]: newColor } );
248
+ }
249
+
250
+ return <BaseControl label={titleElement} className="ec-store-color-picker">
251
+ <select onChange={ (value) => setState( ( state ) => ( { manual: event.target.value, color: state.color } ) ) }>
252
+ <option value="auto" selected={ !isManual }>{ __( 'Detect automatically', 'ecwid-shopping-cart' ) }</option>
253
+ <option value="manual" selected={ isManual }>{ __( 'Set manually', 'ecwid-shopping-cart' ) }</option>
254
+ </select>
255
+ { isManual &&
256
+ <ColorPalette
257
+ value={ currentValue }
258
+ colors={ colors }
259
+ onChange={ colorPaletteChange }
260
+ >
261
+ </ColorPalette>
262
+ }
263
+ </BaseControl>;
264
+ }
265
+
266
+ const ChameleonColorControl = withState( {manual: null, color: null} ) ( getChameleonColorControl );
267
+
268
+ function simpleState( { count, setState } ) {
269
+ return <div>
270
+ <button onClick={ () => setState( (state) => ( { count: state.count+1 } ) ) }>text {count} {arguments[0].color}</button>
271
+ </div>
272
+ }
273
+
274
+ const Counter = withState( {count:0 } ) (simpleState);
275
+
276
+
277
+ function buildDangerousHTMLMessageWithTitle(title, message) {
278
+ return <BaseControl label={title}><div dangerouslySetInnerHTML={{ __html: message }} /></BaseControl>;
279
+ }
280
+
281
+ function buildItem(props, name, type) {
282
+
283
+ const item = EcwidGutenbergStoreBlockParams.attributes[name];
284
+
285
+ if ( typeof type === 'undefined' ) {
286
+ type = item.type;
287
+ }
288
+
289
+ if ( type === 'default_category_id' ) {
290
+ if ( item.values && item.values.length > 1 ) {
291
+ type = 'select';
292
+ } else {
293
+ type = 'textbox';
294
+ }
295
+ }
296
+
297
+ if ( type === 'buttonGroup' ) {
298
+ return buildButtonGroup( props, item.name, item.title, item.values );
299
+ } else if ( type === 'toolbar' ) {
300
+ return buildToolbar( props, item.name, item.title, item.values );
301
+ } else if ( type === 'select' ) {
302
+ return buildSelect( props, item.name, item.title, item.values );
303
+ } else if ( type === 'colorPalette' ) {
304
+ return buildColorPalette( props, item.name, item.title );
305
+ } else if ( type === 'text' ) {
306
+ return buildDangerousHTMLMessageWithTitle( item.title, item.message );
307
+ } else if ( type === 'textbox') {
308
+ return buildTextbox( props, item.name, item.title );
309
+ } else {
310
+ return buildToggle( props, item.name, item.title );
311
+ }
312
+ }
313
+
314
+ const productMigrationWarning = buildDangerousHTMLMessageWithTitle(
315
+ '',
316
+ __( 'To improve the look and feel of your store and manage your storefront appearance here, please enable the “Next-gen look and feel of the product list on the storefront” option in your store dashboard (“<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings → What’s New</a>”).', 'ecwid-shopping-cart' )
317
+ );
318
+
319
+ const cartIconMessage = buildDangerousHTMLMessageWithTitle(
320
+ __( 'Display cart icon', 'ecwid-shopping-cart' ),
321
+ EcwidGutenbergParams.customizeMinicartText
322
+ );
323
+
324
+ const productDetailsMigrationWarning = buildDangerousHTMLMessageWithTitle(
325
+ '',
326
+ __( 'To improve the look and feel of your product page and manage your its appearance here, please enable the “Next-gen look and feel of the product page on the storefront” option in your store dashboard (“<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings → What’s New</a>”).', 'ecwid-shopping-cart' )
327
+ );
328
+
329
+ const isNewProductList = EcwidGutenbergStoreBlockParams.is_new_product_list;
330
+ const isNewDetailsPage = EcwidGutenbergStoreBlockParams.is_new_details_page;
331
+
332
+ const hasCategories = EcwidGutenbergStoreBlockParams.attributes.default_category_id && EcwidGutenbergStoreBlockParams.attributes.default_category_id.values && EcwidGutenbergStoreBlockParams.attributes.default_category_id.values.length > 0;
333
+
334
+ return ([
335
+ editor,
336
+ <InspectorControls>
337
+ { hasCategories &&
338
+
339
+ <PanelBody title={ __('Category List Appearance', 'ecwid-shopping-cart') } initialOpen={false}>
340
+ { isNewProductList && buildItem(props, 'product_list_category_title_behavior', 'select') }
341
+ { isNewProductList && attributes.product_list_category_title_behavior !== 'SHOW_TEXT_ONLY' &&
342
+ buildItem(props, 'product_list_category_image_size', 'buttonGroup') }
343
+ { isNewProductList && attributes.product_list_category_title_behavior !== 'SHOW_TEXT_ONLY' &&
344
+ buildItem(props, 'product_list_category_image_aspect_ratio', 'toolbar') }
345
+ { !isNewProductList && productMigrationWarning }
346
+ </PanelBody>
347
+
348
+ }
349
+
350
+ <PanelBody title={ __( 'Product Page Appearance', 'ecwid-shopping-cart' ) } initialOpen={false}>
351
+
352
+ { isNewDetailsPage && buildItem( props, 'product_details_layout', 'select' ) }
353
+ { isNewDetailsPage && attributes.product_details_layout === 'TWO_COLUMNS_SIDEBAR_ON_THE_LEFT'
354
+ && buildItem( props, 'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar', 'toogle' )
355
+ }
356
+ { isNewDetailsPage && attributes.product_details_layout === 'TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT'
357
+ && buildItem( props, 'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar', 'toogle' )
358
+ }
359
+ { isNewDetailsPage && buildItem( props, 'product_details_gallery_layout', 'toolbar' ) }
360
+ { isNewDetailsPage &&
361
+ <PanelRow>
362
+ <label className="ec-store-inspector-subheader">{ __( 'Product sidebar content', 'ecwid-shopping-cart' ) }</label>
363
+ </PanelRow>
364
+ }
365
+ { isNewDetailsPage && buildItem( props, 'product_details_show_product_name', 'toggle' ) }
366
+ { isNewDetailsPage && buildItem( props, 'product_details_show_breadcrumbs', 'toggle' ) }
367
+ { isNewDetailsPage && buildItem( props, 'product_details_show_product_sku', 'toggle' ) }
368
+ { isNewDetailsPage && buildItem( props, 'product_details_show_product_price', 'toggle' ) }
369
+ { isNewDetailsPage && buildItem( props, 'product_details_show_qty', 'toggle' ) }
370
+ { isNewDetailsPage && buildItem( props, 'product_details_show_number_of_items_in_stock', 'toggle' ) }
371
+ { isNewDetailsPage && buildItem( props, 'product_details_show_in_stock_label', 'toggle' ) }
372
+ { isNewDetailsPage && buildItem( props, 'product_details_show_wholesale_prices', 'toggle' ) }
373
+ { isNewDetailsPage && buildItem( props, 'product_details_show_share_buttons', 'toggle' ) }
374
+ { !isNewDetailsPage && productMigrationWarning }
375
+ </PanelBody>
376
+ <PanelBody title={ __( 'Product List Appearance', 'ecwid-shopping-cart' ) } initialOpen={false}>
377
+ { isNewProductList && buildItem( props, 'product_list_show_product_images', 'toggle' ) }
378
+ { isNewProductList && attributes.product_list_show_product_images &&
379
+ buildItem( props, 'product_list_image_size', 'buttonGroup' ) }
380
+ { isNewProductList && attributes.product_list_show_product_images &&
381
+ buildItem( props, 'product_list_image_aspect_ratio', 'toolbar' ) }
382
+ { isNewProductList && buildItem( props, 'product_list_product_info_layout', 'toolbar' ) }
383
+ { isNewProductList && buildItem( props, 'product_list_title_behavior', 'select' ) }
384
+ { isNewProductList && buildItem( props, 'product_list_price_behavior', 'select' ) }
385
+ { isNewProductList && buildItem( props, 'product_list_sku_behavior', 'select' ) }
386
+ { isNewProductList && buildItem( props, 'product_list_buybutton_behavior', 'select' ) }
387
+ { isNewProductList && buildItem( props, 'product_list_show_additional_image_on_hover', 'toggle' ) }
388
+ { isNewProductList && buildItem( props, 'product_list_show_frame', 'toggle' ) }
389
+ { !isNewProductList && productMigrationWarning }
390
+ </PanelBody>
391
+ <PanelBody title={ __( 'Store Navigation', 'ecwid-shopping-cart' ) } initialOpen={false}>
392
+ { buildItem( props, 'show_categories', 'toggle' ) }
393
+ { buildItem( props, 'show_search', 'toggle' ) }
394
+ { buildItem( props, 'show_breadcrumbs', 'toggle' ) }
395
+ { isNewProductList && buildItem( props, 'show_footer_menu', 'toggle' ) }
396
+ { buildItem( props, 'show_signin_link', 'toggle' ) }
397
+ { buildItem( props, 'product_list_show_sort_viewas_options', 'toggle' ) }
398
+ { cartIconMessage }
399
+ </PanelBody>
400
+ { hasCategories &&
401
+
402
+ <PanelBody title={ __('Store Front Page', 'ecwid-shopping-cart') } initialOpen={false}>
403
+ { buildItem(props, 'default_category_id', 'default_category_id') }
404
+ </PanelBody>
405
+
406
+ }
407
+ <PanelBody title={ __( 'Color settings', 'ecwid-shopping-cart' ) } initialOpen={false}>
408
+ <ChameleonColorControl props={props} name="chameleon_color_button" />
409
+ <ChameleonColorControl props={props} name="chameleon_color_foreground" />
410
+ <ChameleonColorControl props={props} name="chameleon_color_price" />
411
+ <ChameleonColorControl props={props} name="chameleon_color_link" />
412
+ <ChameleonColorControl props={props} name="chameleon_color_background" />
413
+ </PanelBody>
414
+ </InspectorControls>
415
+ ]);
416
+ },
417
+
418
+ save: function( props ) {
419
+
420
+ var widgets = ['productbrowser'];
421
+ if ( props.attributes.show_categories ) {
422
+ widgets[widgets.length] = 'categories';
423
+ }
424
+ if ( props.attributes.show_search ) {
425
+ widgets[widgets.length] = 'search';
426
+ }
427
+ const shortcodeAttributes = {
428
+ 'widgets': widgets.join(' '),
429
+ 'default_category_id': props.attributes.default_category_id};
430
+
431
+ const shortcode = new wp.shortcode({
432
+ 'tag': EcwidGutenbergParams.storeShortcodeName,
433
+ 'attrs': shortcodeAttributes,
434
+ 'type': 'single'
435
+ });
436
+
437
+ return shortcode.string();
438
+ },
439
+
440
+ deprecated: [
441
+ {
442
+ attributes: {
443
+ widgets: { type: 'string' },
444
+ categories_per_row: { type: 'integer' },
445
+ grid: { type: 'string' },
446
+ list: { type: 'integer' },
447
+ table: { type: 'integer' },
448
+ default_category_id: { type: 'integer' },
449
+ default_product_id: { type: 'integer' },
450
+ category_view: { type: 'string' },
451
+ search_view: { type: 'string' },
452
+ minicart_layout: {type: 'string' }
453
+ },
454
+
455
+ save: function( props ) {
456
+ return null;
457
+ },
458
+ }, {
459
+ attributes: {
460
+ widgets: { type: 'string', default: 'productbrowser' },
461
+ default_category_id: { type: 'integer', default: 0 }
462
+ },
463
+
464
+ migrate: function ( attributes ) {
465
+ return {
466
+ 'widgets': attributes.widgets,
467
+ 'default_category_id': attributes.default_category_id
468
+ }
469
+ },
470
+
471
+ save: function( props ) {
472
+ var shortcodeAttributes = {};
473
+ const attrs = ['widgets', 'default_category_id'];
474
+ for ( var i = 0; i < attrs.length; i++ ) {
475
+ shortcodeAttributes[attrs[i]] = props.attributes[attrs[i]];
476
+ }
477
+ shortcodeAttributes.default_product_id = 0;
478
+
479
+ var shortcode = new wp.shortcode({
480
+ 'tag': EcwidGutenbergParams.storeShortcodeName,
481
+ 'attrs': shortcodeAttributes,
482
+ 'type': 'single'
483
+ });
484
+
485
+ return shortcode.string();
486
+ },
487
+ },
488
+ {
489
+ save: function( props ) {
490
+ return '[ecwid]';
491
+ },
492
+ },
493
+ ],
494
+
495
+ transforms: {
496
+ from: [{
497
+ type: 'shortcode',
498
+ tag: ['ecwid', 'ec_store'],
499
+ attributes: {
500
+ default_category_id: {
501
+ type: 'integer',
502
+ shortcode: function(named) {
503
+ return named.default_category_id
504
+ }
505
+ },
506
+ show_categories: {
507
+ type: 'boolean',
508
+ shortcode: function(attributes) {
509
+ return attributes.named.widgets.indexOf('categories') !== -1
510
+ }
511
+ },
512
+ show_search: {
513
+ type: 'boolean',
514
+ shortcode: function(attributes) {
515
+ return attributes.named.widgets.indexOf('search') !== -1
516
+ }
517
+ },
518
+ },
519
+ priority: 10
520
+ }]
521
+ },
522
+
523
+ } );
js/importer.js CHANGED
@@ -71,7 +71,6 @@ jQuery(document).ready(function() {
71
  'url': ajaxurl,
72
  'data': {'action': ecwid_importer.do_woo_import_action, settings: settings},
73
  'success': function (json) {
74
- debugger;
75
  data = jQuery.parseJSON(json);
76
 
77
  for (var i = 0; i < data.success.length; i++) {
71
  'url': ajaxurl,
72
  'data': {'action': ecwid_importer.do_woo_import_action, settings: settings},
73
  'success': function (json) {
 
74
  data = jQuery.parseJSON(json);
75
 
76
  for (var i = 0; i < data.success.length; i++) {
js/post-product.js CHANGED
@@ -1,5 +1,4 @@
1
  Ecwid.OnPageLoad.add(function(page) {
2
- debugger;
3
  if ( page.type != 'PRODUCT' || page.productId != ecwidPost.productId ) {
4
  location.href = ecwidPost.storePageUrl + location.hash;
5
  }
1
  Ecwid.OnPageLoad.add(function(page) {
 
2
  if ( page.type != 'PRODUCT' || page.productId != ecwidPost.productId ) {
3
  location.href = ecwidPost.storePageUrl + location.hash;
4
  }
js/product-popup.js CHANGED
@@ -84,11 +84,8 @@ jQuery(document).ready(function() {
84
  var populateWidgetParams = function() {
85
 
86
  var params;
87
- debugger;
88
  if (popup().data('params') && popup().data('params').props.attributes.id) {
89
 
90
- debugger;
91
-
92
  var selectedParams = popup().data('params').props.attributes;
93
  params = {
94
  'display': []
84
  var populateWidgetParams = function() {
85
 
86
  var params;
 
87
  if (popup().data('params') && popup().data('params').props.attributes.id) {
88
 
 
 
89
  var selectedParams = popup().data('params').props.attributes;
90
  params = {
91
  'display': []
js/store-editor-page.js CHANGED
@@ -320,7 +320,13 @@ jQuery(document).ready(function() {
320
 
321
  var result = '<!-- wp:ecwid/store-block ';
322
 
323
- result += JSON.stringify(shortcode.attrs.named);
 
 
 
 
 
 
324
 
325
  result += ' -->';
326
 
320
 
321
  var result = '<!-- wp:ecwid/store-block ';
322
 
323
+ var attributes = {
324
+ default_category_id: shortcode.attrs.named.default_category_id,
325
+ show_categories: shortcode.attrs.named.widgets.indexOf('categories') !== -1,
326
+ show_search: shortcode.attrs.named.widgets.indexOf('search') !== -1
327
+ }
328
+
329
+ result += JSON.stringify(attributes);
330
 
331
  result += ' -->';
332
 
languages/ecwid-shopping-cart-ru_RU.mo CHANGED
Binary file
languages/ecwid-shopping-cart-ru_RU.po CHANGED
@@ -1698,6 +1698,289 @@ msgstr "Главная страница магазина"
1698
  msgid "You have your storefront added to several pages on your site. You can choose the main storefront page here — the store navigation menus and sidebar widgets will open it."
1699
  msgstr "Вы добавили витрину магазина на несколько страниц сайта. С помощью этой настройки вы можете выбрать, какую из страниц считать главной витриной — на неё будут ссылаться пункты меню и сайдбар-виджеты."
1700
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1701
  #. #-#-#-#-# ecwid-shopping-cart.pot (Ecwid Shopping Cart 5.2) #-#-#-#-#
1702
  #. Plugin URI of the plugin/theme
1703
  #. #-#-#-#-# ecwid-shopping-cart.pot (Ecwid Shopping Cart 5.2) #-#-#-#-#
1698
  msgid "You have your storefront added to several pages on your site. You can choose the main storefront page here — the store navigation menus and sidebar widgets will open it."
1699
  msgstr "Вы добавили витрину магазина на несколько страниц сайта. С помощью этой настройки вы можете выбрать, какую из страниц считать главной витриной — на неё будут ссылаться пункты меню и сайдбар-виджеты."
1700
 
1701
+ msgid "Product List Appearance"
1702
+ msgstr "Дизайн списка товаров"
1703
+
1704
+ msgid "%s store"
1705
+ msgstr "Витрина магазина"
1706
+
1707
+ msgid "Add storefront (product listing)"
1708
+ msgstr "Список товаров"
1709
+
1710
+ #: includes/class-ecwid-product-browser.php:10
1711
+ msgid "Show product thumbnails"
1712
+ msgstr "Показывать изображения товаров"
1713
+
1714
+ #: includes/class-ecwid-product-browser.php:18
1715
+ msgid "Product thumbnail size"
1716
+ msgstr "Размер изображения товара"
1717
+
1718
+ #: includes/class-ecwid-product-browser.php:26
1719
+ msgid "Product thumbnail aspect ratio"
1720
+ msgstr "Формат изображения товара"
1721
+
1722
+ #: includes/class-ecwid-product-browser.php:34
1723
+ msgid "Show product card border"
1724
+ msgstr "Показывать рамку карточки товара"
1725
+
1726
+ #: includes/class-ecwid-product-browser.php:42
1727
+ msgid "Product card text align"
1728
+ msgstr "Выравнивание данных товара"
1729
+
1730
+ #: includes/class-ecwid-product-browser.php:46
1731
+ msgid "Left"
1732
+ msgstr "По левому краю"
1733
+
1734
+ #: includes/class-ecwid-product-browser.php:51
1735
+ msgid "Center"
1736
+ msgstr "По центру"
1737
+
1738
+ #: includes/class-ecwid-product-browser.php:56
1739
+ msgid "Right"
1740
+ msgstr "По правому краю"
1741
+
1742
+ #: includes/class-ecwid-product-browser.php:61
1743
+ msgid "Justify"
1744
+ msgstr "По ширине"
1745
+
1746
+ #: includes/class-ecwid-product-browser.php:71
1747
+ msgid "Product title"
1748
+ msgstr "Название товара"
1749
+
1750
+ #: includes/class-ecwid-product-browser.php:79
1751
+ msgid "Product price"
1752
+ msgstr "Цена товара"
1753
+
1754
+ #: includes/class-ecwid-product-browser.php:87
1755
+ msgid "Product SKU"
1756
+ msgstr "Артикул товара"
1757
+
1758
+ #: includes/class-ecwid-product-browser.php:95
1759
+ msgid "Buy now buttons"
1760
+ msgstr "Кнопка “Купить”"
1761
+
1762
+ #: includes/class-ecwid-product-browser.php:103
1763
+ msgid "Show additional image on hover"
1764
+ msgstr "Показывать доп.изображение при наведении мыши"
1765
+
1766
+ #: includes/class-ecwid-product-browser.php:111
1767
+ msgid "Category card layout"
1768
+ msgstr "Формат карточки категории"
1769
+
1770
+ #: includes/class-ecwid-product-browser.php:115
1771
+ msgid "Title under image"
1772
+ msgstr "Название под изображением"
1773
+
1774
+ #: includes/class-ecwid-product-browser.php:119
1775
+ msgid "Title on image"
1776
+ msgstr "Название на изображении"
1777
+
1778
+ #: includes/class-ecwid-product-browser.php:123
1779
+ msgid "Image and title on mouse over"
1780
+ msgstr "Название по наведению мыши"
1781
+
1782
+ #: includes/class-ecwid-product-browser.php:127
1783
+ msgid "Title only"
1784
+ msgstr "Только название"
1785
+
1786
+ #: includes/class-ecwid-product-browser.php:131
1787
+ msgid "Image only"
1788
+ msgstr "Только изображение"
1789
+
1790
+ #: includes/class-ecwid-product-browser.php:140
1791
+ msgid "Category thumbnail size"
1792
+ msgstr "Размер изображения категории"
1793
+
1794
+ #: includes/class-ecwid-product-browser.php:148
1795
+ msgid "Category thumbnail aspect ratio"
1796
+ msgstr "Формат изображения категории"
1797
+
1798
+ #: includes/class-ecwid-product-browser.php:156
1799
+ msgid "Display categories menu"
1800
+ msgstr "Показывать меню категорий над витриной"
1801
+
1802
+ #: includes/class-ecwid-product-browser.php:163
1803
+ msgid "Display search box"
1804
+ msgstr "Показывать поиск над витриной"
1805
+
1806
+ #: includes/class-ecwid-product-browser.php:170
1807
+ msgid "Display breadcrumbs"
1808
+ msgstr "Показывать цепочку навигации"
1809
+
1810
+ #: includes/class-ecwid-product-browser.php:178
1811
+ msgid "Display footer menu"
1812
+ msgstr "Показывать меню внизу страницы"
1813
+
1814
+ #: includes/class-ecwid-product-browser.php:186
1815
+ msgid "Display sign in link"
1816
+ msgstr "Показывать ссылку “Войти”"
1817
+
1818
+ #: includes/class-ecwid-product-browser.php:194
1819
+ msgid "Display sort by link"
1820
+ msgstr "Показывать меню сортировки"
1821
+
1822
+ #: includes/class-ecwid-product-browser.php:202
1823
+ msgid "Default category ID"
1824
+ msgstr "Категория, показываемая по умолчанию"
1825
+
1826
+ #: includes/class-ecwid-product-browser.php:214
1827
+ msgid "Show"
1828
+ msgstr "Показывать"
1829
+
1830
+ #: includes/class-ecwid-product-browser.php:218
1831
+ msgid "Hide"
1832
+ msgstr "Скрывать"
1833
+
1834
+ #: includes/class-ecwid-product-browser.php:222
1835
+ msgid "Show on hover"
1836
+ msgstr "Показывать при наведении мыши"
1837
+
1838
+ #: includes/class-ecwid-product-browser.php:232
1839
+ msgid "S"
1840
+ msgstr "S"
1841
+
1842
+ #: includes/class-ecwid-product-browser.php:236
1843
+ msgid "M"
1844
+ msgstr "M"
1845
+
1846
+ #: includes/class-ecwid-product-browser.php:240
1847
+ msgid "L"
1848
+ msgstr "L"
1849
+
1850
+ #: includes/class-ecwid-product-browser.php:250
1851
+ msgid "Portrait 2:3"
1852
+ msgstr "Вертикальные 2:3"
1853
+
1854
+ #: includes/class-ecwid-product-browser.php:255
1855
+ msgid "Portrait 3:4"
1856
+ msgstr "Вертикальные 3:4"
1857
+
1858
+ #: includes/class-ecwid-product-browser.php:260
1859
+ msgid "Square 1:1"
1860
+ msgstr "Квадратные 1:1"
1861
+
1862
+ #: includes/class-ecwid-product-browser.php:265
1863
+ msgid "Landscape 4:3"
1864
+ msgstr "Горизонтальные 4:3"
1865
+
1866
+ #: includes/class-ecwid-product-browser.php:270
1867
+ msgid "Landscape 3:2"
1868
+ msgstr "Горизонтальные 3:2"
1869
+
1870
+ msgid "Migration warning"
1871
+ msgstr ""
1872
+
1873
+ msgid "To improve the look and feel of your store and manage your storefront appearance here, please enable the “Next-gen look and feel of the product list on the storefront” option in your store dashboard (“<a href=\"admin.php?page=ec-store&ec-store-page=whatsnew\">Settings → What’s New</a>”)."
1874
+ msgstr "Чтобы обновить дизайн своего магазина и управлять настройками вида в редакторе, включите опцию “Обновленный внешний вид каталога товаров на витрине” в панели управления магазина (“<a href=\"admin.php?page=ec-store&ec-store-page=whatsnew\">Настройки → Обновления</a>”)"
1875
+
1876
+ msgid "Display cart icon"
1877
+ msgstr "Показывать иконку корзины"
1878
+
1879
+ msgid "You can enable an extra shopping bag icon widget that will appear on your site pages. Open “<a href=\"%1$s\">Appearance → Customize → %2$s</a>” menu to enable it."
1880
+ msgstr "Включите дополнительный плавающий виджет корзины, который будет появляться на страницах сайта. Доступно в меню “<a href=\"%1$s\">Внешний вид → Настроить → %2$s</a>”"
1881
+
1882
+ msgid "Category List Appearance"
1883
+ msgstr "Дизайн списка категорий"
1884
+
1885
+ msgid "Store Navigation"
1886
+ msgstr "Навигация магазина"
1887
+
1888
+ msgid "Store Front Page"
1889
+ msgstr "Главная страница магазина"
1890
+
1891
+ msgid "Product Page Appearance"
1892
+ msgstr "Дизайн страницы товара"
1893
+
1894
+ msgid "Product page layout"
1895
+ msgstr "Формат карточки товара"
1896
+
1897
+ msgid "2 columns, image on the right"
1898
+ msgstr "2 колонки, изображение справа"
1899
+
1900
+ msgid "2 columns, image on the left"
1901
+ msgstr "2 колонки, изображение слева"
1902
+
1903
+ msgid "3 columns, image on the right"
1904
+ msgstr "3 колонки, изображение справа"
1905
+
1906
+ msgid "3 columns, image on the left"
1907
+ msgstr "3 колонки, изображение слева"
1908
+
1909
+ msgid "Show description under the image"
1910
+ msgstr "Показывать описание под изображением"
1911
+
1912
+ msgid "Image gallery layout"
1913
+ msgstr "Формат галереи"
1914
+
1915
+ msgid "Horizontal thumbnails"
1916
+ msgstr "Горизонтально"
1917
+
1918
+ msgid "Vertical thumbnails"
1919
+ msgstr "Вертикально"
1920
+
1921
+ msgid "Image feed"
1922
+ msgstr "Полноразмерные изображения"
1923
+
1924
+ msgid "Product sidebar content"
1925
+ msgstr "Информация на странице"
1926
+
1927
+ msgid "Breadcrumbs"
1928
+ msgstr "Цепочка навигации"
1929
+
1930
+ msgctxt "product-browser-attributes"
1931
+ msgid "Product SKU"
1932
+ msgstr "Артикул"
1933
+
1934
+ msgctxt "product-browser-attributes"
1935
+ msgid "Product price"
1936
+ msgstr "Цена"
1937
+
1938
+ msgid "Product quantity"
1939
+ msgstr "Поле \"Количество\""
1940
+
1941
+ msgid "Available qty in stock"
1942
+ msgstr "Количество в наличии"
1943
+
1944
+ msgid "\"In stock\" label"
1945
+ msgstr "Метка \"В наличии\""
1946
+
1947
+ msgid "Wholesale prices"
1948
+ msgstr "Оптовые цены"
1949
+
1950
+ msgid "Share buttons"
1951
+ msgstr "Кнопки \"Поделиться\""
1952
+
1953
+ msgid "Text color"
1954
+ msgstr "Цвет текста"
1955
+
1956
+ msgid "Button color"
1957
+ msgstr "Цвет кнопок"
1958
+
1959
+ msgid "Price color"
1960
+ msgstr "Цвет цены"
1961
+
1962
+ msgid "Link color"
1963
+ msgstr "Цвет ссылок"
1964
+
1965
+ msgid "Background color"
1966
+ msgstr "Цвет фона"
1967
+
1968
+ msgid "Color settings"
1969
+ msgstr "Настройки цвета"
1970
+
1971
+ msgid "Detect automatically"
1972
+ msgstr "Определять автоматически"
1973
+
1974
+ msgid "Set manually"
1975
+ msgstr "Задать вручную"
1976
+
1977
+ msgctxt "gutenberg-store-block-stub"
1978
+ msgid "Store"
1979
+ msgstr "Витрина магазина"
1980
+
1981
+ msgid "To improve the look and feel of your product page and manage your its appearance here, please enable the “Next-gen look and feel of the product page on the storefront” option in your store dashboard (<a href=\"admin.php?page=ec-store-admin-whatsnew\">Settings → What’s New</a>)."
1982
+ msgstr "Чтобы обновить дизайн страницы товара и управлять настройками вида в редакторе, включите опцию “Обновленный внешний вид страницы товара” в панели управления магазина (<a href=\"admin.php?page=ec-store-admin-whatsnew\">Настройки → Обновления</a>)"
1983
+
1984
  #. #-#-#-#-# ecwid-shopping-cart.pot (Ecwid Shopping Cart 5.2) #-#-#-#-#
1985
  #. Plugin URI of the plugin/theme
1986
  #. #-#-#-#-# ecwid-shopping-cart.pot (Ecwid Shopping Cart 5.2) #-#-#-#-#
lib/ecwid_api_v3.php CHANGED
@@ -31,6 +31,7 @@ class Ecwid_Api_V3
31
 
32
  const FEATURE_NEW_PRODUCT_LIST = 'NEW_PRODUCT_LIST';
33
  const FEATURE_VARIATIONS = 'COMBINATIONS';
 
34
 
35
  public $store_id = null;
36
 
31
 
32
  const FEATURE_NEW_PRODUCT_LIST = 'NEW_PRODUCT_LIST';
33
  const FEATURE_VARIATIONS = 'COMBINATIONS';
34
+ const FEATURE_NEW_DETAILS_PAGE = 'NEW_DETAILS_PAGE';
35
 
36
  public $store_id = null;
37
 
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.7
5
  Tested up to: 4.9
6
- Stable tag: 6.3.2
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
 
@@ -151,6 +151,11 @@ You can use Ecwid’s built-in import tools to copy your store products from any
151
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
152
 
153
  == Changelog ==
 
 
 
 
 
154
  = 6.3.2 - Oct 1, 2018 =
155
  - **Fixed a problem with the WordPress admin menu items.** In some cases, the WordPress admin navigation froze when an Ecwid store admin page was opened. Now everything should work fine.
156
 
3
  Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
4
  Requires at least: 3.7
5
  Tested up to: 4.9
6
+ Stable tag: 6.4
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
 
151
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
152
 
153
  == Changelog ==
154
+ = 6.4 - Oct 29, 2018 =
155
+ - **New storefront appearance settings in Gutenberg.** The new WordPress page editor (Gutenberg) now has plenty of e-commerce design settings: product thumbnails format and size, button and text colors, category images behavior, product page layout, store navigation elements and a lot more. We previously added these appearance options to your Ecwid store control panel: [https://www.ecwid.com/blog/new-ecwid-design-settings-dozens-of-customization-options-no-coding.html.](https://www.ecwid.com/blog/new-ecwid-design-settings-dozens-of-customization-options-no-coding.html). Now they are a part of real-time page building experience: you tweak the appearance, preview changes and publish them right from the page editor. To see the new appearance options, please make sure you enabled the Gutenberg editor in your WordPress admin backend.
156
+ - **SEO fix: 404 status for removed products and categories.** Previously, Ecwid didn't mark removed products and categories with correct 404 responses — it just displayed a customer-friendly message saying the product is not available. Google recommends making removed pages clearly marked with a special 404 response code available for search robots to read. We added it to make sure unavailable products will be quicker removed from the Google search results giving more customer attention to the available products.
157
+ - Minor fixes and improvements.
158
+
159
  = 6.3.2 - Oct 1, 2018 =
160
  - **Fixed a problem with the WordPress admin menu items.** In some cases, the WordPress admin navigation froze when an Ecwid store admin page was opened. Now everything should work fine.
161
 
templates/store-svg.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
3
- echo '<?xml-stylesheet type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.9.2" ?>';
4
  ?><!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
5
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
6
  <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
1
  <?php
2
  echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
3
+ echo '<?xml-stylesheet type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.9.2" ?>';
4
  ?><!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
5
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
6
  <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
templates/sync.php CHANGED
@@ -65,8 +65,6 @@ function update_no_sse_stuff(data) {
65
  }
66
 
67
  function increment_progress_counter(increment = 1) {
68
- debugger;
69
-
70
  if (increment == 0) {
71
  return;
72
  }
65
  }
66
 
67
  function increment_progress_counter(increment = 1) {
 
 
68
  if (increment == 0) {
69
  return;
70
  }