Ecwid Ecommerce Shopping Cart - Version 6.7.2

Version Description

  • May 28, 2019 =
  • SEO improvement: new ld+json and improved schema.org markup on product pages. Ecwid adds product ecommerce data to product pages in a SEO-friendly microdata format so that search engines can index your store pages and better display them in search results. In this update, we enhanced the structured products data on store pages to make it meet the latest Google recommendations. Also, the plugin now adds the same product data in ld+json format in your storefront, which is an alternative way to expose your e-commerce information to search engines. This should increase chances the Google bot will crawl and index your product catalog well.
  • Improved compatibility with WPML (part 3): hreflang tags for SEO. WPML is a popular plugin to build multilingual sites. As we mentioned before, Ecwid now supports full-featured multilingual storefronts, too. In this update, we further improved WPML support in Ecwid. Now, if you have enabled the multilingual mode in your ecommerce store and are using WPML on your WordPress site, your shop pages will have links to the alternative language versions so that search engines will know which version to display to customer. Those alternative links are specified in hreflang tags in your storefront special HTML elements aimed to link language versions of the same page between each other.
  • Several fixes and improvements for the Import from WooCommerce tool. If you import your products from WooCommerce to Ecwid, the import process now should be more stable and friendly.
  • A few fixes for the Integrate with the site search tool. You can find that tool on the Ecwid Advanced setting page its used to display your products in site search results.
  • Minor fixes and improvements.
Download this release

Release Info

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

Code changes from version 6.7.1 to 6.7.2

Files changed (41) hide show
  1. css/importer.css +14 -0
  2. css/settings.css +0 -76
  3. css/sync.css +76 -0
  4. ecwid-shopping-cart.php +28 -314
  5. includes/class-ecwid-admin.php +8 -6
  6. includes/class-ecwid-ajax-defer-renderer.php +8 -7
  7. includes/class-ecwid-floating-minicart.php +2 -0
  8. includes/class-ecwid-html-meta.php +165 -155
  9. includes/class-ecwid-product-browser.php +10 -5
  10. includes/class-ecwid-products.php +4 -7
  11. includes/class-ecwid-seo-links.php +10 -6
  12. includes/class-ecwid-static-page.php +301 -0
  13. includes/gutenberg/class-ecwid-gutenberg-block-minicart.php +3 -1
  14. includes/gutenberg/class-ecwid-gutenberg-block-store.php +6 -6
  15. includes/gutenberg/class-ecwid-gutenberg.php +2 -2
  16. includes/importer/class-ecwid-importer.php +34 -7
  17. includes/importer/task/class-ecwid-importer-task-create-product-variation.php +10 -7
  18. includes/importer/task/class-ecwid-importer-task-create-product.php +26 -24
  19. includes/importer/task/class-ecwid-importer-task-import-woo-product.php +4 -2
  20. includes/importer/task/class-ecwid-importer-task-product-base.php +38 -0
  21. includes/importer/task/class-ecwid-importer-task-upload-product-gallery-image.php +10 -9
  22. includes/importer/task/class-ecwid-importer-task-upload-product-image.php +10 -7
  23. includes/importer/task/class-ecwid-importer-task-upload-product-variation-image.php +10 -7
  24. includes/integrations/class-ecwid-integration-autoptimize.php +2 -2
  25. includes/integrations/class-ecwid-integration-wpml.php +57 -11
  26. includes/shortcodes/class-ecwid-shortcode-productbrowser.php +56 -136
  27. includes/widgets/nsf-minicart.tpl.php +2 -0
  28. js/admin-bar.js +37 -37
  29. js/frontend.js +6 -1
  30. js/gutenberg/blocks.build.js +1 -1
  31. js/importer.js +183 -50
  32. js/post-product.js +7 -5
  33. js/product-popup.js +2 -1
  34. js/static-page.js +360 -0
  35. languages/ecwid-shopping-cart-ru_RU.mo +0 -0
  36. languages/ecwid-shopping-cart-ru_RU.po +6 -2
  37. lib/ecwid_catalog.php +2 -1
  38. lib/ecwid_platform.php +1 -2
  39. readme.txt +14 -4
  40. templates/importer/woo-complete.tpl.php +1 -0
  41. templates/sync.php +28 -16
css/importer.css CHANGED
@@ -24,6 +24,7 @@
24
  .ecwid-importer .errors .btn-details {
25
  cursor: pointer;
26
  }
 
27
  .ecwid-importer .errors .details {
28
  display: none;
29
  border: 1px solid gray;
@@ -33,4 +34,17 @@
33
 
34
  .plan-limit-message {
35
  display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
24
  .ecwid-importer .errors .btn-details {
25
  cursor: pointer;
26
  }
27
+
28
  .ecwid-importer .errors .details {
29
  display: none;
30
  border: 1px solid gray;
34
 
35
  .plan-limit-message {
36
  display: none;
37
+ }
38
+
39
+ .log-entry, .log-entry-product {
40
+ margin-left: 20px;
41
+ margin-bottom: 10px;
42
+ }
43
+
44
+ .log-entry .log-entry-product {
45
+ display: none;
46
+ }
47
+
48
+ .log-entry.expanded .log-entry-product {
49
+ display: block;
50
  }
css/settings.css CHANGED
@@ -741,80 +741,4 @@ label.premium-feature svg path {
741
  top: 46px;
742
  bottom: 0px;
743
  }
744
- }
745
- #sync-container {
746
- line-height: normal;
747
- }
748
-
749
- #sync-container.state-initial #sync-buttons,
750
- #sync-container.state-initial #last-sync-date,
751
-
752
- #sync-container.state-in-progress #updating,
753
- #sync-container.state-in-progress #update-progress,
754
-
755
- #sync-container.state-complete #complete,
756
- #sync-container.state-complete #last-sync-date,
757
- #sync-container.state-complete #sync-error
758
- {
759
- display: block;
760
- }
761
-
762
-
763
- #sync-container #sync-button-slow {
764
- display: none;
765
- }
766
-
767
- #sync-container.no-sse #sync-button-slow {
768
- display: initial;
769
- }
770
-
771
- #sync-container.no-sse #sync-button {
772
- display: none;
773
- }
774
-
775
- #sync-container .sync-block {
776
- display: none;
777
- }
778
-
779
- #sync-container #sync-error .message {
780
- color: #d34f2b;
781
- }
782
-
783
- #sync-container #sync-button,
784
- #sync-container #sync-button-slow {
785
- cursor: pointer;
786
- }
787
-
788
- #sync-container #update-progress {
789
- padding-left: 30px;
790
- font-weight: 600;
791
- }
792
-
793
- #sync-container #complete {
794
- font-weight: 600;
795
- }
796
-
797
- #sync-container #complete,
798
- #sync-container #sync-buttons,
799
- #sync-container #updating {
800
- height: 3em;
801
- }
802
-
803
- #updating {
804
- line-height: 26px;
805
- color: #298CBA;
806
- font-weight: 600;
807
- }
808
-
809
- .sync-block#updating > div {
810
- display: table-cell;
811
- vertical-align: middle;
812
- }
813
-
814
- .sync-block#updating {
815
- line-height: initial;
816
- }
817
-
818
- .sync-block#updating .sync-icon {
819
- width: 30px;
820
  }
741
  top: 46px;
742
  bottom: 0px;
743
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
744
  }
css/sync.css ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #sync-container {
2
+ line-height: normal;
3
+ }
4
+
5
+ #sync-container.state-initial #sync-buttons,
6
+ #sync-container.state-initial #last-sync-date,
7
+
8
+ #sync-container.state-in-progress #updating,
9
+
10
+ #sync-container.state-complete #complete,
11
+ #sync-container.state-complete #last-sync-date,
12
+ #sync-container.state-complete #sync-error
13
+ {
14
+ display: block;
15
+ }
16
+
17
+
18
+ #sync-container #sync-button-slow {
19
+ display: none;
20
+ }
21
+
22
+ #sync-container.no-sse #sync-button-slow {
23
+ display: initial;
24
+ }
25
+
26
+ #sync-container.no-sse #sync-button {
27
+ display: none;
28
+ }
29
+
30
+ #sync-container .sync-block {
31
+ display: none;
32
+ }
33
+
34
+ #sync-container #sync-error .message {
35
+ color: #d34f2b;
36
+ }
37
+
38
+ #sync-container #sync-button,
39
+ #sync-container #sync-button-slow {
40
+ cursor: pointer;
41
+ }
42
+
43
+ #sync-container #updated-progress,
44
+ #sync-container #deleted-progress {
45
+ padding-left: 30px;
46
+ font-weight: 600;
47
+ }
48
+
49
+ #sync-container #complete {
50
+ font-weight: 600;
51
+ }
52
+
53
+ #sync-container #complete,
54
+ #sync-container #sync-buttons,
55
+ #sync-container #updating {
56
+ height: 3em;
57
+ }
58
+
59
+ #updating {
60
+ line-height: 26px;
61
+ color: #298CBA;
62
+ font-weight: 600;
63
+ }
64
+
65
+ .sync-block#updating > div {
66
+ display: table-cell;
67
+ vertical-align: middle;
68
+ }
69
+
70
+ .sync-block#updating {
71
+ line-height: initial;
72
+ }
73
+
74
+ .sync-block#updating .sync-icon {
75
+ width: 30px;
76
+ }
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.7.1
9
  Author URI: https://ecwid.to/ecwid-site
10
  */
11
 
@@ -87,10 +87,6 @@ if ( is_admin() ) {
87
  add_action( 'wp', 'ecwid_remove_default_canonical' );
88
  add_filter( 'wp', 'ecwid_seo_compatibility_init', 0 );
89
 
90
- add_action( 'wp_head', 'ecwid_meta_description', 0 );
91
- add_action( 'wp_head', 'ecwid_ajax_crawling_fragment' );
92
- add_action( 'wp_head', 'ecwid_meta' );
93
- add_action( 'wp_head', 'ecwid_canonical' );
94
  add_action( 'wp_head', 'ecwid_seo_compatibility_restore', 1000 );
95
  add_action( 'wp_head', 'ecwid_print_inline_js_config' );
96
  add_action( 'wp_head', 'ecwid_product_browser_url_in_head' );
@@ -129,7 +125,7 @@ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-products.php';
129
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-config.php';
130
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin.php';
131
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin-main-page.php';
132
- require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-static-home-page.php';
133
 
134
  if ( is_admin() ) {
135
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-help-page.php';
@@ -684,7 +680,7 @@ function ecwid_check_version()
684
  do_action( 'ecwid_on_plugin_upgrade' );
685
  }
686
 
687
- if ($fresh_install || $upgrade || @$_GET['ecwid_reinit']) {
688
 
689
  add_option( Ecwid_Seo_Links::OPTION_ENABLED, false );
690
 
@@ -731,10 +727,6 @@ function ecwid_check_version()
731
 
732
  // Since 5.8
733
  add_option( 'ecwid_print_html_catalog', 'Y' );
734
-
735
- // Since 5.8.x
736
- add_option( 'ecwid_print_category_in_title', 'Y' );
737
-
738
 
739
  // Since 5.8.1+
740
  add_option( Ecwid_Products::OPTION_SYNC_LIMIT, 20 );
@@ -1105,7 +1097,7 @@ function ecwid_content_has_productbrowser( $content ) {
1105
 
1106
  $result = has_shortcode( $content, 'ecwid_productbrowser' );
1107
 
1108
- if ( class_exists( 'Ecwid_Gutenberg' ) && Ecwid_Gutenberg::has_content_productbrowser( $content ) !== false ) {
1109
  return true;
1110
  }
1111
 
@@ -1145,133 +1137,10 @@ function ecwid_get_current_user_locale()
1145
  return $lang;
1146
  }
1147
 
1148
- function ecwid_ajax_crawling_fragment() {
1149
-
1150
- if ( !Ecwid_Api_V3::is_available() ) return;
1151
-
1152
- if ( isset( $_GET['_escaped_fragment_'] ) ) return;
1153
-
1154
- if ( ! Ecwid_Store_Page::is_store_page() ) return;
1155
-
1156
- global $wp, $ecwid_seo_links;
1157
-
1158
- $slug = ltrim( strrchr( $wp->request, '/' ), '/' );
1159
-
1160
- if ( Ecwid_Seo_Links::is_enabled() ) return;
1161
-
1162
- echo '<meta name="fragment" content="!">' . PHP_EOL;
1163
- }
1164
-
1165
- function ecwid_meta() {
1166
-
1167
- $ua = @$_SERVER['HTTP_USER_AGENT'];
1168
-
1169
- $is_ie = strpos( $ua, 'MSIE' ) !== false
1170
- || strpos( $ua, 'Trident' ) !== false;
1171
-
1172
- if ( $is_ie || ( get_option( 'ecwid_hide_prefetch' ) == 'on' ) ) {
1173
- return;
1174
- }
1175
-
1176
- echo '<meta http-equiv="x-dns-prefetch-control" content="on">' . PHP_EOL;
1177
-
1178
- if (!Ecwid_Store_Page::is_store_page()) {
1179
- echo '<link href="https://d201eyh6wia12q.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
1180
- echo '<link href="https://d3fi9i0jj23cau.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
1181
- echo '<link href="https://dqzrr9k4bjpzk.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
1182
- echo '<link href="https://ecwid-static-ru.gcdn.co" rel="preconnect" crossorigin />' . PHP_EOL;
1183
- echo '<link href="https://ecwid-images-ru.gcdn.co" rel="preconnect" crossorigin />' . PHP_EOL;
1184
- echo '<link href="https://app.ecwid.com" rel="preconnect" crossorigin />' . PHP_EOL;
1185
-
1186
- if ( Ecwid_Static_Home_Page::is_enabled() && Ecwid_Static_Home_Page::get_data_for_current_page() ) {
1187
- echo '<link href="https://d3j0zfs7paavns.cloudfront.net" rel="preconnect" crossorigin>' . PHP_EOL;
1188
-
1189
- $data = Ecwid_Static_Home_Page::get_data_for_current_page();
1190
-
1191
- foreach ( $data->cssFiles as $ind => $item ) {
1192
- echo '<link rel="prefetch" href="' . $item . '">' . PHP_EOL;
1193
- }
1194
- }
1195
-
1196
- if (ecwid_is_store_page_available()) {
1197
-
1198
- $store_id = get_ecwid_store_id();
1199
- $params = ecwid_get_scriptjs_params();
1200
- $scriptjs_url = 'https://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?' . $store_id . $params;
1201
- echo '<link rel="prefetch" href="' . $scriptjs_url . '" />' . PHP_EOL;
1202
-
1203
- $page_url = Ecwid_Store_Page::get_store_url();
1204
- echo '<link rel="prerender" href="' . $page_url . '" />' . PHP_EOL;
1205
- }
1206
- } else {
1207
- $store_id = get_ecwid_store_id();
1208
- $params = ecwid_get_scriptjs_params();
1209
- echo '<link rel="preload" href="https://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?'
1210
- . $store_id . $params . '" as="script">' . PHP_EOL;
1211
- }
1212
- }
1213
-
1214
  function ecwid_product_browser_url_in_head() {
1215
  echo ecwid_get_product_browser_url_script();
1216
  }
1217
 
1218
-
1219
- function ecwid_canonical() {
1220
-
1221
- if ( get_option( 'ecwid_hide_canonical', false ) ) return;
1222
-
1223
- $link = false;
1224
- if ( ecwid_is_applicable_escaped_fragment() ) {
1225
-
1226
- $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
1227
-
1228
- if ($params['mode'] == 'product') {
1229
- $product = Ecwid_Product::get_by_id( $params['id'] );
1230
- $link = ecwid_get_product_url($product);
1231
- } else if ($params['mode'] == 'category') {
1232
- $category = Ecwid_Category::get_by_id( $params['id'] );
1233
- $link = ecwid_get_category_url($category);
1234
- }
1235
- } else if ( Ecwid_Seo_Links::is_product_browser_url() ) {
1236
-
1237
- $params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
1238
-
1239
- if ($params) {
1240
- if ( $params['mode'] == 'product' ) {
1241
- $product = Ecwid_Product::get_by_id( $params['id'] );
1242
- if ( $product ) {
1243
- $link = $product->url;
1244
- }
1245
- } elseif ( $params['mode'] == 'category' ) {
1246
- $category = Ecwid_Category::get_by_id( $params['id'] );
1247
-
1248
- if ( $category ) {
1249
- $link = $category->link;
1250
- }
1251
- }
1252
- }
1253
- }
1254
-
1255
- if (!$link) {
1256
- return;
1257
- }
1258
-
1259
-
1260
- if ( $link ) {
1261
-
1262
- $main_page_id = Ecwid_Store_page::get_current_store_page_id();
1263
- $params = Ecwid_Store_page::get_store_page_params( $main_page_id );
1264
-
1265
- if ( @$params['default_category_id'] ) {
1266
- $current = get_permalink();
1267
- $store_page = Ecwid_Store_Page::get_store_url();
1268
- $link = str_replace( $store_page, $current, $link );
1269
- }
1270
-
1271
- echo '<link rel="canonical" href="' . esc_attr($link) . '" />' . PHP_EOL;
1272
- }
1273
- }
1274
-
1275
  function ecwid_is_applicable_escaped_fragment() {
1276
  if (!Ecwid_Api_V3::is_available() ) {
1277
  return false;
@@ -1280,7 +1149,7 @@ function ecwid_is_applicable_escaped_fragment() {
1280
  if (!isset($_GET['_escaped_fragment_'])) return false;
1281
 
1282
  $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
1283
-
1284
  if (!$params) return false;
1285
 
1286
  if (!in_array($params['mode'], array('category', 'product')) || !isset($params['id'])) return false;
@@ -1288,85 +1157,6 @@ function ecwid_is_applicable_escaped_fragment() {
1288
  return true;
1289
  }
1290
 
1291
- function ecwid_meta_description() {
1292
-
1293
- $params = array();
1294
-
1295
- $description = false;
1296
- if ( ecwid_is_applicable_escaped_fragment() ) {
1297
- $params = ecwid_parse_escaped_fragment( $_GET['_escaped_fragment_'] );
1298
-
1299
- if ( $params['mode'] == 'product' ) {
1300
- $product = Ecwid_Product::get_by_id( $params['id'] );
1301
- if ( $product ) {
1302
- $description = $product->description;
1303
- }
1304
- } elseif ( $params['mode'] == 'category' ) {
1305
- $category = Ecwid_Category::get_by_id( $params['id'] );
1306
- if ( $category ) {
1307
- $description = $category->description;
1308
- }
1309
- }
1310
- } else if ( Ecwid_Seo_Links::is_product_browser_url() ) {
1311
- $params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
1312
- if ($params) {
1313
-
1314
- if ( $params['mode'] == 'product' ) {
1315
- $product = Ecwid_Product::get_by_id( $params['id'] );
1316
-
1317
- if ( $product && isset( $product->seoDescription ) ) {
1318
- $description = $product->seoDescription;
1319
- }
1320
-
1321
- if (!$description && $product && isset( $product->description ) ) {
1322
- $description = $product->description;
1323
- }
1324
- } elseif ( $params['mode'] == 'category' ) {
1325
- $category = Ecwid_Category::get_by_id( $params['id'] );
1326
-
1327
- if ( $category ) {
1328
- if (!$description && isset( $category->description ) ) {
1329
- $description = $category->description;
1330
- }
1331
- }
1332
- }
1333
- }
1334
- } else if ( Ecwid_Store_Page::is_store_page() ) {
1335
- $set_metadesc = false;
1336
- $set_metadesc = apply_filters( 'ecwid_set_mainpage_metadesc', $set_metadesc );
1337
-
1338
- if( $set_metadesc ) {
1339
- $store_page_params = Ecwid_Store_Page::get_store_page_params();
1340
- if ( isset( $store_page_params['default_category_id'] ) && $store_page_params['default_category_id'] > 0 ) {
1341
- $category = Ecwid_Category::get_by_id( $store_page_params['default_category_id'] );
1342
-
1343
- if ( $category ) {
1344
- if (!$description && isset( $category->description ) ) {
1345
- $description = $category->description;
1346
- }
1347
- }
1348
- } else {
1349
- $api = new Ecwid_Api_V3();
1350
- $profile = $api->get_store_profile();
1351
-
1352
- if( !empty($profile->settings->storeDescription) ) {
1353
- $description = $profile->settings->storeDescription;
1354
- }
1355
- }
1356
- }
1357
- }
1358
-
1359
- if ( !$description ) {
1360
- return;
1361
- }
1362
-
1363
- $description = ecwid_trim_description($description);
1364
-
1365
- echo <<<HTML
1366
- <meta name="description" content="$description" />
1367
- HTML;
1368
- }
1369
-
1370
  function ecwid_trim_description($description)
1371
  {
1372
  return Ecwid_HTML_Meta::process_raw_description( $description, ECWID_TRIMMED_DESCRIPTION_LENGTH );
@@ -1439,90 +1229,13 @@ function ecwid_seo_title_parts($parts)
1439
 
1440
  function _ecwid_get_seo_title()
1441
  {
1442
- $params = array();
1443
-
1444
- if ( ecwid_is_applicable_escaped_fragment() ) {
1445
- $params = ecwid_parse_escaped_fragment( $_GET['_escaped_fragment_'] );
1446
- if ( empty( $params ) ) return;
1447
-
1448
- $ecwid_seo_title = '';
1449
-
1450
- $separator = ecwid_get_title_separator();
1451
-
1452
- if ( isset( $params['mode'] ) && ! empty( $params['mode'] ) ) {
1453
- if ( $params['mode'] == 'product' ) {
1454
- if ( isset( $params['category'] ) && ! empty( $params['category'] ) ) {
1455
- $product = Ecwid_Product::get_by_id( $params['id'] );
1456
- $category = Ecwid_Category::get_by_id( $params['category'] );
1457
-
1458
- if ( $product ) {
1459
- $ecwid_seo_title = $product->name;
1460
- if ( $category && get_option( 'ecwid_print_category_in_title', true ) ) {
1461
- $ecwid_seo_title .= ' ' . $separator . $category->name;
1462
- }
1463
- }
1464
- } elseif ( empty( $params['category'] ) ) {
1465
- $product = Ecwid_Product::get_by_id( $params['id'] );
1466
-
1467
- if ( $product ) {
1468
- $ecwid_seo_title = $product->name;
1469
-
1470
- if ( $product->defaultCategoryId ) {
1471
- $category = Ecwid_Category::get_by_id( $product->defaultCategoryId );
1472
- $ecwid_seo_title .= ' ' . $separator . ' ';
1473
- $ecwid_seo_title .= $category->name;
1474
- }
1475
- }
1476
- }
1477
- } elseif ( $params['mode'] == 'category' ) {
1478
- $ecwid_category = Ecwid_Category::get_by_id( $params['id'] );
1479
-
1480
- if ($ecwid_category) {
1481
- $ecwid_seo_title = $ecwid_category->name;
1482
- }
1483
- }
1484
- }
1485
-
1486
- } else if ( Ecwid_Seo_Links::is_product_browser_url() && Ecwid_Api_V3::is_available() ) {
1487
-
1488
- $params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
1489
-
1490
- if ( $params ) {
1491
- $api = new Ecwid_Api_V3();
1492
-
1493
- if ( $params['mode'] == 'product' ) {
1494
- $product = Ecwid_Product::get_by_id( $params['id'] );
1495
-
1496
- if ( !$product ) {
1497
- return '';
1498
- }
1499
-
1500
- if ( isset( $product->seoTitle ) && !empty( $product->seoTitle ) ) {
1501
- $ecwid_seo_title = $product->seoTitle;
1502
- } else {
1503
- $ecwid_seo_title = $product->name;
1504
- }
1505
 
1506
- if ( $product->defaultCategoryId ) {
1507
- $category = $api->get_category( $product->defaultCategoryId );
1508
- if ( $category && isset( $category->name ) && get_option( 'ecwid_print_category_in_title', true ) ) {
1509
- $ecwid_seo_title .= ' ' . ecwid_get_title_separator() . ' ' . $category->name;
1510
- }
1511
- }
1512
- } else if ( $params['mode'] == 'category' ) {
1513
- $category = $api->get_category( $params['id'] );
1514
- if ( $category && isset( $category->name ) ) {
1515
- $ecwid_seo_title = $category->name;
1516
- }
1517
- }
1518
- }
1519
  }
1520
 
1521
- if ( ! empty( $ecwid_seo_title ) ) {
1522
- return $ecwid_seo_title;
1523
- }
1524
-
1525
- return "";
1526
  }
1527
 
1528
  add_filter('oembed_endpoint_url', 'ecwid_oembed_url', 10, 3);
@@ -1632,7 +1345,7 @@ function ecwid_get_scriptjs_params( $force_lang = null ) {
1632
  }
1633
  }
1634
 
1635
- if ( Ecwid_Static_Home_Page::is_enabled() ) {
1636
  $params .= '&data_static_home=1';
1637
  }
1638
 
@@ -2136,11 +1849,11 @@ function ecwid_get_update_params_options() {
2136
  )
2137
  ),
2138
 
2139
- Ecwid_Static_Home_Page::OPTION_IS_ENABLED => array(
2140
  'values' => array(
2141
- Ecwid_Static_Home_Page::OPTION_VALUE_AUTO,
2142
- Ecwid_Static_Home_Page::OPTION_VALUE_ENABLED,
2143
- Ecwid_Static_Home_Page::OPTION_VALUE_DISABLED
2144
  )
2145
  ),
2146
 
@@ -2336,7 +2049,7 @@ function ecwid_settings_api_init() {
2336
  update_option('ecwid_sso_secret_key', '');
2337
  }
2338
 
2339
- if ($_POST['settings_section'] == 'advanced' && $_POST[Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID] && in_array( $_POST[Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID], Ecwid_Store_Page::get_store_pages_array() ) ) {
2340
  Ecwid_Store_Page::update_main_store_page_id( $_POST[Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID] );
2341
  }
2342
  }
@@ -2829,7 +2542,7 @@ function ecwid_get_categories_for_selector() {
2829
  foreach ( $all_categories as $category ) {
2830
  $result[$category->id] = $category;
2831
 
2832
- if ( !@$category->parentId ) {
2833
  $result[$category->id]->path = $category->name;
2834
  } else {
2835
  $current_parent_id = $category->parentId;
@@ -3224,7 +2937,6 @@ function ecwid_sso() {
3224
  window.EcwidSignInUrl = '$signin_url';
3225
  window.EcwidSignOutUrl = '$signout_url';
3226
  window.Ecwid.OnAPILoaded.add(function() {
3227
-
3228
  window.Ecwid.setSignInUrls({
3229
  signInUrl: '$signin_url',
3230
  signOutUrl: '$signout_url'
@@ -3273,17 +2985,19 @@ JS;
3273
  return <<<HTML
3274
  <script data-cfasync="false" type="text/javascript">
3275
 
3276
- var ecwid_sso_profile='$ecwid_sso_profile';
3277
- $sign_in_out_urls
3278
 
3279
- jQuery(document).ready(function() {
3280
- Ecwid.OnPageLoad.add(function(page) {
3281
- if (page.type == 'SIGN_IN' && ecwid_sso_profile == '') {
3282
- location.href = '$signin_url';
3283
- }
3284
- })
3285
- }
3286
- );
 
 
3287
  </script>
3288
  HTML;
3289
  }
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.7.2
9
  Author URI: https://ecwid.to/ecwid-site
10
  */
11
 
87
  add_action( 'wp', 'ecwid_remove_default_canonical' );
88
  add_filter( 'wp', 'ecwid_seo_compatibility_init', 0 );
89
 
 
 
 
 
90
  add_action( 'wp_head', 'ecwid_seo_compatibility_restore', 1000 );
91
  add_action( 'wp_head', 'ecwid_print_inline_js_config' );
92
  add_action( 'wp_head', 'ecwid_product_browser_url_in_head' );
125
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-config.php';
126
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin.php';
127
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-admin-main-page.php';
128
+ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-static-page.php';
129
 
130
  if ( is_admin() ) {
131
  require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-help-page.php';
680
  do_action( 'ecwid_on_plugin_upgrade' );
681
  }
682
 
683
+ if ($fresh_install || $upgrade || isset($_GET['ecwid_reinit'])) {
684
 
685
  add_option( Ecwid_Seo_Links::OPTION_ENABLED, false );
686
 
727
 
728
  // Since 5.8
729
  add_option( 'ecwid_print_html_catalog', 'Y' );
 
 
 
 
730
 
731
  // Since 5.8.1+
732
  add_option( Ecwid_Products::OPTION_SYNC_LIMIT, 20 );
1097
 
1098
  $result = has_shortcode( $content, 'ecwid_productbrowser' );
1099
 
1100
+ if ( class_exists( 'Ecwid_Gutenberg' ) && Ecwid_Gutenberg::content_has_productbrowser( $content ) !== false ) {
1101
  return true;
1102
  }
1103
 
1137
  return $lang;
1138
  }
1139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1140
  function ecwid_product_browser_url_in_head() {
1141
  echo ecwid_get_product_browser_url_script();
1142
  }
1143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1144
  function ecwid_is_applicable_escaped_fragment() {
1145
  if (!Ecwid_Api_V3::is_available() ) {
1146
  return false;
1149
  if (!isset($_GET['_escaped_fragment_'])) return false;
1150
 
1151
  $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
1152
+
1153
  if (!$params) return false;
1154
 
1155
  if (!in_array($params['mode'], array('category', 'product')) || !isset($params['id'])) return false;
1157
  return true;
1158
  }
1159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1160
  function ecwid_trim_description($description)
1161
  {
1162
  return Ecwid_HTML_Meta::process_raw_description( $description, ECWID_TRIMMED_DESCRIPTION_LENGTH );
1229
 
1230
  function _ecwid_get_seo_title()
1231
  {
1232
+ $ecwid_seo_title = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1233
 
1234
+ if ( ecwid_is_applicable_escaped_fragment() || Ecwid_Seo_Links::is_product_browser_url() ) {
1235
+ $ecwid_seo_title = Ecwid_Static_Page::get_title();
 
 
 
 
 
 
 
 
 
 
 
1236
  }
1237
 
1238
+ return $ecwid_seo_title;
 
 
 
 
1239
  }
1240
 
1241
  add_filter('oembed_endpoint_url', 'ecwid_oembed_url', 10, 3);
1345
  }
1346
  }
1347
 
1348
+ if ( Ecwid_Static_Page::is_enabled_static_home_page() ) {
1349
  $params .= '&data_static_home=1';
1350
  }
1351
 
1849
  )
1850
  ),
1851
 
1852
+ Ecwid_Static_Page::OPTION_IS_ENABLED => array(
1853
  'values' => array(
1854
+ Ecwid_Static_Page::OPTION_VALUE_AUTO,
1855
+ Ecwid_Static_Page::OPTION_VALUE_ENABLED,
1856
+ Ecwid_Static_Page::OPTION_VALUE_DISABLED
1857
  )
1858
  ),
1859
 
2049
  update_option('ecwid_sso_secret_key', '');
2050
  }
2051
 
2052
+ if ($_POST['settings_section'] == 'advanced' && isset( $_POST[Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID] ) && in_array( $_POST[Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID], Ecwid_Store_Page::get_store_pages_array() ) ) {
2053
  Ecwid_Store_Page::update_main_store_page_id( $_POST[Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID] );
2054
  }
2055
  }
2542
  foreach ( $all_categories as $category ) {
2543
  $result[$category->id] = $category;
2544
 
2545
+ if ( !isset($category->parentId) ) {
2546
  $result[$category->id]->path = $category->name;
2547
  } else {
2548
  $current_parent_id = $category->parentId;
2937
  window.EcwidSignInUrl = '$signin_url';
2938
  window.EcwidSignOutUrl = '$signout_url';
2939
  window.Ecwid.OnAPILoaded.add(function() {
 
2940
  window.Ecwid.setSignInUrls({
2941
  signInUrl: '$signin_url',
2942
  signOutUrl: '$signout_url'
2985
  return <<<HTML
2986
  <script data-cfasync="false" type="text/javascript">
2987
 
2988
+ var ecwid_sso_profile='$ecwid_sso_profile';
2989
+ $sign_in_out_urls
2990
 
2991
+ jQuery(document).ready(function() {
2992
+ if (typeof Ecwid == 'undefined') return;
2993
+
2994
+ Ecwid.OnPageLoad.add(function(page) {
2995
+ if (page.type == 'SIGN_IN' && ecwid_sso_profile == '') {
2996
+ location.href = '$signin_url';
2997
+ }
2998
+ })
2999
+ }
3000
+ );
3001
  </script>
3002
  HTML;
3003
  }
includes/class-ecwid-admin.php CHANGED
@@ -215,15 +215,17 @@ class Ecwid_Admin {
215
  $menu = $this->_get_menus();
216
 
217
  foreach ($menu as $item) {
218
- if ( @$item['slug'] == $slug ) {
219
  $hash = $item['hash'];
220
  break;
221
  }
222
- if ( @$item['children'] ) foreach ( $item['children'] as $child ) {
223
- if ($child['slug'] == $slug) {
224
- $hash = $child['hash'];
225
- break;
226
- }
 
 
227
  }
228
  }
229
 
215
  $menu = $this->_get_menus();
216
 
217
  foreach ($menu as $item) {
218
+ if ( isset($item['slug']) && $item['slug'] == $slug ) {
219
  $hash = $item['hash'];
220
  break;
221
  }
222
+ if ( isset($item['children']) && $item['children'] ) {
223
+ foreach ( $item['children'] as $child ) {
224
+ if ($child['slug'] == $slug) {
225
+ $hash = $child['hash'];
226
+ break;
227
+ }
228
+ }
229
  }
230
  }
231
 
includes/class-ecwid-ajax-defer-renderer.php CHANGED
@@ -116,15 +116,16 @@ HTML;
116
  if (el) {
117
  el.style.display = 'none';
118
  }
119
- Ecwid.OnPageLoad.add(function() {
120
- var catalog = document.getElementById('ecwid-html-catalog-$ecwid_store_id');
121
- catalog.parentElement.removeChild(catalog);
122
- });
 
 
123
  } else {
124
- ecwid_onBodyDone();
 
125
  }
126
-
127
- }
128
  </script>
129
  HTML;
130
  return $before . $content . $after;
116
  if (el) {
117
  el.style.display = 'none';
118
  }
119
+ if ( typeof Ecwid != 'undefined' ) {
120
+ Ecwid.OnPageLoad.add(function() {
121
+ var catalog = document.getElementById('ecwid-html-catalog-$ecwid_store_id');
122
+ catalog.parentElement.removeChild(catalog);
123
+ });
124
+ }
125
  } else {
126
+ ecwid_onBodyDone();
127
+ }
128
  }
 
 
129
  </script>
130
  HTML;
131
  return $before . $content . $after;
includes/class-ecwid-floating-minicart.php CHANGED
@@ -71,7 +71,9 @@ if ( version_compare( get_bloginfo('version'), '4.0' ) >= 0 ) {
71
  ></div>
72
 
73
  <script>
 
74
  Ecwid.init();
 
75
  </script>
76
  HTML;
77
  }
71
  ></div>
72
 
73
  <script>
74
+ if (typeof Ecwid != 'undefined'){
75
  Ecwid.init();
76
+ }
77
  </script>
78
  HTML;
79
  }
includes/class-ecwid-html-meta.php CHANGED
@@ -2,42 +2,65 @@
2
 
3
  abstract class Ecwid_HTML_Meta
4
  {
5
- protected function __construct()
6
- {
7
  $this->_init();
8
  }
9
 
10
-
11
- protected function _init()
12
- {
13
- add_action( 'wp_head', array( $this, 'wp_head' ) );
14
  }
15
 
16
  abstract public function wp_head();
 
17
 
18
- public static function maybe_create()
19
- {
20
- $params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
21
-
22
  $obj = null;
23
- if ( ! empty( $params ) ) {
24
- $obj = null;
25
-
26
- if ( $params['mode'] == 'product' ) {
27
- $obj = new Ecwid_HTML_Meta_Product( $params['id'] );
28
- } else if ( $params['mode'] == 'category' ) {
29
- $obj = new Ecwid_HTML_Meta_Category( $params['id'] );
30
- }
31
-
32
- }
33
 
 
 
 
 
34
  if ( Ecwid_Seo_Links::is_noindex_page() ) {
35
- $obj = new Ecwid_HTML_Meta_Noindex();
 
 
36
  }
37
 
38
  return $obj;
39
  }
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  // static only while ecwid_trim_description exists and meta functionality is not moved into this class
42
  public static function process_raw_description( $description, $length = 0 ) {
43
  $description = strip_tags( $description );
@@ -57,179 +80,166 @@ abstract class Ecwid_HTML_Meta
57
  }
58
  }
59
 
60
- abstract class Ecwid_HTML_Meta_Catalog_Entry extends Ecwid_HTML_Meta {
61
-
62
- protected $id;
63
-
64
- protected function __construct($id)
65
- {
66
- $this->id = $id;
67
-
68
  parent::__construct();
69
  }
70
 
71
- public function wp_head()
72
- {
73
- $this->_print_opengraph_tags();
74
- $this->_print_twitter_tags();
 
 
75
  }
76
 
77
- protected function _print_opengraph_tags()
78
- {
79
- $og_tags = array(
80
- 'locale' => get_locale(),
81
- 'type' => 'article',
82
- 'title' => $this->_get_title(),
83
- 'description' => $this->_get_description( ECWID_TRIMMED_DESCRIPTION_LENGTH ),
84
- 'url' => $this->_get_url(),
85
- 'site_name' => $this->_get_site_name(),
86
- 'image' => $this->_get_image_url()
87
- );
88
-
89
- $og_tags = apply_filters( 'ecwid_og_tags', $og_tags );
90
-
91
- if (!empty($og_tags)) {
92
- foreach ($og_tags as $tag => $value) {
93
- if (!$value) continue;
94
-
95
- echo sprintf(
96
- '<meta property="og:%s" content="%s" />',
97
- $tag,
98
- esc_attr($value)
99
- );
100
- }
101
- }
102
  }
103
 
104
- protected function _print_twitter_tags()
105
- {
106
- $twitter_tags = array(
107
- 'card' => 'summary_large_image',
108
- 'description' => $this->_get_description( ECWID_TRIMMED_DESCRIPTION_LENGTH ),
109
- 'title' => $this->_get_title(),
110
- 'image' => $this->_get_image_url()
111
- );
112
 
113
- $twitter_tags = apply_filters( 'ecwid_twitter_tags', $twitter_tags );
 
 
114
 
115
- if ( !empty( $twitter_tags ) ) {
116
- foreach ($twitter_tags as $tag => $value) {
117
- if (!$value) continue;
118
 
119
- echo sprintf(
120
- '<meta property="twitter:%s" content="%s" />',
121
- $tag,
122
- esc_attr( $value )
123
- );
124
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
126
- }
127
 
128
- protected function _get_site_name()
129
- {
130
- return get_bloginfo( 'name' );
 
 
131
  }
132
 
133
- protected function _get_description( $length )
134
- {
135
- $raw = $this->_get_raw_description();
 
 
 
 
 
 
136
 
137
- return self::process_raw_description( $raw, $length );
138
  }
139
 
140
- abstract protected function _get_title();
141
 
142
- abstract protected function _get_raw_description();
 
 
 
143
 
144
- abstract protected function _get_url();
 
 
 
145
 
146
- abstract protected function _get_image_url();
 
 
 
147
 
148
- // static only while ecwid_trim_description exists and meta functionality is not moved into this class
149
- public static function process_raw_description( $description, $length = 0 ) {
150
- $description = strip_tags( $description );
151
- $description = html_entity_decode( $description, ENT_NOQUOTES, 'UTF-8' );
152
 
153
- $description = preg_replace( '![\p{Z}\s]{1,}!u', ' ', $description );
154
- $description = trim( $description, " \t\xA0\n\r" ); // Space, tab, non-breaking space, newline, carriage return
155
 
156
- if ( function_exists( 'mb_substr' ) ) {
157
- $description = mb_substr( $description, 0, $length ? $length : ECWID_TRIMMED_DESCRIPTION_LENGTH, 'UTF-8' );
158
- } else {
159
- $description = substr( $description, 0, $length ? $length : ECWID_TRIMMED_DESCRIPTION_LENGTH );
160
- }
161
- $description = htmlspecialchars( $description, ENT_COMPAT, 'UTF-8' );
162
 
163
- return $description;
164
- }
165
- }
166
 
167
- class Ecwid_HTML_Meta_Product extends Ecwid_HTML_Meta_Catalog_Entry {
168
-
169
- protected $product;
170
- protected function _init()
171
- {
172
- parent::_init();
173
- $this->product = Ecwid_Product::get_by_id( $this->id );
174
- }
175
-
176
- protected function _get_title()
177
- {
178
- return @$this->product->name;
179
  }
180
-
181
- protected function _get_raw_description()
182
- {
183
- return @$this->product->description;
184
  }
185
-
186
- protected function _get_url()
187
- {
188
- return @$this->product->link;
 
 
189
  }
190
 
191
- protected function _get_image_url()
192
- {
193
- return @$this->product->hdThumbnailUrl ? @$this->product->hdThumbnailUrl : @$this->product->thumbnailUrl;
194
  }
195
  }
196
 
197
- class Ecwid_HTML_Meta_Category extends Ecwid_HTML_Meta_Catalog_Entry {
198
-
199
- protected $category;
200
- protected function _init()
201
- {
202
- parent::_init();
203
- $this->category = Ecwid_Category::get_by_id( $this->id );
204
  }
205
 
 
206
 
207
- protected function _get_title()
208
- {
209
- return @$this->category->name;
210
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
 
212
- protected function _get_raw_description()
213
- {
214
- return @$this->category->description;
215
- }
216
-
217
- protected function _get_url()
218
- {
219
- return @$this->category->link;
220
- }
221
 
222
- protected function _get_image_url()
223
- {
224
- return @$this->category->hdThumbnailUrl ? @$this->category->hdThumbnailUrl : @$this->category->thumbnailUrl;
225
  }
226
- }
227
 
228
- class Ecwid_HTML_Meta_Noindex extends Ecwid_HTML_Meta {
229
- public function wp_head()
230
- {
231
- echo '<meta name="robots" content="noindex">';
232
- }
233
  }
234
 
235
  add_action( 'wp', array( 'Ecwid_HTML_Meta', 'maybe_create' ) );
2
 
3
  abstract class Ecwid_HTML_Meta
4
  {
5
+ protected function __construct() {
 
6
  $this->_init();
7
  }
8
 
9
+ protected function _init() {
10
+ add_action( 'wp_head', array( $this, 'wp_head' ), 1 );
11
+ add_action( 'wp_head', array( $this, 'wp_head_last') , 1000 );
 
12
  }
13
 
14
  abstract public function wp_head();
15
+ abstract public function wp_head_last();
16
 
17
+ public static function maybe_create() {
 
 
 
18
  $obj = null;
 
 
 
 
 
 
 
 
 
 
19
 
20
+ if( !Ecwid_Store_Page::is_store_page() ) {
21
+ return new Ecwid_HTML_Meta_Other();
22
+ }
23
+
24
  if ( Ecwid_Seo_Links::is_noindex_page() ) {
25
+ return new Ecwid_HTML_Meta_Noindex();
26
+ } else {
27
+ return new Ecwid_HTML_Meta_Catalog_Entry();
28
  }
29
 
30
  return $obj;
31
  }
32
 
33
+ protected function _is_available_prefetch_tags(){
34
+ $ua = @$_SERVER['HTTP_USER_AGENT'];
35
+
36
+ $is_ie = strpos( $ua, 'MSIE' ) !== false
37
+ || strpos( $ua, 'Trident' ) !== false;
38
+
39
+ if ( $is_ie || ( get_option( 'ecwid_hide_prefetch' ) == 'on' ) ) {
40
+ return false;
41
+ }
42
+
43
+ return true;
44
+ }
45
+
46
+ protected function _print_dns_prefetch_control() {
47
+ echo '<meta http-equiv="x-dns-prefetch-control" content="on">' . PHP_EOL;
48
+ }
49
+
50
+ protected function _print_prefetch() {
51
+
52
+ if( !$this->_is_available_prefetch_tags() ){
53
+ return;
54
+ }
55
+
56
+ $store_id = get_ecwid_store_id();
57
+ $params = ecwid_get_scriptjs_params();
58
+
59
+ $this->_print_dns_prefetch_control();
60
+ echo '<link rel="preload" href="https://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?'
61
+ . $store_id . $params . '" as="script">' . PHP_EOL;
62
+ }
63
+
64
  // static only while ecwid_trim_description exists and meta functionality is not moved into this class
65
  public static function process_raw_description( $description, $length = 0 ) {
66
  $description = strip_tags( $description );
80
  }
81
  }
82
 
83
+ class Ecwid_HTML_Meta_Catalog_Entry extends Ecwid_HTML_Meta
84
+ {
85
+ protected function __construct() {
 
 
 
 
 
86
  parent::__construct();
87
  }
88
 
89
+ public function wp_head() {
90
+ $this->_print_description();
91
+ $this->_print_prefetch();
92
+ $this->_print_og_tags();
93
+ $this->_print_canonical();
94
+ $this->_print_ajax_crawling_fragment();
95
  }
96
 
97
+ public function wp_head_last() {
98
+ $this->_print_json_ld();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
100
 
101
+ protected function _print_description() {
102
+ $description_html = false;
 
 
 
 
 
 
103
 
104
+ if ( ecwid_is_applicable_escaped_fragment() || Ecwid_Seo_Links::is_product_browser_url() ) {
105
+
106
+ $description_html = Ecwid_Static_Page::get_meta_description_html();
107
 
108
+ } else if ( Ecwid_Store_Page::is_store_page() ) {
109
+ $set_metadesc = false;
110
+ $set_metadesc = apply_filters( 'ecwid_set_mainpage_metadesc', $set_metadesc );
111
 
112
+ if( $set_metadesc ) {
113
+ $store_page_params = Ecwid_Store_Page::get_store_page_params();
114
+ if ( isset( $store_page_params['default_category_id'] ) && $store_page_params['default_category_id'] > 0 ) {
115
+
116
+ $description_html = Ecwid_Static_Page::get_meta_description_html();
117
+
118
+ } else {
119
+ $api = new Ecwid_Api_V3();
120
+ $profile = $api->get_store_profile();
121
+
122
+ if( !empty($profile->settings->storeDescription) ) {
123
+
124
+ $description = $profile->settings->storeDescription;
125
+ $description = Ecwid_HTML_Meta::process_raw_description( $description, ECWID_TRIMMED_DESCRIPTION_LENGTH );
126
+
127
+ $description_html = sprintf( '<meta name="description" content="%s" />', $description ) . PHP_EOL;
128
+ }
129
+ }
130
+ }
131
  }
 
132
 
133
+ if( $description_html ) {
134
+ echo $description_html;
135
+ }
136
+
137
+ return;
138
  }
139
 
140
+ protected function _print_og_tags() {
141
+ $og_tags_html = Ecwid_Static_Page::get_og_tags_html();
142
+
143
+ $site_name = $this->_get_site_name();
144
+ $og_tags_html = preg_replace(
145
+ '/(<meta property="og:site_name" content=").*?(" \/>)/',
146
+ '$1'.$site_name.'$2',
147
+ $og_tags_html
148
+ );
149
 
150
+ echo $og_tags_html;
151
  }
152
 
 
153
 
154
+ protected function _print_canonical() {
155
+ if ( get_option( 'ecwid_hide_canonical', false ) ) return;
156
+
157
+ $link = Ecwid_Static_Page::get_canonical_url();
158
 
159
+ if ( $link ) {
160
+ echo '<link rel="canonical" href="' . esc_attr($link) . '" />' . PHP_EOL;
161
+ }
162
+ }
163
 
164
+ protected function _print_json_ld() {
165
+ $json_ld = Ecwid_Static_Page::get_json_ld_html();
166
+ echo $json_ld;
167
+ }
168
 
169
+ protected function _print_ajax_crawling_fragment() {
 
 
 
170
 
171
+ if ( !Ecwid_Api_V3::is_available() ) return;
 
172
 
173
+ if ( isset( $_GET['_escaped_fragment_'] ) ) return;
 
 
 
 
 
174
 
175
+ if ( Ecwid_Seo_Links::is_enabled() ) return;
 
 
176
 
177
+ echo '<meta name="fragment" content="!">' . PHP_EOL;
 
 
 
 
 
 
 
 
 
 
 
178
  }
179
+
180
+ protected function _get_site_name() {
181
+ return get_bloginfo( 'name' );
 
182
  }
183
+ }
184
+
185
+ class Ecwid_HTML_Meta_Noindex extends Ecwid_HTML_Meta {
186
+ public function wp_head() {
187
+ $this->_print_prefetch();
188
+ echo '<meta name="robots" content="noindex">' . PHP_EOL;
189
  }
190
 
191
+ public function wp_head_last() {
192
+ return false;
 
193
  }
194
  }
195
 
196
+ class Ecwid_HTML_Meta_Other extends Ecwid_HTML_Meta {
197
+ public function wp_head() {
198
+ $this->_print_prefetch();
 
 
 
 
199
  }
200
 
201
+ protected function _print_prefetch() {
202
 
203
+ if( !$this->_is_available_prefetch_tags() ){
204
+ return;
205
+ }
206
+
207
+ $this->_print_dns_prefetch_control();
208
+
209
+ echo '<link href="https://d201eyh6wia12q.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
210
+ echo '<link href="https://d3fi9i0jj23cau.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
211
+ echo '<link href="https://dqzrr9k4bjpzk.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
212
+ echo '<link href="https://ecwid-static-ru.gcdn.co" rel="preconnect" crossorigin />' . PHP_EOL;
213
+ echo '<link href="https://ecwid-images-ru.gcdn.co" rel="preconnect" crossorigin />' . PHP_EOL;
214
+ echo '<link href="https://app.ecwid.com" rel="preconnect" crossorigin />' . PHP_EOL;
215
+
216
+ if ( Ecwid_Static_Page::is_enabled_static_home_page() && Ecwid_Static_Page::is_data_available() ) {
217
+ echo '<link href="https://d3j0zfs7paavns.cloudfront.net" rel="preconnect" crossorigin>' . PHP_EOL;
218
+
219
+ $css_files = Ecwid_Static_Page::get_css_files();
220
+
221
+ if( $css_files && is_array( $css_files ) ) {
222
+ foreach ( $css_files as $item ) {
223
+ echo sprintf( '<link rel="prefetch" href="%s">', $item ) . PHP_EOL;
224
+ }
225
+ }
226
+ }
227
+
228
+ if ( ecwid_is_store_page_available() ) {
229
+ $store_id = get_ecwid_store_id();
230
+ $params = ecwid_get_scriptjs_params();
231
 
232
+ $scriptjs_url = 'https://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?' . $store_id . $params;
233
+ echo sprintf( '<link rel="prefetch" href="%s" />', $scriptjs_url ) . PHP_EOL;
 
 
 
 
 
 
 
234
 
235
+ $page_url = Ecwid_Store_Page::get_store_url();
236
+ echo sprintf( '<link rel="prerender" href="%s" />', $page_url ) . PHP_EOL;
237
+ }
238
  }
 
239
 
240
+ public function wp_head_last() {
241
+ return false;
242
+ }
 
 
243
  }
244
 
245
  add_action( 'wp', array( 'Ecwid_HTML_Meta', 'maybe_create' ) );
includes/class-ecwid-product-browser.php CHANGED
@@ -312,31 +312,36 @@ class Ecwid_Product_Browser
312
  'chameleon_color_button' => array(
313
  'name' => 'chameleon_color_button',
314
  'title' => __( 'Button color', 'ecwid-shopping-cart' ),
315
- 'default' => get_option( 'ecwid_chameleon_colors_button' )
 
316
  ),
317
 
318
  'chameleon_color_foreground' => array(
319
  'name' => 'chameleon_color_foreground',
320
  'title' => __( 'Text color', 'ecwid-shopping-cart' ),
321
- 'default' => get_option( 'ecwid_chameleon_colors_foreground' )
 
322
  ),
323
 
324
  'chameleon_color_price' => array(
325
  'name' => 'chameleon_color_price',
326
  'title' => __( 'Price color', 'ecwid-shopping-cart' ),
327
- 'default' => get_option( 'ecwid_chameleon_colors_price' )
 
328
  ),
329
 
330
  'chameleon_color_link' => array(
331
  'name' => 'chameleon_color_link',
332
  'title' => __( 'Link color', 'ecwid-shopping-cart' ),
333
- 'default' => get_option( 'ecwid_chameleon_colors_link' )
 
334
  ),
335
 
336
  'chameleon_color_background' => array(
337
  'name' => 'chameleon_color_background',
338
  'title' => __( 'Background color', 'ecwid-shopping-cart' ),
339
- 'default' => get_option( 'ecwid_chameleon_colors_background' )
 
340
  ),
341
 
342
  'product_filters_position_search_page' => array(
312
  'chameleon_color_button' => array(
313
  'name' => 'chameleon_color_button',
314
  'title' => __( 'Button color', 'ecwid-shopping-cart' ),
315
+ 'default' => get_option( 'ecwid_chameleon_colors_button' ),
316
+ 'is_storefront_api' => true
317
  ),
318
 
319
  'chameleon_color_foreground' => array(
320
  'name' => 'chameleon_color_foreground',
321
  'title' => __( 'Text color', 'ecwid-shopping-cart' ),
322
+ 'default' => get_option( 'ecwid_chameleon_colors_foreground' ),
323
+ 'is_storefront_api' => true
324
  ),
325
 
326
  'chameleon_color_price' => array(
327
  'name' => 'chameleon_color_price',
328
  'title' => __( 'Price color', 'ecwid-shopping-cart' ),
329
+ 'default' => get_option( 'ecwid_chameleon_colors_price' ),
330
+ 'is_storefront_api' => true
331
  ),
332
 
333
  'chameleon_color_link' => array(
334
  'name' => 'chameleon_color_link',
335
  'title' => __( 'Link color', 'ecwid-shopping-cart' ),
336
+ 'default' => get_option( 'ecwid_chameleon_colors_link' ),
337
+ 'is_storefront_api' => true
338
  ),
339
 
340
  'chameleon_color_background' => array(
341
  'name' => 'chameleon_color_background',
342
  'title' => __( 'Background color', 'ecwid-shopping-cart' ),
343
+ 'default' => get_option( 'ecwid_chameleon_colors_background' ),
344
+ 'is_storefront_api' => true
345
  ),
346
 
347
  'product_filters_position_search_page' => array(
includes/class-ecwid-products.php CHANGED
@@ -56,6 +56,10 @@ class Ecwid_Products {
56
  add_option( self::OPTION_NO_IMAGES, false );
57
  }
58
 
 
 
 
 
59
  public function enqueue_frontend() {
60
  wp_enqueue_script('ecwid-product-page', ECWID_PLUGIN_URL . 'js/product.js', array('jquery'), get_option('ecwid_plugin_version'));
61
  wp_localize_script('ecwid-product-page', 'ecwidProduct', array(
@@ -63,13 +67,6 @@ class Ecwid_Products {
63
  ));
64
  }
65
 
66
- public function enqueue_admin() {
67
- wp_enqueue_script('ecwid-sync', ECWID_PLUGIN_URL . 'js/sync.js', array(), get_option('ecwid_plugin_version'));
68
- wp_localize_script( 'ecwid-sync', 'ecwidSync', array(
69
- 'syncLimit' => $this->sync_limit
70
- ));
71
- }
72
-
73
  public function replace_product_page_url_on_search( $url, $post, $leavename = false ) {
74
  if ( $post->post_type == self::POST_TYPE_PRODUCT ) {
75
  $new_url = $this->_get_post_link( $post->ID );
56
  add_option( self::OPTION_NO_IMAGES, false );
57
  }
58
 
59
+ public function enqueue_admin() {
60
+ EcwidPlatform::enqueue_style( 'sync.css' );
61
+ }
62
+
63
  public function enqueue_frontend() {
64
  wp_enqueue_script('ecwid-product-page', ECWID_PLUGIN_URL . 'js/product.js', array('jquery'), get_option('ecwid_plugin_version'));
65
  wp_localize_script('ecwid-product-page', 'ecwidProduct', array(
67
  ));
68
  }
69
 
 
 
 
 
 
 
 
70
  public function replace_product_page_url_on_search( $url, $post, $leavename = false ) {
71
  if ( $post->post_type == self::POST_TYPE_PRODUCT ) {
72
  $new_url = $this->_get_post_link( $post->ID );
includes/class-ecwid-seo-links.php CHANGED
@@ -55,7 +55,7 @@ class Ecwid_Seo_Links {
55
  return;
56
  }
57
 
58
- $id = @$_GET['post'];
59
 
60
  if ( !$id ) {
61
  return;
@@ -289,7 +289,7 @@ JS;
289
 
290
  $link = urldecode( self::_get_relative_permalink( get_the_ID() ) );
291
  $site_url = parse_url( get_bloginfo('url') );
292
- $site_path = $site_url['path'];
293
 
294
  foreach ( self::get_seo_links_patterns() as $pattern ) {
295
  $pattern = '#' . $site_path . preg_quote( $link ) . $pattern . '#';
@@ -413,11 +413,11 @@ JS;
413
  $base_urls[$page_id] = array();
414
  }
415
 
416
- $link = urldecode( self::_get_relative_permalink( $page_id ) );
417
-
418
  $base_urls[$page_id][] = $link;
419
  }
420
-
421
  if (
422
  is_plugin_active('polylang/polylang.php')
423
  && function_exists( 'PLL' )
@@ -443,7 +443,7 @@ JS;
443
  return $base_urls;
444
  }
445
 
446
- protected static function _get_relative_permalink( $item_id ) {
447
  $permalink = parse_url( get_permalink( $item_id ) );
448
  $home_url = parse_url( home_url() );
449
 
@@ -456,6 +456,10 @@ JS;
456
 
457
  $default_link = substr( $permalink['path'], strlen( $home_url['path'] ) );
458
 
 
 
 
 
459
  return apply_filters( 'ecwid_relative_permalink', $default_link, $item_id );
460
  }
461
 
55
  return;
56
  }
57
 
58
+ $id = (isset( $_GET['post'] )) ? $_GET['post'] : false;
59
 
60
  if ( !$id ) {
61
  return;
289
 
290
  $link = urldecode( self::_get_relative_permalink( get_the_ID() ) );
291
  $site_url = parse_url( get_bloginfo('url') );
292
+ $site_path = (isset($site_url['path'])) ? $site_url['path'] : '';
293
 
294
  foreach ( self::get_seo_links_patterns() as $pattern ) {
295
  $pattern = '#' . $site_path . preg_quote( $link ) . $pattern . '#';
413
  $base_urls[$page_id] = array();
414
  }
415
 
416
+ $link = urldecode( self::_get_relative_permalink( $page_id, true ) );
417
+
418
  $base_urls[$page_id][] = $link;
419
  }
420
+
421
  if (
422
  is_plugin_active('polylang/polylang.php')
423
  && function_exists( 'PLL' )
443
  return $base_urls;
444
  }
445
 
446
+ protected static function _get_relative_permalink( $item_id, $not_filter_return_value = false ) {
447
  $permalink = parse_url( get_permalink( $item_id ) );
448
  $home_url = parse_url( home_url() );
449
 
456
 
457
  $default_link = substr( $permalink['path'], strlen( $home_url['path'] ) );
458
 
459
+ if( $not_filter_return_value ) {
460
+ return $default_link;
461
+ }
462
+
463
  return apply_filters( 'ecwid_relative_permalink', $default_link, $item_id );
464
  }
465
 
includes/class-ecwid-static-page.php ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecwid_Static_Page {
4
+
5
+ const OPTION_IS_ENABLED = 'ecwid_static_home_page_enabled';
6
+
7
+ const OPTION_VALUE_ENABLED = 'Y';
8
+ const OPTION_VALUE_DISABLED = 'N';
9
+ const OPTION_VALUE_AUTO = '';
10
+
11
+ const PARAM_VALID_FROM = 'static_page_valid_from';
12
+
13
+ const HANDLE_STATIC_PAGE = 'static-page';
14
+ const API_URL = 'https://storefront.ecwid.com/';
15
+
16
+ protected $_has_theme_adjustments = false;
17
+
18
+ public function __construct() {
19
+ add_option( self::OPTION_IS_ENABLED );
20
+
21
+ if ( !is_admin() ) {
22
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
23
+ add_action( Ecwid_Theme_Base::ACTION_APPLY_THEME, array( $this, 'apply_theme' ) );
24
+ }
25
+ }
26
+
27
+ public function enqueue_scripts()
28
+ {
29
+ if ( !self::is_enabled_static_home_page() ) {
30
+ return null;
31
+ }
32
+
33
+ if( !self::is_data_available() ) {
34
+ return null;
35
+ }
36
+
37
+ EcwidPlatform::enqueue_script( self::HANDLE_STATIC_PAGE, array() );
38
+
39
+ $css_files = self::get_css_files();
40
+
41
+ if( $css_files && is_array( $css_files ) ) {
42
+ foreach ( $css_files as $index => $item ) {
43
+ wp_enqueue_style( 'ecwid-' . self::HANDLE_STATIC_PAGE . '-' . $index, $item );
44
+ }
45
+ }
46
+ }
47
+
48
+ public function apply_theme( $theme ) {
49
+ if ( $theme ) {
50
+ $this->_has_theme_adjustments = true;
51
+ }
52
+ }
53
+
54
+ public static function get_data_for_current_page()
55
+ {
56
+ if ( current_user_can( Ecwid_Admin::get_capability() ) ) {
57
+ EcwidPlatform::force_catalog_cache_reset();
58
+ }
59
+
60
+ $data = self::_maybe_fetch_data();
61
+
62
+ return $data;
63
+ }
64
+
65
+ protected static function _get_endpoint_url( $params = false ){
66
+
67
+ if( !$params ) {
68
+ if ( ecwid_is_applicable_escaped_fragment() ) {
69
+ $params = ecwid_parse_escaped_fragment( $_GET['_escaped_fragment_'] );
70
+ } else {
71
+ $params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
72
+ }
73
+ }
74
+
75
+ if( !isset( $params['mode'] ) ) {
76
+ $params['mode'] = 'home';
77
+ }
78
+
79
+ $url = self::API_URL;
80
+ $url .= sprintf( '%s-page/', $params['mode'] );
81
+ $url .= sprintf( '%s/', get_ecwid_store_id() );
82
+
83
+ if( isset( $params['id'] ) ) {
84
+ $url .= sprintf( '%s/', $params['id'] );
85
+ }
86
+
87
+ $url .= 'static-code?';
88
+
89
+ return $url;
90
+ }
91
+
92
+ protected static function _maybe_fetch_data()
93
+ {
94
+ $store_page_params = Ecwid_Store_Page::get_store_page_params();
95
+ $endpoint_params = false;
96
+
97
+ $params = array();
98
+
99
+ if ( Ecwid_Seo_Links::is_enabled() ) {
100
+ $params['clean_links'] = 'true';
101
+ $params['base_url'] = get_permalink();
102
+ }
103
+
104
+ $accept_language = apply_filters( 'ecwid_lang', $_SERVER['HTTP_ACCEPT_LANGUAGE'] );
105
+ $params['lang'] = $accept_language;
106
+
107
+ foreach ( Ecwid_Product_Browser::get_attributes() as $attribute ) {
108
+ $name = $attribute['name'];
109
+ if ( @$attribute['is_storefront_api'] && isset( $store_page_params[$name] ) ) {
110
+ if ( @$attribute['type'] == 'boolean' ) {
111
+ $value = $store_page_params[$name] ? 'true' : 'false';
112
+ } else {
113
+ $value = $store_page_params[$name];
114
+ }
115
+
116
+ if( strpos($name, 'chameleon') !== false ) {
117
+ $name = str_replace('chameleon_', '', $name);
118
+ $params['tplvar_ec.chameleon.' . $name] = $value;
119
+ } else {
120
+ $params['tplvar_ec.storefront.' . $name] = $value;
121
+ }
122
+ }
123
+ }
124
+
125
+
126
+ if( !empty( $_COOKIE['ec_store_chameleon_font'] ) ) {
127
+ $params['tplvar_ec.chameleon.font_family'] = stripslashes( $_COOKIE['ec_store_chameleon_font'] );
128
+ }
129
+
130
+
131
+ $hreflang_items = apply_filters( 'ecwid_hreflangs', null );
132
+
133
+ if( !empty( $hreflang_items ) ) {
134
+ foreach ($hreflang_items as $lang => $link) {
135
+ $params['international_pages[' . $lang . ']'] = $link;
136
+ }
137
+ }
138
+
139
+
140
+ $url = self::_get_endpoint_url( $endpoint_params );
141
+
142
+ foreach ( $params as $name => $value ) {
143
+ $url .= $name . '=' . urlencode( $value ) . '&';
144
+ }
145
+
146
+ $url = substr( $url, 0, -1 );
147
+
148
+ $cache_key = $url;
149
+ $cached_data = EcwidPlatform::get_from_catalog_cache( $cache_key );
150
+
151
+ if ( $cached_data ) {
152
+ return $cached_data;
153
+ }
154
+
155
+ $fetched_data = null;
156
+
157
+ $fetched_data = EcwidPlatform::fetch_url(
158
+ $url,
159
+ array(
160
+ 'timeout' => 3,
161
+ 'headers' => array(
162
+ 'ACCEPT-LANGUAGE' => $accept_language
163
+ )
164
+ )
165
+ );
166
+
167
+ if ( $fetched_data && @$fetched_data['data'] ) {
168
+
169
+ $fetched_data = @json_decode( $fetched_data['data'] );
170
+
171
+ EcwidPlatform::store_in_catalog_cache( $cache_key, $fetched_data );
172
+
173
+ return $fetched_data;
174
+ }
175
+
176
+ return null;
177
+ }
178
+
179
+
180
+ public static function _get_data_field( $field ) {
181
+ $data = self::get_data_for_current_page();
182
+
183
+ if( isset( $data->$field ) ) {
184
+ $data->$field = apply_filters( 'ecwid_static_page_field_' . strtolower($field), $data->$field );
185
+ return $data->$field;
186
+ }
187
+
188
+ return false;
189
+ }
190
+
191
+ public static function get_css_files() {
192
+ return self::_get_data_field( 'cssFiles' );
193
+ }
194
+
195
+ public static function get_html_code() {
196
+ return self::_get_data_field( 'htmlCode' );
197
+ }
198
+
199
+ public static function get_js_code() {
200
+ return self::_get_data_field( 'jsCode' );
201
+ }
202
+
203
+ public static function get_title() {
204
+ $title = self::_get_data_field( 'metaDescriptionHtml' );
205
+
206
+ if( $title ) {
207
+ $title = preg_replace( '/<title>(.*?)<\/title>(.*)/is', '$1', $title );
208
+ $title = trim( $title );
209
+ }
210
+
211
+ return $title;
212
+ }
213
+
214
+ public static function get_meta_description_html() {
215
+ $description = self::_get_data_field( 'metaDescriptionHtml' );
216
+
217
+ if( $description ) {
218
+ $description = preg_replace( '/<title>.*?<\/title>/i', '', $description );
219
+ }
220
+
221
+ return $description;
222
+ }
223
+
224
+ public static function get_canonical_url() {
225
+ return self::_get_data_field( 'canonicalUrl' );
226
+ }
227
+
228
+ public static function get_og_tags_html() {
229
+ return self::_get_data_field( 'ogTagsHtml' );
230
+ }
231
+
232
+ public static function get_json_ld_html() {
233
+ return self::_get_data_field( 'jsonLDHtml' );
234
+ }
235
+
236
+ public static function get_href_lang_html() {
237
+ return self::_get_data_field( 'hrefLangHtml' );
238
+ }
239
+
240
+ public static function get_last_update() {
241
+ return self::_get_data_field( 'lastUpdated' );
242
+ }
243
+
244
+ public static function is_data_available() {
245
+ if( self::get_last_update() ){
246
+ return true;
247
+ }
248
+
249
+ return false;
250
+ }
251
+
252
+ public static function is_enabled_static_home_page()
253
+ {
254
+ $is_home_page = empty( Ecwid_Seo_Links::maybe_extract_html_catalog_params() );
255
+ if( !$is_home_page ) {
256
+ return false;
257
+ }
258
+
259
+ $store_page_params = Ecwid_Store_Page::get_store_page_params();
260
+ if ( @$store_page_params['default_category_id'] || @$store_page_params['default_product_id'] ) {
261
+ return false;
262
+ }
263
+
264
+ if ( array_key_exists( 'ec-enable-static-page', $_GET ) ) {
265
+ return true;
266
+ }
267
+
268
+ if ( !EcwidPlatform::is_catalog_cache_trusted() ) {
269
+ return false;
270
+ }
271
+
272
+ if ( get_option( self::OPTION_IS_ENABLED ) == self::OPTION_VALUE_ENABLED ) {
273
+ return true;
274
+ }
275
+
276
+ if ( !self::is_feature_available() ) {
277
+ return false;
278
+ }
279
+
280
+ if ( get_option( self::OPTION_IS_ENABLED ) == self::OPTION_VALUE_DISABLED ) {
281
+ return false;
282
+ }
283
+
284
+ if ( 0 && get_ecwid_store_id() > 15182050 && get_ecwid_store_id() % 2 == 0 ) {
285
+ return true;
286
+ }
287
+
288
+ return false;
289
+ }
290
+
291
+ public static function is_feature_available()
292
+ {
293
+ $api = new Ecwid_Api_V3();
294
+
295
+ return $api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_STATIC_HOME_PAGE )
296
+ && $api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_PRODUCT_LIST );
297
+ }
298
+
299
+ }
300
+
301
+ $__ecwid_static_page = new Ecwid_Static_Page();
includes/gutenberg/class-ecwid-gutenberg-block-minicart.php CHANGED
@@ -41,7 +41,9 @@ class Ecwid_Gutenberg_Block_Minicart extends Ecwid_Gutenberg_Block_Base {
41
  ></div>
42
 
43
  <script>
44
- Ecwid.init();
 
 
45
  </script>
46
  <!-- /noptimize -->
47
  <?php
41
  ></div>
42
 
43
  <script>
44
+ if (typeof Ecwid != 'undefined'){
45
+ Ecwid.init();
46
+ }
47
  </script>
48
  <!-- /noptimize -->
49
  <?php
includes/gutenberg/class-ecwid-gutenberg-block-store.php CHANGED
@@ -52,10 +52,10 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
52
  $result = "[ecwid";
53
 
54
  $params['widgets'] = 'productbrowser';
55
- if ( @$params['show_categories'] ) {
56
  $params['widgets'] .= ' categories';
57
  }
58
- if ( @$params['show_search'] ) {
59
  $params['widgets'] .= ' search';
60
  }
61
 
@@ -90,9 +90,9 @@ HTML;
90
 
91
  if ( $name == 'show_description_under_image' ) {
92
  $attribute['is_storefront_api'] = true;
93
- $value = !@$params[$name];
94
 
95
- $layout = @$params['product_details_layout'];
96
  if ( is_null( $layout ) ) {
97
  $layout = $attributes['product_details_layout']['default'];
98
  }
@@ -106,7 +106,7 @@ HTML;
106
  }
107
  }
108
 
109
- if ( @$attribute['is_storefront_api'] ) {
110
 
111
  if ( is_null( $value ) ) {
112
  $value = $attribute['default'];
@@ -129,7 +129,7 @@ HTML;
129
 
130
  $colors = array();
131
  foreach ( array( 'foreground', 'background', 'link', 'price', 'button' ) as $kind ) {
132
- $color = @$params['chameleon_color_' . $kind];
133
  if ( $color ) {
134
  $colors['color-' . $kind] = $color;
135
  }
52
  $result = "[ecwid";
53
 
54
  $params['widgets'] = 'productbrowser';
55
+ if ( isset($params['show_categories']) ) {
56
  $params['widgets'] .= ' categories';
57
  }
58
+ if ( isset($params['show_search']) ) {
59
  $params['widgets'] .= ' search';
60
  }
61
 
90
 
91
  if ( $name == 'show_description_under_image' ) {
92
  $attribute['is_storefront_api'] = true;
93
+ $value = isset( $params[$name] ) ? !$params[$name] : true;
94
 
95
+ $layout = ( isset($params['product_details_layout']) ) ? $params['product_details_layout'] : null;
96
  if ( is_null( $layout ) ) {
97
  $layout = $attributes['product_details_layout']['default'];
98
  }
106
  }
107
  }
108
 
109
+ if ( isset($attribute['is_storefront_api']) && $attribute['is_storefront_api'] ) {
110
 
111
  if ( is_null( $value ) ) {
112
  $value = $attribute['default'];
129
 
130
  $colors = array();
131
  foreach ( array( 'foreground', 'background', 'link', 'price', 'button' ) as $kind ) {
132
+ $color = ( isset($params['chameleon_color_' . $kind]) ) ? $params['chameleon_color_' . $kind] : false;
133
  if ( $color ) {
134
  $colors['color-' . $kind] = $color;
135
  }
includes/gutenberg/class-ecwid-gutenberg.php CHANGED
@@ -268,11 +268,11 @@ class Ecwid_Gutenberg {
268
  return $store_block['atts'];
269
  }
270
 
271
- public function has_content_productbrowser( $content ) {
272
 
273
  $blocks_with_productbrowser = Ecwid_Gutenberg::get_block_names( true );
274
 
275
- foreach ($blocks_with_productbrowser as $block_name) {
276
  if( strpos( $content, $block_name ) !== false ) {
277
  return true;
278
  }
268
  return $store_block['atts'];
269
  }
270
 
271
+ public static function content_has_productbrowser( $content ) {
272
 
273
  $blocks_with_productbrowser = Ecwid_Gutenberg::get_block_names( true );
274
 
275
+ foreach ( $blocks_with_productbrowser as $block_name ) {
276
  if( strpos( $content, $block_name ) !== false ) {
277
  return true;
278
  }
includes/importer/class-ecwid-importer.php CHANGED
@@ -104,9 +104,28 @@ class Ecwid_Importer
104
  }
105
 
106
  if ( !isset( $progress['error_messages'][$task_data['type']][$message] ) ) {
107
- $progress['error_messages'][$task_data['type']][$message] = 0;
108
  }
109
- $progress['error_messages'][$task_data['type']][$message]++;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  } else {
111
  $progress['success'][] = $task_data['type'];
112
  }
@@ -162,20 +181,28 @@ class Ecwid_Importer
162
  *
163
  * @param $task
164
  */
 
 
 
 
 
 
165
  public function append_child( $task ) {
166
  $ind = $this->_get_current_task();
167
 
 
 
168
  $ind++;
169
- while ( isset( $this->_tasks[$ind] ) && $this->_tasks[$ind]['type'] == $task['type'] ) {
170
  $ind++;
171
  }
172
-
173
- return $this->append_after( $task, $ind );
174
  }
175
-
176
  public function append_after( $task, $index ) {
177
  array_splice( $this->_tasks, $index + 1, 0, array( $task ) );
178
-
179
  return $index + 1;
180
  }
181
 
104
  }
105
 
106
  if ( !isset( $progress['error_messages'][$task_data['type']][$message] ) ) {
107
+ $progress['error_messages'][$task_data['type']][$message] = [];
108
  }
109
+
110
+ $error_data = array();
111
+ if ( $task instanceof Ecwid_Importer_Task_Product_Base ) {
112
+ $error_data['woo_id'] = $task->get_woo_id();
113
+ $error_data['woo_link'] = $task->get_woo_link();
114
+ $error_data['name'] = $task->get_product_name();
115
+
116
+ if ( $task->get_ecwid_id() ) {
117
+ $error_data['ecwid_id'] = $task->get_ecwid_id();
118
+ $error_data['ecwid_link'] = $task->get_ecwid_link();
119
+ }
120
+
121
+ if ( $task instanceof Ecwid_Importer_Task_Create_Product_Variation || $task instanceof Ecwid_Importer_Task_Upload_Product_Variation_Image ) {
122
+ $error_data['variation_id'] = $task_data['variation_id'];
123
+ }
124
+ } else {
125
+ $error_data = $task_data;
126
+ }
127
+
128
+ $progress['error_messages'][$task_data['type']][$message][] = $error_data;
129
  } else {
130
  $progress['success'][] = $task_data['type'];
131
  }
181
  *
182
  * @param $task
183
  */
184
+ /**
185
+ * Appends $task as a child of current task. It skips current task, skips all task with the same type
186
+ * and appends $task after all its siblings
187
+ *
188
+ * @param $task
189
+ */
190
  public function append_child( $task ) {
191
  $ind = $this->_get_current_task();
192
 
193
+ $this_task = $this->_tasks[$ind];
194
+
195
  $ind++;
196
+ while ( isset( $this->_tasks[$ind] ) && ( $this->_tasks[$ind]['type'] == $task['type'] || $this->_tasks[$ind]['type'] == $this_task['type'] ) ) {
197
  $ind++;
198
  }
199
+
200
+ return $this->append_after( $task, $ind - 1 );
201
  }
202
+
203
  public function append_after( $task, $index ) {
204
  array_splice( $this->_tasks, $index + 1, 0, array( $task ) );
205
+
206
  return $index + 1;
207
  }
208
 
includes/importer/task/class-ecwid-importer-task-create-product-variation.php CHANGED
@@ -1,23 +1,26 @@
1
  <?php
2
 
3
- class Ecwid_Importer_Task_Create_Product_Variation extends Ecwid_Importer_Task
4
  {
5
  public static $type = 'create_variation';
6
 
7
  public function execute( Ecwid_Importer $exporter, array $data ) {
8
  $api = new Ecwid_Api_V3();
9
-
10
- $p = wc_get_product( $data['woo_id'] );
 
 
 
11
  $attributes = $p->get_attributes();
12
  $vars = $p->get_available_variations();
13
 
14
  $variation_data = array(
15
- 'productId' => $exporter->get_ecwid_product_id( $data['woo_id'] ),
16
  'options' => array()
17
  );
18
 
19
  foreach ( $vars as $var ) {
20
- if ( $var['variation_id'] != $data['var_id'] ) {
21
  continue;
22
  }
23
 
@@ -65,7 +68,7 @@ class Ecwid_Importer_Task_Create_Product_Variation extends Ecwid_Importer_Task
65
  if ( $return['status'] == self::STATUS_SUCCESS ) {
66
  $result_object = json_decode( $result['body'] );
67
 
68
- update_post_meta( $data['var_id'], '_ecwid_variation_id', $result_object->id );
69
  }
70
 
71
  return $return;
@@ -75,7 +78,7 @@ class Ecwid_Importer_Task_Create_Product_Variation extends Ecwid_Importer_Task
75
  return array(
76
  'type' => self::$type,
77
  'woo_id' => $data['woo_id'],
78
- 'var_id' => $data['var_id']
79
  );
80
  }
81
  }
1
  <?php
2
 
3
+ class Ecwid_Importer_Task_Create_Product_Variation extends Ecwid_Importer_Task_Product_Base
4
  {
5
  public static $type = 'create_variation';
6
 
7
  public function execute( Ecwid_Importer $exporter, array $data ) {
8
  $api = new Ecwid_Api_V3();
9
+
10
+ $this->_woo_product_id = $data['woo_id'];
11
+ $this->_ecwid_product_id = $exporter->get_ecwid_product_id( $this->get_woo_id() );
12
+
13
+ $p = wc_get_product( $this->get_woo_id() );
14
  $attributes = $p->get_attributes();
15
  $vars = $p->get_available_variations();
16
 
17
  $variation_data = array(
18
+ 'productId' => $this->get_ecwid_id(),
19
  'options' => array()
20
  );
21
 
22
  foreach ( $vars as $var ) {
23
+ if ( $var['variation_id'] != $data['variation_id'] ) {
24
  continue;
25
  }
26
 
68
  if ( $return['status'] == self::STATUS_SUCCESS ) {
69
  $result_object = json_decode( $result['body'] );
70
 
71
+ update_post_meta( $data['variation_id'], '_ecwid_variation_id', $result_object->id );
72
  }
73
 
74
  return $return;
78
  return array(
79
  'type' => self::$type,
80
  'woo_id' => $data['woo_id'],
81
+ 'variation_id' => $data['variation_id']
82
  );
83
  }
84
  }
includes/importer/task/class-ecwid-importer-task-create-product.php CHANGED
@@ -1,48 +1,45 @@
1
  <?php
2
 
3
- class Ecwid_Importer_Task_Create_Product extends Ecwid_Importer_Task
4
  {
5
  public static $type = 'create_product';
6
 
7
  const WC_PRODUCT_TYPE_VARIABLE = 'variable';
8
 
9
  public function execute( Ecwid_Importer $exporter, array $product_data ) {
10
-
11
- $api = new Ecwid_Api_V3( );
12
-
13
- $woo_id = $product_data['woo_id'];
14
-
15
- $post = get_post( $woo_id );
16
- $product = wc_get_product( $woo_id );
17
 
18
  $data = array(
19
- 'name' => $post->post_title,
20
- 'price' => get_post_meta( $woo_id, '_regular_price', true ),
21
  'description' => $product->get_description(),
22
- 'isShippingRequired' => get_post_meta( $woo_id, '_virtual', true ) != 'yes',
23
  'categoryIds' => array(),
24
  'showOnFrontpage' => (int) $product->get_featured()
25
  );
26
-
27
- $meta = get_post_meta( $woo_id, '_sku', true );
28
- if ( !empty( $meta ) ) {
29
- $data['sku'] = get_post_meta( $woo_id, '_sku', true );
30
  }
31
 
32
- if ( get_post_meta( $woo_id, '_manage_stock', true ) == 'yes' ) {
33
  $data['unlimited'] = false;
34
- $data['quantity'] = intval( get_post_meta( $woo_id, '_stock', true ) );
35
  } else {
36
  $data['unlimited'] = true;
37
  }
38
 
39
  if ($product->get_type() == self::WC_PRODUCT_TYPE_VARIABLE ) {
40
- $data = array_merge( $data, $this->_get_variable_product_data( $woo_id ) );
41
  }
42
 
43
  $data['price'] = floatval( $data['price'] );
44
 
45
- $categories = get_the_terms( $woo_id, 'product_cat' );
46
 
47
  if ( $categories ) foreach ( $categories as $category ) {
48
  $category_id = $exporter->get_ecwid_category_id( $category->term_id );
@@ -59,13 +56,15 @@ class Ecwid_Importer_Task_Create_Product extends Ecwid_Importer_Task
59
  $result = null;
60
  $ecwid_id = null;
61
 
 
 
62
  if ( $exporter->get_setting( Ecwid_Importer::SETTING_UPDATE_BY_SKU ) ) {
63
  $products = $api->get_products( array( 'sku' => $data['sku'] ) );
64
 
65
  if ( $products->total > 0 ) {
66
  $ecwid_id = $products->items[0]->id;
67
  $result = $api->update_product( $data, $ecwid_id );
68
- $exporter->save_ecwid_product_id( $woo_id, $ecwid_id );
69
  }
70
  }
71
 
@@ -74,7 +73,7 @@ class Ecwid_Importer_Task_Create_Product extends Ecwid_Importer_Task
74
 
75
  if ( !$this->_is_api_result_error($result) ) {
76
  $result_object = json_decode( $result['body'] );
77
- $ecwid_product_id = $result_object->id;
78
  }
79
  }
80
 
@@ -82,16 +81,19 @@ class Ecwid_Importer_Task_Create_Product extends Ecwid_Importer_Task
82
 
83
  if ( $return['status'] == self::STATUS_SUCCESS ) {
84
  $result_object = json_decode( $result['body'] );
 
 
85
 
86
- update_post_meta( $woo_id, '_ecwid_product_id', $ecwid_id ? $ecwid_id : $result_object->id );
87
- $exporter->save_ecwid_product_id( $woo_id, $ecwid_id ? $ecwid_id : $result_object->id );
88
  }
89
 
90
  return $return;
91
  }
92
 
93
- public function _get_variable_product_data( $id )
94
  {
 
95
  $result = array();
96
 
97
  $product = new WC_Product_Variable( $id );
1
  <?php
2
 
3
+ class Ecwid_Importer_Task_Create_Product extends Ecwid_Importer_Task_Product_Base
4
  {
5
  public static $type = 'create_product';
6
 
7
  const WC_PRODUCT_TYPE_VARIABLE = 'variable';
8
 
9
  public function execute( Ecwid_Importer $exporter, array $product_data ) {
10
+
11
+ $this->_woo_product_id = $product_data['woo_id'];
12
+
13
+ $product = wc_get_product( $this->_woo_product_id );
 
 
 
14
 
15
  $data = array(
16
+ 'name' => $product->get_title(),
17
+ 'price' => $product->get_regular_price(),
18
  'description' => $product->get_description(),
19
+ 'isShippingRequired' => !$product->get_virtual(),
20
  'categoryIds' => array(),
21
  'showOnFrontpage' => (int) $product->get_featured()
22
  );
23
+
24
+ $sku = $product->get_sku();
25
+ if ( $sku ) {
26
+ $data['sku'] = $sku;
27
  }
28
 
29
+ if ( $product->get_manage_stock() ) {
30
  $data['unlimited'] = false;
31
+ $data['quantity'] = $product->get_stock_quantity();
32
  } else {
33
  $data['unlimited'] = true;
34
  }
35
 
36
  if ($product->get_type() == self::WC_PRODUCT_TYPE_VARIABLE ) {
37
+ $data = array_merge( $data, $this->_get_variable_product_data( $this->_woo_product_id ) );
38
  }
39
 
40
  $data['price'] = floatval( $data['price'] );
41
 
42
+ $categories = get_the_terms( $this->_woo_product_id, 'product_cat' );
43
 
44
  if ( $categories ) foreach ( $categories as $category ) {
45
  $category_id = $exporter->get_ecwid_category_id( $category->term_id );
56
  $result = null;
57
  $ecwid_id = null;
58
 
59
+ $api = new Ecwid_Api_V3();
60
+
61
  if ( $exporter->get_setting( Ecwid_Importer::SETTING_UPDATE_BY_SKU ) ) {
62
  $products = $api->get_products( array( 'sku' => $data['sku'] ) );
63
 
64
  if ( $products->total > 0 ) {
65
  $ecwid_id = $products->items[0]->id;
66
  $result = $api->update_product( $data, $ecwid_id );
67
+ $exporter->save_ecwid_product_id( $this->get_woo_id(), $ecwid_id );
68
  }
69
  }
70
 
73
 
74
  if ( !$this->_is_api_result_error($result) ) {
75
  $result_object = json_decode( $result['body'] );
76
+ $ecwid_id = $result_object->id;
77
  }
78
  }
79
 
81
 
82
  if ( $return['status'] == self::STATUS_SUCCESS ) {
83
  $result_object = json_decode( $result['body'] );
84
+
85
+ $this->_ecwid_product_id = $ecwid_id;
86
 
87
+ update_post_meta( $this->get_woo_id(), '_ecwid_product_id', $ecwid_id );
88
+ $exporter->save_ecwid_product_id( $this->get_woo_id(), $ecwid_id ? $ecwid_id : $result_object->id );
89
  }
90
 
91
  return $return;
92
  }
93
 
94
+ public function _get_variable_product_data( )
95
  {
96
+ $id = $this->get_woo_id();
97
  $result = array();
98
 
99
  $product = new WC_Product_Variable( $id );
includes/importer/task/class-ecwid-importer-task-import-woo-product.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class Ecwid_Importer_Task_Import_Woo_Product extends Ecwid_Importer_Task {
4
 
5
  public static $type = 'import-woo-product';
6
 
@@ -13,6 +13,8 @@ class Ecwid_Importer_Task_Import_Woo_Product extends Ecwid_Importer_Task {
13
 
14
  public function execute( Ecwid_Importer $importer, array $product ) {
15
 
 
 
16
  $importer->append_task(
17
  Ecwid_Importer_Task_Create_Product::build(
18
  array(
@@ -43,7 +45,7 @@ class Ecwid_Importer_Task_Import_Woo_Product extends Ecwid_Importer_Task {
43
  Ecwid_Importer_Task_Create_Product_Variation::build(
44
  array(
45
  'woo_id' => $product['woo_id'],
46
- 'var_id' => $var['variation_id']
47
  )
48
  )
49
  );
1
  <?php
2
 
3
+ class Ecwid_Importer_Task_Import_Woo_Product extends Ecwid_Importer_Task_Product_Base {
4
 
5
  public static $type = 'import-woo-product';
6
 
13
 
14
  public function execute( Ecwid_Importer $importer, array $product ) {
15
 
16
+ $this->_woo_product_id = $product['woo_id'];
17
+
18
  $importer->append_task(
19
  Ecwid_Importer_Task_Create_Product::build(
20
  array(
45
  Ecwid_Importer_Task_Create_Product_Variation::build(
46
  array(
47
  'woo_id' => $product['woo_id'],
48
+ 'variation_id' => $var['variation_id']
49
  )
50
  )
51
  );
includes/importer/task/class-ecwid-importer-task-product-base.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class Ecwid_Importer_Task_Product_Base extends Ecwid_Importer_Task {
4
+ protected $_woo_product_id;
5
+ protected $_ecwid_product_id;
6
+
7
+ public function get_woo_id() {
8
+ return $this->_woo_product_id;
9
+ }
10
+
11
+ public function get_ecwid_id() {
12
+ return $this->_ecwid_product_id;
13
+ }
14
+
15
+ public function get_product_name() {
16
+ if ( !$this->get_woo_id() ) return null;
17
+
18
+ $product = wc_get_product( $this->get_woo_id() );
19
+
20
+ return $product->get_title();
21
+ }
22
+
23
+ public function get_woo_link() {
24
+ if ( !$this->get_woo_id() ) return null;
25
+
26
+ return admin_url( 'post.php?post=' . $this->get_woo_id() . '&action=edit' );
27
+ }
28
+
29
+ public function get_ecwid_link() {
30
+ if ( !$this->get_ecwid_id() ) return null;
31
+
32
+ $url = 'admin.php?page=' . Ecwid_Admin::ADMIN_SLUG . '&ec-store-page=';
33
+
34
+ $url .= urlencode( 'product:mode=edit&id=' . $this->get_ecwid_id() );
35
+
36
+ return admin_url( $url );
37
+ }
38
+ }
includes/importer/task/class-ecwid-importer-task-upload-product-gallery-image.php CHANGED
@@ -1,17 +1,16 @@
1
  <?php
2
 
3
- class Ecwid_Importer_Task_Upload_Product_Gallery_Image extends Ecwid_Importer_Task
4
  {
5
  public static $type = 'upload_product_gallery_image';
6
 
7
  public function execute( Ecwid_Importer $exporter, array $product_data ) {
8
  $api = new Ecwid_Api_V3();
9
-
10
- $file = get_attached_file( $product_data['image_id'] );
11
-
12
- $product_id = get_post_meta( $product_data['product_id'], '_ecwid_product_id', true );
13
-
14
- if ( !$product_id ) {
15
  return array(
16
  'status' => 'error',
17
  'data' => 'skipped',
@@ -19,16 +18,18 @@ class Ecwid_Importer_Task_Upload_Product_Gallery_Image extends Ecwid_Importer_Ta
19
  );
20
  }
21
 
 
 
22
  if ( !$file || !file_exists( $file ) || !is_readable( $file ) ) {
23
  return array(
24
  'status' => 'error',
25
  'data' => 'skipped',
26
- 'message' => 'File not found for product#' . $product_data['product_id'] . ' image ' . $product_data['image_id']
27
  );
28
  }
29
 
30
  $data = array(
31
- 'productId' => $product_id,
32
  'data' => file_get_contents( $file )
33
  );
34
 
1
  <?php
2
 
3
+ class Ecwid_Importer_Task_Upload_Product_Gallery_Image extends Ecwid_Importer_Task_Product_Base
4
  {
5
  public static $type = 'upload_product_gallery_image';
6
 
7
  public function execute( Ecwid_Importer $exporter, array $product_data ) {
8
  $api = new Ecwid_Api_V3();
9
+
10
+ $this->_woo_product_id = $product_data['product_id'];
11
+ $this->_ecwid_product_id = get_post_meta( $this->_woo_product_id, '_ecwid_product_id', true );
12
+
13
+ if ( !$this->_ecwid_product_id ) {
 
14
  return array(
15
  'status' => 'error',
16
  'data' => 'skipped',
18
  );
19
  }
20
 
21
+ $file = get_attached_file( $product_data['image_id'] );
22
+
23
  if ( !$file || !file_exists( $file ) || !is_readable( $file ) ) {
24
  return array(
25
  'status' => 'error',
26
  'data' => 'skipped',
27
+ 'message' => 'File not found for product#' . $this->_woo_product_id . ' image ' . $product_data['image_id']
28
  );
29
  }
30
 
31
  $data = array(
32
+ 'productId' => $this->_ecwid_product_id,
33
  'data' => file_get_contents( $file )
34
  );
35
 
includes/importer/task/class-ecwid-importer-task-upload-product-image.php CHANGED
@@ -1,25 +1,28 @@
1
  <?php
2
 
3
- class Ecwid_Importer_Task_Upload_Product_Image extends Ecwid_Importer_Task
4
  {
5
  public static $type = 'upload_product_image';
6
 
7
  public function execute( Ecwid_Importer $exporter, array $product_data ) {
8
- $api = new Ecwid_Api_V3();
9
-
10
- $file = get_attached_file ( get_post_thumbnail_id( $product_data['woo_id'] ) );
11
 
12
- $product_id = $exporter->get_ecwid_product_id( $product_data['woo_id'] );
13
- if ( !$product_id ) {
14
  return array(
15
  'status' => 'error',
16
  'data' => 'skipped',
17
  'message' => 'Parent product was not imported for product #' . $product_data['woo_id']
18
  );
19
  }
 
 
 
 
20
 
21
  $data = array(
22
- 'productId' => $product_id,
23
  'data' => file_get_contents( $file )
24
  );
25
 
1
  <?php
2
 
3
+ class Ecwid_Importer_Task_Upload_Product_Image extends Ecwid_Importer_Task_Product_Base
4
  {
5
  public static $type = 'upload_product_image';
6
 
7
  public function execute( Ecwid_Importer $exporter, array $product_data ) {
8
+
9
+ $this->_woo_product_id = $product_data['woo_id'];
10
+ $this->_ecwid_product_id = $exporter->get_ecwid_product_id( $product_data['woo_id'] );
11
 
12
+ if ( !$this->_ecwid_product_id ) {
 
13
  return array(
14
  'status' => 'error',
15
  'data' => 'skipped',
16
  'message' => 'Parent product was not imported for product #' . $product_data['woo_id']
17
  );
18
  }
19
+
20
+ $api = new Ecwid_Api_V3();
21
+
22
+ $file = get_attached_file ( get_post_thumbnail_id( $product_data['woo_id'] ) );
23
 
24
  $data = array(
25
+ 'productId' => $this->_ecwid_product_id,
26
  'data' => file_get_contents( $file )
27
  );
28
 
includes/importer/task/class-ecwid-importer-task-upload-product-variation-image.php CHANGED
@@ -1,18 +1,16 @@
1
  <?php
2
 
3
- class Ecwid_Importer_Task_Upload_Product_Variation_Image extends Ecwid_Importer_Task
4
  {
5
  public static $type = 'upload_product_variation_image';
6
 
7
  public function execute( Ecwid_Importer $exporter, array $data ) {
8
  $api = new Ecwid_Api_V3();
9
 
10
- $product_id = get_post_meta( $data['product_id'], '_ecwid_product_id', true );
11
- $variation_id = get_post_meta( $data['variation_id'], '_ecwid_variation_id', true );
12
-
13
- $file = get_attached_file ( get_post_thumbnail_id( $data['variation_id'] ) );
14
 
15
- if ( !$product_id ) {
16
  return array(
17
  'status' => 'error',
18
  'data' => 'skipped',
@@ -20,6 +18,11 @@ class Ecwid_Importer_Task_Upload_Product_Variation_Image extends Ecwid_Importer_
20
  );
21
  }
22
 
 
 
 
 
 
23
  if ( !$variation_id ) {
24
  return array(
25
  'status' => 'error',
@@ -29,7 +32,7 @@ class Ecwid_Importer_Task_Upload_Product_Variation_Image extends Ecwid_Importer_
29
  }
30
 
31
  $data = array(
32
- 'productId' => $product_id,
33
  'variationId' => $variation_id,
34
  'data' => file_get_contents( $file )
35
  );
1
  <?php
2
 
3
+ class Ecwid_Importer_Task_Upload_Product_Variation_Image extends Ecwid_Importer_Task_Product_Base
4
  {
5
  public static $type = 'upload_product_variation_image';
6
 
7
  public function execute( Ecwid_Importer $exporter, array $data ) {
8
  $api = new Ecwid_Api_V3();
9
 
10
+ $this->_woo_product_id = $data['product_id'];
11
+ $this->_ecwid_product_id = get_post_meta( $this->_woo_product_id, '_ecwid_product_id', true );
 
 
12
 
13
+ if ( !$this->_ecwid_product_id ) {
14
  return array(
15
  'status' => 'error',
16
  'data' => 'skipped',
18
  );
19
  }
20
 
21
+
22
+ $variation_id = get_post_meta( $data['variation_id'], '_ecwid_variation_id', true );
23
+
24
+ $file = get_attached_file ( get_post_thumbnail_id( $data['variation_id'] ) );
25
+
26
  if ( !$variation_id ) {
27
  return array(
28
  'status' => 'error',
32
  }
33
 
34
  $data = array(
35
+ 'productId' => $this->_ecwid_product_id,
36
  'variationId' => $variation_id,
37
  'data' => file_get_contents( $file )
38
  );
includes/integrations/class-ecwid-integration-autoptimize.php CHANGED
@@ -25,8 +25,8 @@ class Ecwid_Integration_Autoptimize
25
  public function hook_js_exclude($exclude) {
26
  $code = ecwid_get_search_js_code();
27
 
28
- if ( Ecwid_Static_Home_Page::is_enabled() ) {
29
- $code .= ", " . Ecwid_Static_Home_Page::HANDLE_STATIC_PAGE . ".js";
30
  }
31
 
32
  return $exclude . ", $code";
25
  public function hook_js_exclude($exclude) {
26
  $code = ecwid_get_search_js_code();
27
 
28
+ if ( Ecwid_Static_Page::is_enabled_static_home_page() ) {
29
+ $code .= ", " . Ecwid_Static_Page::HANDLE_STATIC_PAGE . ".js";
30
  }
31
 
32
  return $exclude . ", $code";
includes/integrations/class-ecwid-integration-wpml.php CHANGED
@@ -2,22 +2,66 @@
2
 
3
  class Ecwid_Integration_WPML
4
  {
5
- public function __construct()
6
- {
 
 
 
 
 
 
7
  add_filter( 'ecwid_lang', array( $this, 'force_scriptjs_lang' ) );
8
- add_filter( 'ecwid_relative_permalink', array( $this, 'mod_relative_permalink' ), 10, 2 );
 
 
 
 
 
 
 
 
 
 
9
  }
10
 
11
- public function force_scriptjs_lang( $lang )
12
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  $current_language_code = apply_filters( 'wpml_current_language', null );
14
  return $current_language_code;
15
  }
16
 
17
- public function mod_relative_permalink( $default_link, $item_id )
18
- {
19
  global $sitepress;
20
-
21
  if ( $sitepress->get_setting( 'language_negotiation_type' ) == WPML_LANGUAGE_NEGOTIATION_TYPE_DIRECTORY ) {
22
 
23
  $translation_details = apply_filters( 'wpml_element_language_details', null, array(
@@ -29,9 +73,11 @@ class Ecwid_Integration_WPML
29
 
30
  $lang_info = apply_filters( 'wpml_active_languages', null );
31
  $permalink = apply_filters( 'wpml_permalink', get_permalink( $item_id ), $code, true );
32
- $home_url = $lang_info[$code]['url'];
33
-
34
- $default_link = substr( $permalink, strlen( $home_url ) );
 
 
35
  }
36
 
37
  return $default_link;
2
 
3
  class Ecwid_Integration_WPML
4
  {
5
+ public function __construct() {
6
+ $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/sitepress-multilingual-cms/sitepress.php' );
7
+ $ver = $plugin_data['Version'];
8
+
9
+ if ( version_compare( $ver, '3.2', '>=' ) ) {
10
+ add_filter( 'ecwid_relative_permalink', array( $this, 'mod_relative_permalink' ), 10, 2 );
11
+ }
12
+
13
  add_filter( 'ecwid_lang', array( $this, 'force_scriptjs_lang' ) );
14
+ add_filter( 'wpml_hreflangs', array( $this, 'set_hreflangs' ), 10, 1 );
15
+ add_filter( 'wpml_hreflangs_html', array( $this, 'set_hreflangs_html'), 10, 1 );
16
+ }
17
+
18
+ public function set_hreflangs( $hreflang_items ) {
19
+ $this->hreflang_items = $hreflang_items;
20
+
21
+ add_filter( 'ecwid_hreflangs', array( $this, 'get_hreflangs' ), 10, 1);
22
+ add_filter( 'ecwid_inline_js_config', array( $this, 'add_inline_js_config' ), 10, 1);
23
+
24
+ return $hreflang_items;
25
  }
26
 
27
+ public function get_hreflangs() {
28
+ return $this->hreflang_items;
29
+ }
30
+
31
+ public function set_hreflangs_html( $hreflang ) {
32
+ if( class_exists( 'Ecwid_Static_Page' ) && Ecwid_Static_Page::is_data_available() ) {
33
+ $ecwid_hreflang = Ecwid_Static_Page::get_href_lang_html();
34
+ if( $ecwid_hreflang ) {
35
+ return $ecwid_hreflang;
36
+ }
37
+ }
38
+
39
+ return $hreflang;
40
+ }
41
+
42
+ public function add_inline_js_config( $js ) {
43
+ if( is_array( $this->hreflang_items ) ) {
44
+ $js .= 'window.ec.config.storefrontUrls.enableHreflangTags = true;';
45
+ $js .= 'window.ec.config.storefrontUrls.internationalPages = {';
46
+
47
+ foreach( $this->hreflang_items as $lang => $url ) {
48
+ $js .= sprintf( '"%s": "%s",', $lang, $url );
49
+ }
50
+
51
+ $js .= '};';
52
+ }
53
+
54
+ return $js;
55
+ }
56
+
57
+ public function force_scriptjs_lang( $lang ) {
58
  $current_language_code = apply_filters( 'wpml_current_language', null );
59
  return $current_language_code;
60
  }
61
 
62
+ public function mod_relative_permalink( $default_link, $item_id ) {
 
63
  global $sitepress;
64
+
65
  if ( $sitepress->get_setting( 'language_negotiation_type' ) == WPML_LANGUAGE_NEGOTIATION_TYPE_DIRECTORY ) {
66
 
67
  $translation_details = apply_filters( 'wpml_element_language_details', null, array(
73
 
74
  $lang_info = apply_filters( 'wpml_active_languages', null );
75
  $permalink = apply_filters( 'wpml_permalink', get_permalink( $item_id ), $code, true );
76
+
77
+ if( isset($lang_info[$code]) ) {
78
+ $home_url = $lang_info[$code]['url'];
79
+ $default_link = substr( $permalink, strlen( $home_url ) );
80
+ }
81
  }
82
 
83
  return $default_link;
includes/shortcodes/class-ecwid-shortcode-productbrowser.php CHANGED
@@ -21,7 +21,7 @@ class Ecwid_Shortcode_ProductBrowser extends Ecwid_Shortcode_Base {
21
  }
22
 
23
  public function render() {
24
-
25
  Ecwid_Store_Page::add_store_page( get_the_ID() );
26
  if( current_user_can( Ecwid_Admin::get_capability() ) ) {
27
 
@@ -30,12 +30,12 @@ class Ecwid_Shortcode_ProductBrowser extends Ecwid_Shortcode_Base {
30
  }
31
 
32
  $default_render = parent::render();
33
-
34
- $data = Ecwid_Static_Home_Page::get_data_for_current_page();
35
- if ( !$data || @$this->_params['noHTMLCatalog'] ) {
36
  return $default_render;
37
  }
38
 
 
39
  $code = '';
40
  global $ecwid_current_theme;
41
  if ( $ecwid_current_theme ) {
@@ -47,165 +47,85 @@ document.body.id = 'ecwid_body';
47
  </script>
48
  HTML;
49
  }
50
-
51
 
52
- $code .= '<div id="static-ecwid">' . htmlspecialchars_decode( $data->htmlCode ) . '</div>';
53
-
54
- $code .= '<div id="dynamic-ecwid">' . $default_render . '</div>';
55
-
56
- if ( $data->jsCode ) {
57
- $code .= '<script type="text/javascript">' . $data->jsCode . '</script>';
58
  }
59
-
60
- $code .= <<<HTML
61
- <script language="JavaScript">
62
- EcwidStaticPageLoader.processStaticHomePage('static-ecwid', 'dynamic-ecwid');
63
- if ( location.hash != '' && location.hash.indexOf('#!/c/0/') !== 0) {
64
- EcwidStaticPageLoader.switchToDynamicMode();
65
- }
66
- </script>
67
- HTML;
68
 
69
  return $code;
70
  }
71
 
72
- public function render_placeholder( ) {
73
- $store_id = get_ecwid_store_id();
 
 
 
 
 
 
 
 
 
 
 
74
 
75
- $plain_content = '';
76
-
77
- $html_catalog_params = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
79
-
80
- if ( Ecwid_Api_V3::is_available() && !Ecwid_Static_Home_Page::get_data_for_current_page() ) {
81
-
82
- if (ecwid_should_display_escaped_fragment_catalog()) {
83
- $html_catalog_params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
84
- } elseif (Ecwid_Seo_Links::is_enabled() && Ecwid_Store_Page::is_store_page()) {
85
- $html_catalog_params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
86
- }
87
-
88
- $html_catalog_params['default_category_id'] = @ (int)$this->_params['defaultCategoryId'];
89
- $html_catalog_params['default_product_id'] = @ (int)$this->_params['defaultProductId'];
90
-
91
- if (
92
- $html_catalog_params !== false
93
- && get_option('ecwid_print_html_catalog', 'Y')
94
- && !@$this->_params['noHTMLCatalog']
95
- ) {
96
- $plain_content = $this->_build_html_catalog($store_id, $html_catalog_params);
97
- }
98
- }
99
 
 
 
 
 
100
  $params = array(
101
  'default_category_id' => 0
102
  );
103
  if ( $this->_lang ) {
104
  $params['lang'] = $this->_lang;
105
  }
106
- if ( @$this->_params['defaultCategoryId'] ) {
 
107
  $params['default_category_id'] = $this->_params['defaultCategoryId'];
108
  }
109
 
 
 
 
 
110
  Ecwid_Store_Page::save_store_page_params( $params );
111
 
112
- $result = '';
113
-
114
  $classname = $this->_get_html_class_name();
115
 
116
-
117
- $result .= <<<HTML
118
- <div id="ecwid-store-$store_id" class="ecwid-shopping-cart-$classname" data-ecwid-default-category-id="$html_catalog_params[default_category_id]">
119
- HTML;
120
-
121
- if ( ! @$this->_params['noHTMLCatalog'] )
122
- $result .= <<<HTML
123
- <script>
124
- function createClass(name,rules){
125
- var style = document.createElement('style');
126
- style.type = 'text/css';
127
- document.getElementsByTagName('head')[0].appendChild(style);
128
- if(!(style.sheet||{}).insertRule)
129
- (style.styleSheet || style.sheet).addRule(name, rules);
130
- else
131
- style.sheet.insertRule(name+'{'+rules+'}',0);
132
- }
133
- createClass('#ecwid-html-catalog-$store_id','display:none;');
134
- </script>
135
- HTML;
136
-
137
-
138
- $result .= <<<HTML
139
- <div id="ecwid-html-catalog-$store_id">{$plain_content}</div>
140
- </div>
141
  HTML;
142
 
143
  return $result;
144
  }
145
 
146
- /**
147
- * @param $store_id
148
- * @param $params
149
- * @return string
150
- */
151
- public function _build_html_catalog($store_id, $params)
152
- {
153
- include_once ECWID_PLUGIN_DIR . 'lib/ecwid_catalog.php';
154
-
155
- $id = get_the_ID();
156
- if (!$id) {
157
- $id = Ecwid_Store_Page::get_current_store_page_id();
158
- }
159
-
160
- if ($id) {
161
- $page_url = get_permalink( $id );
162
- } else {
163
- $page_url = '';
164
- }
165
-
166
- $catalog = new EcwidCatalog($store_id, $page_url);
167
-
168
- $url = false;
169
-
170
- $is_default_category = false;
171
-
172
- if ( isset( $params['mode'] ) && !empty( $params['mode'] ) ) {
173
- if ( $params['mode'] == 'product' ) {
174
- $plain_content = $catalog->get_product( $params['id'] );
175
- $url = Ecwid_Store_Page::get_product_url( $params['id'] );
176
- } elseif ( $params['mode'] == 'category' ) {
177
- $plain_content = $catalog->get_category( $params['id'] );
178
- $url = Ecwid_Store_Page::get_category_url( $params['id'] );
179
- }
180
-
181
- } else {
182
-
183
- $cat_id = intval( $this->_get_param_default_category_id( $params ) );
184
- if ( $cat_id ) {
185
- $plain_content = $catalog->get_category( $cat_id );
186
- } else if ( @$this->_params['defaultProductId'] ) {
187
- $plain_content = $catalog->get_product( $this->_params['defaultProductId'] );
188
- }
189
-
190
- if ( empty( $plain_content ) ) {
191
- $plain_content = $catalog->get_category( 0 );
192
- } else {
193
- $is_default_category = true;
194
- }
195
- }
196
-
197
- if ( $url && !$is_default_category && !Ecwid_Seo_Links::is_product_browser_url() ) {
198
- $parsed = parse_url($url);
199
-
200
- if ($parsed['fragment']) {
201
- $plain_content .= '<script data-cfasync="false" type="text/javascript"> if (!document.location.hash) document.location.hash = "' . $parsed['fragment'] . '";</script>';
202
- } else {
203
- $plain_content .= '<script data-cfasync="false" type="text/javascript"> document.location = "' . esc_js($url) . '";</script>';
204
- }
205
- }
206
-
207
- return $plain_content;
208
- }
209
 
210
  protected function _process_params( $shortcode_params = array() ) {
211
 
21
  }
22
 
23
  public function render() {
24
+
25
  Ecwid_Store_Page::add_store_page( get_the_ID() );
26
  if( current_user_can( Ecwid_Admin::get_capability() ) ) {
27
 
30
  }
31
 
32
  $default_render = parent::render();
33
+
34
+ if ( !Ecwid_Static_Page::is_data_available() || @$this->_params['noHTMLCatalog'] || empty( get_option('ecwid_print_html_catalog', 'Y') ) ) {
 
35
  return $default_render;
36
  }
37
 
38
+
39
  $code = '';
40
  global $ecwid_current_theme;
41
  if ( $ecwid_current_theme ) {
47
  </script>
48
  HTML;
49
  }
 
50
 
51
+ if ( Ecwid_Static_Page::is_enabled_static_home_page() ) {
52
+ $code .= self::_get_js_switch_dynamic('static-ec-store', 'dynamic-ec-store');
53
+ } else {
54
+ $code .= self::_get_js_hide_static('#static-ec-store');
 
 
55
  }
56
+
57
+ $static_html_code = Ecwid_Static_Page::get_html_code();
58
+ $code .= '<div id="static-ec-store">' . htmlspecialchars_decode( $static_html_code ) . '</div>';
59
+
60
+ $code .= '<div id="dynamic-ec-store">' . $default_render . '</div>';
61
+
 
 
 
62
 
63
  return $code;
64
  }
65
 
66
+ protected function _get_js_switch_dynamic( $static_container_id, $dynamic_container_id )
67
+ {
68
+ return <<<HTML
69
+ <script language="JavaScript">
70
+ window.ec.storefront.staticPages = window.ec.storefront.staticPages || Object();
71
+
72
+ ec.storefront.staticPages.staticStorefrontEnabled = true;
73
+ ec.storefront.staticPages.staticContainerID = '$static_container_id';
74
+ ec.storefront.staticPages.dynamicContainerID = '$dynamic_container_id';
75
+ ec.storefront.staticPages.autoSwitchStaticToDynamicWhenReady = true;
76
+ </script>
77
+ HTML;
78
+ }
79
 
80
+ protected function _get_js_hide_static( $html_selector )
81
+ {
82
+ return <<<HTML
83
+ <script>
84
+ function createClass(name,rules){
85
+ var style = document.createElement('style');
86
+ style.type = 'text/css';
87
+ document.getElementsByTagName('head')[0].appendChild(style);
88
+ if(!(style.sheet||{}).insertRule)
89
+ (style.styleSheet || style.sheet).addRule(name, rules);
90
+ else
91
+ style.sheet.insertRule(name+'{'+rules+'}',0);
92
+ }
93
+ createClass('$html_selector','display:none;');
94
+ </script>
95
+ HTML;
96
+ }
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
 
99
+ public function render_placeholder( ) {
100
+
101
+ $store_id = get_ecwid_store_id();
102
+
103
  $params = array(
104
  'default_category_id' => 0
105
  );
106
  if ( $this->_lang ) {
107
  $params['lang'] = $this->_lang;
108
  }
109
+
110
+ if ( isset($this->_params['defaultCategoryId']) ) {
111
  $params['default_category_id'] = $this->_params['defaultCategoryId'];
112
  }
113
 
114
+ if ( @$this->_params['defaultProductId'] ) {
115
+ $params['default_product_id'] = $this->_params['defaultProductId'];
116
+ }
117
+
118
  Ecwid_Store_Page::save_store_page_params( $params );
119
 
 
 
120
  $classname = $this->_get_html_class_name();
121
 
122
+ $result = <<<HTML
123
+ <div id="ecwid-store-$store_id" class="ecwid-shopping-cart-$classname" data-ecwid-default-category-id="$params[default_category_id]"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  HTML;
125
 
126
  return $result;
127
  }
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
  protected function _process_params( $shortcode_params = array() ) {
131
 
includes/widgets/nsf-minicart.tpl.php CHANGED
@@ -13,6 +13,8 @@ echo ecwid_get_product_browser_url_script();
13
  ></div>
14
 
15
  <script>
 
16
  Ecwid.init();
 
17
  </script>
18
  <!-- /noptimize -->
13
  ></div>
14
 
15
  <script>
16
+ if (typeof Ecwid != 'undefined') {
17
  Ecwid.init();
18
+ }
19
  </script>
20
  <!-- /noptimize -->
js/admin-bar.js CHANGED
@@ -1,50 +1,50 @@
1
  jQuery(document).ready(function() {
2
 
3
- if ( typeof Ecwid != 'undefined' ) {
4
- var $post_edit_links = jQuery('[href*="'+ecwidEditPostLinkParams.admin_url+'post.php"]').filter('[href*="action=edit"]'),
5
- url = ( $post_edit_links.length ) ? $post_edit_links.eq(0).attr( 'href' ) : false,
6
- $bar,
7
- text;
8
-
9
- $post_edit_links.each( function() {
10
- if( jQuery( this ).closest('#wpadminbar').length ) {
11
- $bar = jQuery( this );
12
- text = $bar.text();
13
- }
14
- });
 
15
 
16
- if( url ) {
17
- Ecwid.OnPageLoad.add(function(page){
18
- var is_product = ( page.type == 'PRODUCT' ),
19
- is_subcategory = ( page.type == 'CATEGORY' && page.categoryId > 0 ),
20
- new_url = url;
 
21
 
22
- if( typeof text != 'undefined' ) new_text = text;
23
 
24
- if( is_product || is_subcategory ) {
25
- if( typeof $bar != 'undefined' ) {
26
- new_text = ( is_product ) ? ecwidEditPostLinkParams.languages.editProduct : ( is_subcategory ) ? ecwidEditPostLinkParams.languages.editCategory : text;
27
- }
28
 
29
- var id = ( is_product ) ? page.productId : page.categoryId,
30
- hash = page.type.toLowerCase() + ':mode=edit&id=' + id;
31
 
32
- if( ecwidEditPostLinkParams.is_api_available ) {
33
- hash = encodeURIComponent( hash );
34
- }
35
 
36
- new_url = ecwidEditPostLinkParams.url + hash;
37
- }
38
 
39
- if( typeof $bar != 'undefined' ) {
40
- $bar.text( new_text );
41
- }
42
 
43
- if( $post_edit_links.length ) {
44
- $post_edit_links.attr( 'href', new_url );
45
- }
46
- });
47
  }
48
- }
49
 
50
  });
1
  jQuery(document).ready(function() {
2
 
3
+ if ( typeof Ecwid == 'undefined' ) return;
4
+
5
+ var $post_edit_links = jQuery('[href*="'+ecwidEditPostLinkParams.admin_url+'post.php"]').filter('[href*="action=edit"]'),
6
+ url = ( $post_edit_links.length ) ? $post_edit_links.eq(0).attr( 'href' ) : false,
7
+ $bar,
8
+ text;
9
+
10
+ $post_edit_links.each( function() {
11
+ if( jQuery( this ).closest('#wpadminbar').length ) {
12
+ $bar = jQuery( this );
13
+ text = $bar.text();
14
+ }
15
+ });
16
 
17
+ if( !url ) return;
18
+
19
+ Ecwid.OnPageLoad.add(function(page){
20
+ var is_product = ( page.type == 'PRODUCT' ),
21
+ is_subcategory = ( page.type == 'CATEGORY' && page.categoryId > 0 ),
22
+ new_url = url;
23
 
24
+ if( typeof text != 'undefined' ) new_text = text;
25
 
26
+ if( is_product || is_subcategory ) {
27
+ if( typeof $bar != 'undefined' ) {
28
+ new_text = ( is_product ) ? ecwidEditPostLinkParams.languages.editProduct : ( is_subcategory ) ? ecwidEditPostLinkParams.languages.editCategory : text;
29
+ }
30
 
31
+ var id = ( is_product ) ? page.productId : page.categoryId,
32
+ hash = page.type.toLowerCase() + ':mode=edit&id=' + id;
33
 
34
+ if( ecwidEditPostLinkParams.is_api_available ) {
35
+ hash = encodeURIComponent( hash );
36
+ }
37
 
38
+ new_url = ecwidEditPostLinkParams.url + hash;
39
+ }
40
 
41
+ if( typeof $bar != 'undefined' ) {
42
+ $bar.text( new_text );
43
+ }
44
 
45
+ if( $post_edit_links.length ) {
46
+ $post_edit_links.attr( 'href', new_url );
 
 
47
  }
48
+ });
49
 
50
  });
js/frontend.js CHANGED
@@ -38,4 +38,9 @@ jQuery(document).ready(function() {
38
 
39
  ecwidShoppingCartMakeStoreLinksUseApiCall(jQuery("a[data-ecwid-page]"));
40
 
41
- });
 
 
 
 
 
38
 
39
  ecwidShoppingCartMakeStoreLinksUseApiCall(jQuery("a[data-ecwid-page]"));
40
 
41
+
42
+ Ecwid.OnAPILoaded.add(function() {
43
+ var font = window.ec.config.chameleonDefaults.font['font-family'] || '';
44
+ document.cookie = "ec_store_chameleon_font=" + font;
45
+ });
46
+ });
js/gutenberg/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n={ecwid: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"})),store:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-234.000000, -324.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"store-icon",transform:"translate(234.000000, 324.000000)"},wp.element.createElement("path",{d:"M9,20.4893188 L7,20.4893188 L7,14 C7,13.4477153 7.44771525,13 8,13 L16,13 C16.5522847,13 17,13.4477153 17,14 L17,20.4893188 C16.260376,20.4893188 15.5929565,20.4893188 15,20.4893188 L15,15 L9,15 L9,20.4893188 Z",id:"Rectangle-3"}),wp.element.createElement("path",{d:"M20,10 L22,10 L22,21.0006104 C22,21.5528951 21.5522847,22.0006104 21,22.0006104 L3,22.0006104 C2.44771525,22.0006104 2,21.5528951 2,21.0006104 L2,10 L4,10 L4,20.0006104 L20,20.0006104 L20,10 Z",id:"Rectangle-3"}),wp.element.createElement("path",{d:"M2,6.5 C2,7.88071187 3.11928813,9 4.5,9 C5.18185515,9 5.81786053,8.72707728 6.28575907,8.24959145 L7,7.52071565 L7.71424093,8.24959145 C8.18213947,8.72707728 8.81814485,9 9.5,9 C10.1818552,9 10.8178605,8.72707728 11.2857591,8.24959145 L12,7.52071565 L12.7142409,8.24959145 C13.1821395,8.72707728 13.8181448,9 14.5,9 C15.1818552,9 15.8178605,8.72707728 16.2857591,8.24959145 L17,7.52071565 L17.7142409,8.24959145 C18.1821395,8.72707728 18.8181448,9 19.5,9 C20.8807119,9 22,7.88071187 22,6.5 C22,5.81342077 21.7917279,4.97737648 21.3637104,4 L2.63518632,4 C2.20791709,4.97255801 2,5.80837301 2,6.5 Z M4.5,11 C2.01471863,11 4.4408921e-16,8.98528137 0,6.5 C0,5.33310646 0.374574518,4.02209564 1.10468286,2.55457075 L1.38058736,2 L22.6207487,2 L22.8961752,2.55629959 C23.6256977,4.02977127 24,5.33982925 24,6.5 C24,8.98528137 21.9852814,11 19.5,11 C18.5937006,11 17.7289225,10.73006 17,10.2422809 C16.2710775,10.73006 15.4062994,11 14.5,11 C13.5937006,11 12.7289225,10.73006 12,10.2422809 C11.2710775,10.73006 10.4062994,11 9.5,11 C8.59370056,11 7.72892246,10.73006 7,10.2422809 C6.27107754,10.73006 5.40629944,11 4.5,11 Z",id:"Combined-Shape"}))))),product:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-352.000000, -324.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"icon-product",transform:"translate(352.000000, 324.000000)"},wp.element.createElement("path",{d:"M4,9 L4,20 L20,20 L20,9 L4,9 Z M2,7 L22,7 L22,22 L2,22 L2,7 Z",id:"Rectangle-2-Copy-2"}),wp.element.createElement("path",{d:"M9,7 L15,7 L15,15 L12.0361633,14 L9,15 L9,7 Z M11,9 L11,12 L12.0361633,11.5393066 L13,12 L13,9 L11,9 Z",id:"Combined-Shape"}),wp.element.createElement("polygon",{id:"Line-3",points:"13 9 11 9 11 2 13 2"}),wp.element.createElement("polygon",{id:"Rectangle-2-Copy-2",points:"17.0387503 4 19.4387503 7 22 7 18 2 6 2 2 7 4.56124969 7 6.96124969 4"}))))),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"})))),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(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"})))),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(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"})))),cart:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-352.000000, -415.000000)",fill:"#555D66"},wp.element.createElement("g",{id:"cart-icon",transform:"translate(352.000000, 415.000000)"},wp.element.createElement("path",{d:"M4.5269723,4 L2,4 C1.44771525,4 1,3.55228475 1,3 C1,2.44771525 1.44771525,2 2,2 L5.33333333,2 C5.80393835,2 6.21086155,2.32812702 6.31061146,2.788039 L7.22413999,7 L21,7 C21.6640252,7 22.143636,7.63527258 21.9617572,8.27390353 L19.968471,15.272927 C19.8460922,15.7026358 19.4535094,15.9990234 19.0067139,15.9990234 L7.93579102,15.9990234 C7.465186,15.9990234 7.0582628,15.6708964 6.95851289,15.2109844 L4.5269723,4 Z M7.65791824,9 L8.74215205,13.9990234 L18.2517453,13.9990234 L19.6754416,9 L7.65791824,9 Z",id:"Path-3","fill-rule":"nonzero"}),wp.element.createElement("circle",{id:"Oval-2",cx:"9",cy:"20",r:"2"}),wp.element.createElement("circle",{id:"Oval-2",cx:"18",cy:"20",r:"2"}))))),search:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-469.000000, -324.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"search-icon",transform:"translate(469.000000, 324.000000)"},wp.element.createElement("path",{d:"M3.83470744,16.348799 C3.83470744,15.7965143 4.28242269,15.348799 4.83470744,15.348799 C5.38699219,15.348799 5.83470744,15.7965143 5.83470744,16.348799 L5.81335241,21.7511152 C5.81335241,22.3033999 5.36563716,22.7511152 4.81335241,22.7511152 C4.26106766,22.7511152 3.81335241,22.3033999 3.81335241,21.7511152 L3.83470744,16.348799 Z",id:"Line-2",transform:"translate(4.824030, 19.049957) scale(-1, 1) rotate(-45.000000) translate(-4.824030, -19.049957) "}),wp.element.createElement("path",{d:"M13,18 C16.8659932,18 20,14.8659932 20,11 C20,7.13400675 16.8659932,4 13,4 C9.13400675,4 6,7.13400675 6,11 C6,14.8659932 9.13400675,18 13,18 Z M13,20 C8.02943725,20 4,15.9705627 4,11 C4,6.02943725 8.02943725,2 13,2 C17.9705627,2 22,6.02943725 22,11 C22,15.9705627 17.9705627,20 13,20 Z",id:"Oval",transform:"translate(13.000000, 11.000000) scale(-1, 1) translate(-13.000000, -11.000000) "}),wp.element.createElement("path",{d:"M17,6 C17.5522847,6 18,6.44771525 18,7 C18,7.55228475 17.5522847,8 17,8 C15.0670034,8 13.5,9.56700338 13.5,11.5 C13.5,12.0522847 13.0522847,12.5 12.5,12.5 C11.9477153,12.5 11.5,12.0522847 11.5,11.5 C11.5,8.46243388 13.9624339,6 17,6 Z",id:"Oval",transform:"translate(14.750000, 9.250000) scale(-1, 1) translate(-14.750000, -9.250000) "}))))),categories:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-234.000000, -416.000000)"},wp.element.createElement("g",{id:"categories-icon",transform:"translate(234.000000, 416.000000)"},wp.element.createElement("polygon",{id:"Triangle",fill:"#555D66",points:"3 2 5.5 7 0.5 7"}),wp.element.createElement("polygon",{id:"Line",fill:"#555D66","fill-rule":"nonzero",points:"8 6 8 4 23 4 23 6"}),wp.element.createElement("polygon",{id:"Line",fill:"#555D66","fill-rule":"nonzero",points:"8 13 8 11 23 11 23 13"}),wp.element.createElement("polygon",{id:"Line",fill:"#555D66","fill-rule":"nonzero",points:"8 20 8 18 23 18 23 20"}),wp.element.createElement("rect",{id:"Rectangle",stroke:"#555D66","stroke-width":"2",fill:"#FFFFFF",x:"2",y:"11",width:"2",height:"2"}),wp.element.createElement("rect",{id:"Rectangle",stroke:"#555D66","stroke-width":"2",fill:"#FFFFFF",x:"2",y:"18",width:"2",height:"2",rx:"1"}))))),category:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-470.000000, -416.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"category-icon",transform:"translate(470.000000, 416.000000)"},wp.element.createElement("polygon",{id:"Line-4",points:"3 4 3 2 21 2 21 4"}),wp.element.createElement("path",{d:"M5,17 L5,20 L9,20 L9,17 L5,17 Z M3,15 L11,15 L11,22 L3,22 L3,15 Z",id:"Rectangle-2"}),wp.element.createElement("path",{d:"M5,8 L5,11 L9,11 L9,8 L5,8 Z M3,6 L11,6 L11,13 L3,13 L3,6 Z",id:"Rectangle-2-Copy"}),wp.element.createElement("path",{d:"M15,17 L15,20 L19,20 L19,17 L15,17 Z M13,15 L21,15 L21,22 L13,22 L13,15 Z",id:"Rectangle-2"}),wp.element.createElement("path",{d:"M15,8 L15,11 L19,11 L19,8 L15,8 Z M13,6 L21,6 L21,13 L13,13 L13,6 Z",id:"Rectangle-2-Copy-3"}))))),button:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-345.000000, -280.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"button-icon",transform:"translate(345.000000, 280.000000)"},wp.element.createElement("path",{d:"M4,8 L4,16 L20,16 L20,8 L4,8 Z M4,6 L20,6 C21.1045695,6 22,6.8954305 22,8 L22,16 C22,17.1045695 21.1045695,18 20,18 L4,18 C2.8954305,18 2,17.1045695 2,16 L2,8 C2,6.8954305 2.8954305,6 4,6 Z",id:"Rectangle-5"}),wp.element.createElement("path",{d:"M13.8320367,9.8101295 C14.2137832,9.41102047 14.8467917,9.3969454 15.2459008,9.77869195 C15.6450098,10.1604385 15.6590849,10.793447 15.2773383,11.192556 L12.2122748,14.3970238 C11.8300377,14.7966458 11.1960253,14.8101668 10.7970986,14.427204 L9.5128579,13.1943549 C9.11444327,12.8118837 9.10151859,12.1788506 9.48398981,11.780436 C9.86646103,11.3820214 10.4994941,11.3690967 10.8979087,11.7515679 L11.4594438,12.290632 L13.8320367,9.8101295 Z",id:"Line-6"}))))),productPreview:wp.element.createElement("svg",{width:"72px",height:"72px",viewBox:"0 0 72 72",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets",transform:"translate(-625.000000, -811.000000)",fill:"#AAAAAA"},wp.element.createElement("g",{id:"Group-2",transform:"translate(571.000000, 756.000000)"},wp.element.createElement("g",{id:"product-preview",transform:"translate(54.000000, 55.000000)"},wp.element.createElement("path",{d:"M6,25 L6,69 L66,69 L66,25 L6,25 Z M4,23 L68,23 L68,71 L4,71 L4,23 Z",id:"Rectangle-2-Copy-2","fill-rule":"nonzero"}),wp.element.createElement("path",{d:"M36.5,23.5 L65.836706,23.5 L67.2237665,22.8226349 L55.0328393,7.34740904 L39.8812213,0.895706316 L40.7501329,7.5 L17.0403124,7.5 L5.04031242,22.5 L6.32093727,22.5 L17.5209373,8.5 L36.5,8.5 L36.5,23.5 Z M42.9573255,16.6099474 L41.1011835,2.50206036 L54.4056315,8.16722056 L66.5284549,23.5566573 L42.9573255,16.6099474 Z",id:"Combined-Shape",stroke:"#AAAAAA"}),wp.element.createElement("path",{d:"M29.8056641,41.53125 C29.9375,38.2060547 32.2080078,35.6865234 36.4560547,35.6865234 C40.3232422,35.6865234 42.9306641,37.9863281 42.9306641,41.1210938 C42.9306641,43.3916016 41.7880859,44.9882812 39.8544922,46.1455078 C37.9648438,47.2587891 37.4228516,48.0351562 37.4228516,49.5439453 L37.4228516,50.4375 L34.390625,50.4375 L34.3759766,49.265625 C34.3027344,47.2001953 35.1962891,45.8818359 37.203125,44.6806641 C38.9755859,43.6113281 39.6054688,42.7617188 39.6054688,41.2529297 C39.6054688,39.5976562 38.3017578,38.3818359 36.2949219,38.3818359 C34.2734375,38.3818359 32.9697266,39.5976562 32.8378906,41.53125 L29.8056641,41.53125 Z M35.9287109,57.2197266 C34.859375,57.2197266 34.0097656,56.3994141 34.0097656,55.3300781 C34.0097656,54.2607422 34.859375,53.4404297 35.9287109,53.4404297 C37.0273438,53.4404297 37.8623047,54.2607422 37.8623047,55.3300781 C37.8623047,56.3994141 37.0273438,57.2197266 35.9287109,57.2197266 Z",id:"?"})))))),filters:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd","stroke-linecap":"square"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-354.000000, -500.000000)",stroke:"#555D66","stroke-width":"2"},wp.element.createElement("g",{id:"filter-icon",transform:"translate(354.000000, 500.000000)"},wp.element.createElement("path",{d:"M3,6 L21,6",id:"Line-5"}),wp.element.createElement("path",{d:"M7,12 L17,12",id:"Line-5"}),wp.element.createElement("path",{d:"M10,18 L14,18",id:"Line-5"}))))),cartPage:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-470.000000, -500.000000)",fill:"#555D66"},wp.element.createElement("g",{id:"cart-icon",transform:"translate(470.000000, 500.000000)"},wp.element.createElement("g",{id:"Group-6",transform:"translate(2.000000, 3.000000)"},wp.element.createElement("path",{d:"M2.5269723,1 L0,1 C-0.55228475,1 -1,0.55228475 -1,-1.11022302e-16 C-1,-0.55228475 -0.55228475,-1 0,-1 L3.33333333,-1 C3.80393835,-1 4.21086155,-0.671872981 4.31061146,-0.211960997 L6.74215205,10.9990234 L16.2517453,10.9990234 L17.6754416,6 L17.0067139,6 C16.4544291,6 16.0067139,5.55228475 16.0067139,5 C16.0067139,4.44771525 16.4544291,4 17.0067139,4 L19,4 C19.6640252,4 20.143636,4.63527258 19.9617572,5.27390353 L17.968471,12.272927 C17.8460922,12.7026358 17.4535094,12.9990234 17.0067139,12.9990234 L5.93579102,12.9990234 C5.465186,12.9990234 5.0582628,12.6708964 4.95851289,12.2109844 L2.5269723,1 Z",id:"Path-3","fill-rule":"nonzero"}),wp.element.createElement("path",{d:"M13.6266547,1.30878828 C14.0084012,0.909679249 14.6414097,0.895604177 15.0405188,1.27735072 C15.4396278,1.65909727 15.4537029,2.29210579 15.0719563,2.69121482 L11.0068929,6.89568259 C10.6246557,7.29530459 9.99064332,7.30882561 9.59171662,6.92586281 L7.61584318,5.00113813 C7.21742856,4.61866691 7.20450388,3.98563386 7.5869751,3.58721924 C7.96944632,3.18880462 8.60247937,3.17587994 9.00089399,3.55835116 L10.2540618,4.78929076 L13.6266547,1.30878828 Z",id:"Line-6","fill-rule":"nonzero"}),wp.element.createElement("circle",{id:"Oval-2",cx:"7",cy:"17",r:"2"}),wp.element.createElement("circle",{id:"Oval-2",cx:"16",cy:"17",r:"2"}))))))}},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=t.attributes,o=function(e,t,o,l){return wp.element.createElement(u,{label:o},wp.element.createElement(d,null,l.map(function(o){return wp.element.createElement(m,{isDefault:!0,isButton:!0,isPrimary:r[t]===o.value,onClick:function(){return e.setAttributes(n({},t,o.value))}},o.title)})))},l=function(e,t,r){return wp.element.createElement(w,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})},a=function(e,t,r,o){return wp.element.createElement(u,{label:r},wp.element.createElement("select",{onChange:function(r){e.setAttributes(n({},t,r.target.value))}},o.map(function(r){return wp.element.createElement("option",{value:r.value,selected:parseInt(e.attributes[t])==r.value},r.title)})))},i=function(e,t,r){return wp.element.createElement(u,{label:r},wp.element.createElement("input",{type:"text",value:e.attributes[t],onChange:function(r){e.setAttributes(n({},t,r.target.value))}}))},p=function(e,t,r,o){return wp.element.createElement(u,{label:r},wp.element.createElement(g,{controls:o.map(function(r){return{icon:c.a[r.icon],title:r.title,isActive:e.attributes[t]===r.value,className:"ecwid-toolbar-icon",onClick:function(){return e.setAttributes(n({},t,r.value))}}})}))};return{buttonGroup:function(r){var n=e[r];return o(t,n.name,n.title,n.values)},toggle:function(r){var n=e[r];return l(t,n.name,n.title)},select:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=e[r];return a(t,o.name,n||o.title,o.values)},textbox:function(r){var n=e[r];return builtTextbox(t,n.name,n.title)},toolbar:function(r){var n=e[r];return p(t,n.name,n.title,n.values)},color:function(r){return wp.element.createElement(s.a,{props:t,name:r,title:e[r].title})},defaultCategoryId:function(r){var n=e[r];return n.values&&n.values.length>1?a(t,n.name,n.title,n.values):i(t,n.name,n.title)}}}function l(e){return wp.element.createElement("div",{className:"ec-store-inspector-subheader-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},e))}function a(e){return wp.element.createElement("div",{className:"ec-store-block ec-store-generic-block"},wp.element.createElement("div",{className:"ec-store-block-header"},e.icon,e.title),wp.element.createElement("div",{className:"ec-store-block-content"},e.children),e.showDemoButton&&wp.element.createElement("div",null,wp.element.createElement("a",{className:"button button-primary",href:"admin.php?page=ec-store"},h("Set up your store","ecwid-shopping-cart"))))}function i(e){var t=EcwidGutenbergParams.imagesUrl+e.src;return wp.element.createElement("img",{src:t})}r.d(t,"a",function(){return o}),r.d(t,"c",function(){return l}),r.d(t,"b",function(){return i}),r.d(t,"d",function(){return a});var c=r(0),s=r(6),p=wp.components,d=p.ButtonGroup,m=p.Button,u=p.BaseControl,g=p.Toolbar,w=p.ToggleControl,h=wp.i18n.__},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(3),r(7),r(10),r(13),r(16),r(19),r(22),r(25),r(28),r(31)},function(e,t,r){"use strict";var n=r(4),o=(r.n(n),r(5)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=i._x,p=wp.blocks.registerBlockType,d=wp.editor.InspectorControls,m=wp.components,u=m.PanelBody,g=(m.PanelRow,m.ToggleControl,m.ButtonGroup,m.Button,m.BaseControl),w=(m.Toolbar,m.ColorPalette,m.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ecwid/store-block"]);p("ecwid/store-block",{title:c("Store Home Page","ecwid-shopping-cart"),icon:l.a.store,category:"ec-store",attributes:w.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){return wp.element.createElement(g,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes;e.setAttributes({widgets:""});var n=wp.element.createElement(a.d,{icon:l.a.store,title:c("Store Home Page","ecwid-shopping-cart"),showDemoButton:w.isDemoStore},wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product1"}),wp.element.createElement("div",{className:"ec-store-product2"}),wp.element.createElement("div",{className:"ec-store-product3"})),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product4"}),wp.element.createElement("div",{className:"ec-store-product5"}),wp.element.createElement("div",{className:"ec-store-product6"}))),o=t("",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")),i=t(c("Display cart icon","ecwid-shopping-cart"),w.customizeMinicartText),s=(t("",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")),w.isNewProductList),p=w.isNewDetailsPage,m=w.attributes.default_category_id&&w.attributes.default_category_id.values&&w.attributes.default_category_id.values.length>0,h=Object(a.a)(w.attributes,e);return[n,wp.element.createElement(d,null,m&&wp.element.createElement(u,{title:c("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[h.select("product_list_category_title_behavior"),"SHOW_TEXT_ONLY"!==r.product_list_category_title_behavior&&[h.buttonGroup("product_list_category_image_size"),h.toolbar("product_list_category_image_aspect_ratio")]],!s&&o),wp.element.createElement(u,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[h.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[h.buttonGroup("product_list_image_size"),h.toolbar("product_list_image_aspect_ratio")],h.toolbar("product_list_product_info_layout"),h.select("product_list_title_behavior"),h.select("product_list_price_behavior"),h.select("product_list_sku_behavior"),h.select("product_list_buybutton_behavior"),h.toggle("product_list_show_additional_image_on_hover"),h.toggle("product_list_show_frame")],!s&&o),wp.element.createElement(u,{title:c("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},p&&[h.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===r.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===r.product_details_layout)&&h.toggle("show_description_under_image"),h.toolbar("product_details_gallery_layout"),Object(a.c)(c("Product sidebar content","ecwid-shopping-cart")),h.toggle("product_details_show_product_name"),h.toggle("product_details_show_breadcrumbs"),h.toggle("product_details_show_product_sku"),h.toggle("product_details_show_product_price"),h.toggle("product_details_show_qty"),h.toggle("product_details_show_number_of_items_in_stock"),h.toggle("product_details_show_in_stock_label"),h.toggle("product_details_show_wholesale_prices"),h.toggle("product_details_show_share_buttons")],!p&&o),m&&wp.element.createElement(u,{title:c("Store Front Page","ecwid-shopping-cart"),initialOpen:!1},h.defaultCategoryId("default_category_id")),wp.element.createElement(u,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},h.toggle("show_categories"),h.toggle("show_search"),h.toggle("show_breadcrumbs"),s&&h.toggle("show_footer_menu"),h.toggle("show_signin_link"),h.toggle("product_list_show_sort_viewas_options"),i),wp.element.createElement(u,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},h.color("chameleon_color_button"),h.color("chameleon_color_foreground"),h.color("chameleon_color_price"),h.color("chameleon_color_link"),h.color("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 r={widgets:t.join(" "),default_category_id:"undefined"!==typeof e.attributes.default_category_id?e.attributes.default_category_id:0};return new wp.shortcode({tag:w.shortcodeName,attrs:r,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={},r=["widgets","default_category_id"],n=0;n<r.length;n++)t[r[n]]=e.attributes[r[n]];return t.default_product_id=0,new wp.shortcode({tag:w.shortcodeName,attrs:t,type:"single"}).string()}},{save:function(e){return"[ecwid]"}},{save:function(e){return'[ecwid widgets="productbrowser" default_category_id="0" default_product_id="0"]'}},{save:function(e){return'[ecwid widgets="productbrowser" default_category_id="0"]'}}],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,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){function t(e){l(function(t){return{manual:"manual",color:e}}),m.setAttributes(n({},s,e))}var r=e.manual,o=e.color,l=e.setState,s=arguments[0].name,m=arguments[0].props,u=arguments[0].title,g=null===r&&null!==m.attributes[s]&&""!==m.attributes[s]||"manual"===r;g?null!==o&&m.setAttributes(n({},s,o)):m.setAttributes(n({},s,null));var w=m.attributes[s],h=wp.element.createElement("span",null,u,null!==w&&wp.element.createElement(c,{colorValue:m.attributes[s]}));return wp.element.createElement(a,{label:h,className:"ec-store-color-picker"},wp.element.createElement("select",{onChange:function(e){return l(function(e){return{manual:event.target.value,color:e.color}})}},wp.element.createElement("option",{value:"auto",selected:!g},p("Detect automatically","ecwid-shopping-cart")),wp.element.createElement("option",{value:"manual",selected:g},p("Set manually","ecwid-shopping-cart"))),g&&wp.element.createElement(i,{value:w,colors:d,onChange:t}))}r.d(t,"a",function(){return m});var l=wp.components,a=l.BaseControl,i=l.ColorPalette,c=l.ColorIndicator,s=wp.compose.withState,p=wp.i18n.__,d=[{name:p("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:p("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:p("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:p("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:p("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:p("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:p("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:p("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:p("Very light gray"),slug:"very-light-gray",color:"#eeeeee"},{name:p("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:p("Very dark gray"),slug:"very-dark-gray",color:"#313131"}],m=s({manual:null,color:null})(o)},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(8),l=(r.n(o),r(9)),a=(r.n(l),r(0));if(!EcwidGutenbergParams.isDemoStore){var i=wp.i18n,c=i.__,s=i._x,p=wp.blocks.registerBlockType,d=wp.editor.InspectorControls,m=wp.components,u=m.PanelBody,g=m.ToggleControl;wp.compose.withState,wp.element.Fragment;p("ecwid/product-block",{title:c("Product card small","ecwid-shopping-cart"),icon:a.a.product,category:"ec-store",attributes:{id:{type:"integer"},show_picture:{type:"boolean",default:!0},show_title:{type:"boolean",default:!0},show_price:{type:"boolean",default:!0},show_options:{type:"boolean",default:!0},show_qty:{type:"boolean",default:!1},show_addtobag:{type:"boolean",default:!0},show_price_on_button:{type:"boolean",default:!0},show_border:{type:"boolean",default:!0},center_align:{type:"boolean",default:!0}},description:c("Display product with a buy button","ecwid-shopping-cart"),alignWide:!1,supports:{customClassName:!1,className:!1,html:!1,align:!0,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){function t(e,t,r){return wp.element.createElement(g,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})}function r(e){ecwid_open_product_popup({saveCallback:l,props:e})}var o=e.attributes,l=function(e){var t={id:e.newProps.product.id};EcwidGutenbergParams.products[e.newProps.product.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)};return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-product"},EcwidGutenbergParams.products&&o.id&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("div",{className:"ec-store-block-image"},wp.element.createElement("img",{src:EcwidGutenbergParams.products[o.id].imageUrl})),EcwidGutenbergParams.products&&o.id&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("div",{className:"ec-store-product-title"},EcwidGutenbergParams.products[o.id].name),!o.id&&wp.element.createElement("div",{className:"ec-store-block-product-preview"},a.a.productPreview),!o.id&&wp.element.createElement("div",null,wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:l,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),wp.element.createElement(d,null,o.id&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Displayed product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[o.id].name),wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Change","ecwid-shopping-cart")))),!o.id&&wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Choose product","ecwid-shopping-cart"))),wp.element.createElement(u,{title:s("Content","gutenberg-product-block","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_picture",c("Picture","ecwid-shopping-cart")),t(e,"show_title",c("Title","ecwid-shopping-cart")),t(e,"show_price",c("Price","ecwid-shopping-cart")),t(e,"show_options",c("Options","ecwid-shopping-cart")),t(e,"show_qty",c("Quantity","ecwid-shopping-cart")),t(e,"show_addtobag",c("\xabBuy now\xbb button","ecwid-shopping-cart"))),wp.element.createElement(u,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_price_on_button",c("Show price inside the \xabBuy now\xbb button","ecwid-shopping-cart")),t(e,"show_border",c("Add border","ecwid-shopping-cart")),t(e,"center_align",c("Center align on a page","ecwid-shopping-cart"))))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(11),l=(r.n(o),r(12)),a=(r.n(l),r(0));if(!EcwidGutenbergParams.isDemoStore){var i=wp.i18n,c=i.__,s=(i._x,wp.blocks),p=(s.BlockControls,s.registerBlockType),d=wp.editor.InspectorControls,m=wp.components,u=m.PanelBody,g=m.ToggleControl;wp.compose.withState,wp.element.Fragment;p("ec-store/buynow",{title:c("Buy Now Button","ecwid-shopping-cart"),icon:a.a.button,category:"ec-store",attributes:{id:{type:"integer"},show_price_on_button:{type:"boolean",default:!0},center_align:{type:"boolean",default:!0}},description:c("Display a buy button","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,align:!0,alignWide:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){function t(e,t,r){return wp.element.createElement(g,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})}function r(e){ecwid_open_product_popup({saveCallback:l,props:e})}var o=e.attributes,l=function(e){var t={id:e.newProps.id};EcwidGutenbergParams.products[e.newProps.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)};return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-buynow"},!o.id&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"image"}),wp.element.createElement("div",{className:"button-container"},wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:l,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),o.id&&wp.element.createElement("div",{className:"image"})),wp.element.createElement(d,null,o.id&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Linked product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[o.id].name),wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Change","ecwid-shopping-cart")))),!o.id&&wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Choose product","ecwid-shopping-cart"))),wp.element.createElement("br",null),wp.element.createElement(u,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_price_on_button",c("Show price inside the \xabBuy now\xbb button","ecwid-shopping-cart")),t(e,"center_align",c("Center align on a page","ecwid-shopping-cart"))))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(14),o=(r.n(n),r(15)),l=(r.n(o),r(0));if(!EcwidGutenbergParams.isDemoStore){var a=wp.i18n,i=a.__;a._x;(0,wp.blocks.registerBlockType)("ec-store/search",{title:i("Product Search Box","ecwid-shopping-cart"),icon:l.a.search,category:"ec-store",description:i("Display search box","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){e.attributes;return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-search"},wp.element.createElement("div",{class:"image"}))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(17),o=(r.n(n),r(18)),l=(r.n(o),r(0));if(!EcwidGutenbergParams.isDemoStore){var a=wp.editor.InspectorControls,i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=EcwidGutenbergParams.blockParams["ec-store/categories"];s("ec-store/categories",{title:c("Store Categories Menu","ecwid-shopping-cart"),icon:l.a.categories,category:"ec-store",description:c("Display categories menu","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){var t=(e.attributes,wp.element.createElement("div",{className:"ec-store-block ec-store-block-categories"},wp.element.createElement("div",{className:"ec-store-block-header"},l.a.categories,c("Categories","ecwid-shopping-cart")))),r=c('The block is hidden because you don\'t have categories in your store. <a target="_blank" href="admin.php?page=ec-store-admin-category-id-0-mode-edit">Add categories.</a>',"ecwid-shopping-cart");return[t,wp.element.createElement(a,null,wp.element.createElement("div",{style:{height:"10px"}}),!p.has_categories&&wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(20),l=(r.n(o),r(21)),a=(r.n(l),r(0));if(!EcwidGutenbergParams.isDemoStore){var i=wp.i18n,c=i.__,s=(i._x,wp.editor.InspectorControls),p=wp.components,d=p.PanelBody,m=p.BaseControl;(0,wp.blocks.registerBlockType)("ec-store/minicart",{title:c("Shopping Cart Icon","ecwid-shopping-cart"),icon:a.a.cart,category:"ec-store",description:c("Display shopping bag link and summary","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable,align:!0,alignWide:!1},attributes:EcwidGutenbergParams.minicartAttributes,edit:function(e){function t(e,t,r,o){return wp.element.createElement(m,{label:r},wp.element.createElement("select",{className:"ec-store-inspector-select",onChange:function(r){e.setAttributes(n({},t,r.target.value))}},o.map(function(r){return wp.element.createElement("option",{value:r.value,selected:e.attributes[t]==r.value},r.title)})))}function r(e,r,n){var o=EcwidGutenbergParams.minicartAttributes[r];return"undefined"===typeof n&&(n=o.type),t(e,o.name,o.title,o.values)}e.attributes;return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-minicart"},wp.element.createElement("div",{className:"image"})),wp.element.createElement(s,null,wp.element.createElement(d,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!0},r(e,"layout","select"),r(e,"icon","select"),r(e,"fixed_shape","select")))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(23),o=(r.n(n),r(24)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,l.a,wp.blocks.registerBlockType),p=wp.editor.InspectorControls,d=wp.components,m=d.PanelBody,u=d.BaseControl,g=EcwidGutenbergParams.blockParams["ec-store/category-page"];s("ec-store/category-page",{title:c("Store Category Page","ecwid-shopping-cart"),icon:l.a.category,category:"ec-store",attributes:EcwidGutenbergStoreBlockParams.attributes,description:c("Display category page","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e,t){return wp.element.createElement(u,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes;e.setAttributes({widgets:""});var n=wp.element.createElement(a.d,{icon:l.a.category,title:c("Store Category Page","ecwid-shopping-cart"),showDemoButton:g.isDemoStore},wp.element.createElement("div",{className:"ec-store-category-products"},wp.element.createElement("div",{className:"ec-store-category-product1"}),wp.element.createElement("div",{className:"ec-store-category-product2"}),wp.element.createElement("div",{className:"ec-store-category-product3"})),wp.element.createElement("div",{className:"ec-store-category-products"},wp.element.createElement("div",{className:"ec-store-category-product4"}),wp.element.createElement("div",{className:"ec-store-category-product5"}),wp.element.createElement("div",{className:"ec-store-category-product6"}))),o=t("",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")),i=t(c("Display cart icon","ecwid-shopping-cart"),g.customizeMinicartText),s=g.isNewProductList,d=g.isNewDetailsPage,w=Object(a.a)(g.attributes,e);return[n,wp.element.createElement(p,null,wp.element.createElement("div",{style:{height:"10px"}}),!EcwidGutenbergParams.hasCategories&&wp.element.createElement("div",{style:{margin:"10px"}},wp.element.createElement("a",{href:"admin.php?page=ec-store-admin-category-id-0-mode-edit",target:"_blank",class:"button button-primary"},c("Add categories","ecwid-shopping-cart"))),EcwidGutenbergParams.hasCategories&&[!e.attributes.default_category_id&&w.select("default_category_id",c("Select category","ecwid-shopping-cart")),e.attributes.default_category_id&&w.select("default_category_id",c("Selected category","ecwid-shopping-cart"))],wp.element.createElement(m,{title:c("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[w.select("product_list_category_title_behavior"),"SHOW_TEXT_ONLY"!==r.product_list_category_title_behavior&&[w.buttonGroup("product_list_category_image_size"),w.toolbar("product_list_category_image_aspect_ratio")]],!s&&o),wp.element.createElement(m,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[w.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[w.buttonGroup("product_list_image_size"),w.toolbar("product_list_image_aspect_ratio")],w.toolbar("product_list_product_info_layout"),w.select("product_list_title_behavior"),w.select("product_list_price_behavior"),w.select("product_list_sku_behavior"),w.select("product_list_buybutton_behavior"),w.toggle("product_list_show_additional_image_on_hover"),w.toggle("product_list_show_frame")],!s&&o),wp.element.createElement(m,{title:c("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},d&&[w.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===r.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===r.product_details_layout)&&w.toggle("show_description_under_image"),w.toolbar("product_details_gallery_layout"),Object(a.c)(c("Product sidebar content","ecwid-shopping-cart")),w.toggle("product_details_show_product_name"),w.toggle("product_details_show_breadcrumbs"),w.toggle("product_details_show_product_sku"),w.toggle("product_details_show_product_price"),w.toggle("product_details_show_qty"),w.toggle("product_details_show_number_of_items_in_stock"),w.toggle("product_details_show_in_stock_label"),w.toggle("product_details_show_wholesale_prices"),w.toggle("product_details_show_share_buttons")],!d&&productDetailsMigrationWarning),wp.element.createElement(m,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},w.toggle("show_categories"),w.toggle("show_search"),w.toggle("show_breadcrumbs"),s&&w.toggle("show_footer_menu"),w.toggle("show_signin_link"),w.toggle("product_list_show_sort_viewas_options"),i),wp.element.createElement(m,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},w.color("chameleon_color_button"),w.color("chameleon_color_foreground"),w.color("chameleon_color_price"),w.color("chameleon_color_link"),w.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(26),o=(r.n(n),r(27)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=wp.editor.InspectorControls,d=wp.components,m=d.PanelBody,u=d.BaseControl,g=(wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/product-page"]);s("ec-store/product-page",{title:c("Product Card Large","ecwid-shopping-cart"),icon:l.a.product,category:"ec-store",attributes:g.attributes,description:c("Display product page with description and a buy button","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e){ecwid_open_product_popup({saveCallback:o,props:e})}function r(e,t){return wp.element.createElement(u,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var n=e.attributes,o=function(e){var t={default_product_id:e.newProps.product.id};EcwidGutenbergParams.products[e.newProps.product.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)},i=wp.element.createElement(a.d,{icon:l.a.product,title:c("Product Card Large","ecwid-shopping-cart")},wp.element.createElement(a.b,{src:"product-page-preview.png"}),!n.default_product_id&&wp.element.createElement("div",{className:"button-container"},wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:o,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),s=r("",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")),d=(r("",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")),g.isNewDetailsPage),w=Object(a.a)(g.attributes,e);return[i,wp.element.createElement(p,null,n.default_product_id>0&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Linked product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[n.default_product_id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[n.default_product_id].name),wp.element.createElement("button",{className:"button",onClick:function(){return t(e)}},c("Change","ecwid-shopping-cart")))),!n.default_product_id&&wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("button",{className:"button",onClick:function(){return t(e)}},c("Choose product","ecwid-shopping-cart"))),wp.element.createElement(m,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!1},d&&[w.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===n.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===n.product_details_layout)&&w.toggle("show_description_under_image"),w.toolbar("product_details_gallery_layout"),Object(a.c)(c("Product sidebar content","ecwid-shopping-cart")),w.toggle("product_details_show_product_name"),w.toggle("product_details_show_breadcrumbs"),w.toggle("product_details_show_product_sku"),w.toggle("product_details_show_product_price"),w.toggle("product_details_show_qty"),w.toggle("product_details_show_number_of_items_in_stock"),w.toggle("product_details_show_in_stock_label"),w.toggle("product_details_show_wholesale_prices"),w.toggle("product_details_show_share_buttons")],!d&&s),wp.element.createElement(m,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},w.color("chameleon_color_button"),w.color("chameleon_color_foreground"),w.color("chameleon_color_price"),w.color("chameleon_color_link"),w.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(29),o=(r.n(n),r(30)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=wp.editor.InspectorControls,d=wp.components,m=d.PanelBody,u=(d.PanelRow,d.ToggleControl,d.ButtonGroup,d.Button,d.BaseControl),g=(d.Toolbar,d.ColorPalette,d.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/filters-page"]);s("ec-store/filters-page",{title:c("Product Search and filters","ecwid-shopping-cart"),icon:l.a.filters,category:"ec-store",attributes:g.attributes,description:c("Display search page with filters on a side","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e,t){return wp.element.createElement(u,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes,n=wp.element.createElement(a.d,{icon:l.a.filters,title:c("Search and Filters","ecwid-shopping-cart")},wp.element.createElement(a.b,{src:"filter-preview.png"})),o=t("",c('You can enable filters in the store settings: (\u201c<a target="_blank" href="admin.php?page=ec-store-admin-product-filters-mode-main">Settings \u2192 Product Filters</a>\u201d).',"ecwid-shopping-cart")),i=t("",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")),s=g.isNewProductList,d=Object(a.a)(g.attributes,e);return[n,wp.element.createElement(p,null,wp.element.createElement(m,{title:c("Filters","ecwid-shopping-cart"),initialOpen:!1},!g.filtersEnabled&&o,g.filtersEnabled&&[d.select("product_filters_position_search_page")]),wp.element.createElement(m,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[d.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[d.buttonGroup("product_list_image_size"),d.toolbar("product_list_image_aspect_ratio")],d.toolbar("product_list_product_info_layout"),d.select("product_list_title_behavior"),d.select("product_list_price_behavior"),d.select("product_list_sku_behavior"),d.select("product_list_buybutton_behavior"),d.toggle("product_list_show_additional_image_on_hover"),d.toggle("product_list_show_frame")],!s&&i),wp.element.createElement(m,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},d.toggle("show_categories"),d.toggle("show_breadcrumbs"),s&&d.toggle("show_footer_menu"),d.toggle("show_signin_link"),d.toggle("product_list_show_sort_viewas_options")),wp.element.createElement(m,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},d.color("chameleon_color_button"),d.color("chameleon_color_foreground"),d.color("chameleon_color_price"),d.color("chameleon_color_link"),d.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(32),o=(r.n(n),r(33)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=(wp.editor.InspectorControls,wp.components),d=(p.PanelBody,p.PanelRow,p.ToggleControl,p.ButtonGroup,p.Button,p.BaseControl,p.Toolbar,p.ColorPalette,p.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/cart-page"]);s("ec-store/cart-page",{title:c("Cart and Checkout","ecwid-shopping-cart"),icon:l.a.cartPage,category:"ec-store",attributes:d.attributes,description:c("Display shopping cart and checkout page","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){e.attributes;return[wp.element.createElement(a.d,{icon:l.a.cartPage,title:c("Cart and Checkout")},wp.element.createElement(a.b,{src:"cart-page-preview.png"}))]},save:function(e){return null}})},function(e,t){},function(e,t){}]);
1
+ !function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n={ecwid: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"})),store:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-234.000000, -324.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"store-icon",transform:"translate(234.000000, 324.000000)"},wp.element.createElement("path",{d:"M9,20.4893188 L7,20.4893188 L7,14 C7,13.4477153 7.44771525,13 8,13 L16,13 C16.5522847,13 17,13.4477153 17,14 L17,20.4893188 C16.260376,20.4893188 15.5929565,20.4893188 15,20.4893188 L15,15 L9,15 L9,20.4893188 Z",id:"Rectangle-3"}),wp.element.createElement("path",{d:"M20,10 L22,10 L22,21.0006104 C22,21.5528951 21.5522847,22.0006104 21,22.0006104 L3,22.0006104 C2.44771525,22.0006104 2,21.5528951 2,21.0006104 L2,10 L4,10 L4,20.0006104 L20,20.0006104 L20,10 Z",id:"Rectangle-3"}),wp.element.createElement("path",{d:"M2,6.5 C2,7.88071187 3.11928813,9 4.5,9 C5.18185515,9 5.81786053,8.72707728 6.28575907,8.24959145 L7,7.52071565 L7.71424093,8.24959145 C8.18213947,8.72707728 8.81814485,9 9.5,9 C10.1818552,9 10.8178605,8.72707728 11.2857591,8.24959145 L12,7.52071565 L12.7142409,8.24959145 C13.1821395,8.72707728 13.8181448,9 14.5,9 C15.1818552,9 15.8178605,8.72707728 16.2857591,8.24959145 L17,7.52071565 L17.7142409,8.24959145 C18.1821395,8.72707728 18.8181448,9 19.5,9 C20.8807119,9 22,7.88071187 22,6.5 C22,5.81342077 21.7917279,4.97737648 21.3637104,4 L2.63518632,4 C2.20791709,4.97255801 2,5.80837301 2,6.5 Z M4.5,11 C2.01471863,11 4.4408921e-16,8.98528137 0,6.5 C0,5.33310646 0.374574518,4.02209564 1.10468286,2.55457075 L1.38058736,2 L22.6207487,2 L22.8961752,2.55629959 C23.6256977,4.02977127 24,5.33982925 24,6.5 C24,8.98528137 21.9852814,11 19.5,11 C18.5937006,11 17.7289225,10.73006 17,10.2422809 C16.2710775,10.73006 15.4062994,11 14.5,11 C13.5937006,11 12.7289225,10.73006 12,10.2422809 C11.2710775,10.73006 10.4062994,11 9.5,11 C8.59370056,11 7.72892246,10.73006 7,10.2422809 C6.27107754,10.73006 5.40629944,11 4.5,11 Z",id:"Combined-Shape"}))))),product:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-352.000000, -324.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"icon-product",transform:"translate(352.000000, 324.000000)"},wp.element.createElement("path",{d:"M4,9 L4,20 L20,20 L20,9 L4,9 Z M2,7 L22,7 L22,22 L2,22 L2,7 Z",id:"Rectangle-2-Copy-2"}),wp.element.createElement("path",{d:"M9,7 L15,7 L15,15 L12.0361633,14 L9,15 L9,7 Z M11,9 L11,12 L12.0361633,11.5393066 L13,12 L13,9 L11,9 Z",id:"Combined-Shape"}),wp.element.createElement("polygon",{id:"Line-3",points:"13 9 11 9 11 2 13 2"}),wp.element.createElement("polygon",{id:"Rectangle-2-Copy-2",points:"17.0387503 4 19.4387503 7 22 7 18 2 6 2 2 7 4.56124969 7 6.96124969 4"}))))),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"})))),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(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"})))),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(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"})))),cart:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-352.000000, -415.000000)",fill:"#555D66"},wp.element.createElement("g",{id:"cart-icon",transform:"translate(352.000000, 415.000000)"},wp.element.createElement("path",{d:"M4.5269723,4 L2,4 C1.44771525,4 1,3.55228475 1,3 C1,2.44771525 1.44771525,2 2,2 L5.33333333,2 C5.80393835,2 6.21086155,2.32812702 6.31061146,2.788039 L7.22413999,7 L21,7 C21.6640252,7 22.143636,7.63527258 21.9617572,8.27390353 L19.968471,15.272927 C19.8460922,15.7026358 19.4535094,15.9990234 19.0067139,15.9990234 L7.93579102,15.9990234 C7.465186,15.9990234 7.0582628,15.6708964 6.95851289,15.2109844 L4.5269723,4 Z M7.65791824,9 L8.74215205,13.9990234 L18.2517453,13.9990234 L19.6754416,9 L7.65791824,9 Z",id:"Path-3","fill-rule":"nonzero"}),wp.element.createElement("circle",{id:"Oval-2",cx:"9",cy:"20",r:"2"}),wp.element.createElement("circle",{id:"Oval-2",cx:"18",cy:"20",r:"2"}))))),search:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-469.000000, -324.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"search-icon",transform:"translate(469.000000, 324.000000)"},wp.element.createElement("path",{d:"M3.83470744,16.348799 C3.83470744,15.7965143 4.28242269,15.348799 4.83470744,15.348799 C5.38699219,15.348799 5.83470744,15.7965143 5.83470744,16.348799 L5.81335241,21.7511152 C5.81335241,22.3033999 5.36563716,22.7511152 4.81335241,22.7511152 C4.26106766,22.7511152 3.81335241,22.3033999 3.81335241,21.7511152 L3.83470744,16.348799 Z",id:"Line-2",transform:"translate(4.824030, 19.049957) scale(-1, 1) rotate(-45.000000) translate(-4.824030, -19.049957) "}),wp.element.createElement("path",{d:"M13,18 C16.8659932,18 20,14.8659932 20,11 C20,7.13400675 16.8659932,4 13,4 C9.13400675,4 6,7.13400675 6,11 C6,14.8659932 9.13400675,18 13,18 Z M13,20 C8.02943725,20 4,15.9705627 4,11 C4,6.02943725 8.02943725,2 13,2 C17.9705627,2 22,6.02943725 22,11 C22,15.9705627 17.9705627,20 13,20 Z",id:"Oval",transform:"translate(13.000000, 11.000000) scale(-1, 1) translate(-13.000000, -11.000000) "}),wp.element.createElement("path",{d:"M17,6 C17.5522847,6 18,6.44771525 18,7 C18,7.55228475 17.5522847,8 17,8 C15.0670034,8 13.5,9.56700338 13.5,11.5 C13.5,12.0522847 13.0522847,12.5 12.5,12.5 C11.9477153,12.5 11.5,12.0522847 11.5,11.5 C11.5,8.46243388 13.9624339,6 17,6 Z",id:"Oval",transform:"translate(14.750000, 9.250000) scale(-1, 1) translate(-14.750000, -9.250000) "}))))),categories:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-234.000000, -416.000000)"},wp.element.createElement("g",{id:"categories-icon",transform:"translate(234.000000, 416.000000)"},wp.element.createElement("polygon",{id:"Triangle",fill:"#555D66",points:"3 2 5.5 7 0.5 7"}),wp.element.createElement("polygon",{id:"Line",fill:"#555D66","fill-rule":"nonzero",points:"8 6 8 4 23 4 23 6"}),wp.element.createElement("polygon",{id:"Line",fill:"#555D66","fill-rule":"nonzero",points:"8 13 8 11 23 11 23 13"}),wp.element.createElement("polygon",{id:"Line",fill:"#555D66","fill-rule":"nonzero",points:"8 20 8 18 23 18 23 20"}),wp.element.createElement("rect",{id:"Rectangle",stroke:"#555D66","stroke-width":"2",fill:"#FFFFFF",x:"2",y:"11",width:"2",height:"2"}),wp.element.createElement("rect",{id:"Rectangle",stroke:"#555D66","stroke-width":"2",fill:"#FFFFFF",x:"2",y:"18",width:"2",height:"2",rx:"1"}))))),category:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-470.000000, -416.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"category-icon",transform:"translate(470.000000, 416.000000)"},wp.element.createElement("polygon",{id:"Line-4",points:"3 4 3 2 21 2 21 4"}),wp.element.createElement("path",{d:"M5,17 L5,20 L9,20 L9,17 L5,17 Z M3,15 L11,15 L11,22 L3,22 L3,15 Z",id:"Rectangle-2"}),wp.element.createElement("path",{d:"M5,8 L5,11 L9,11 L9,8 L5,8 Z M3,6 L11,6 L11,13 L3,13 L3,6 Z",id:"Rectangle-2-Copy"}),wp.element.createElement("path",{d:"M15,17 L15,20 L19,20 L19,17 L15,17 Z M13,15 L21,15 L21,22 L13,22 L13,15 Z",id:"Rectangle-2"}),wp.element.createElement("path",{d:"M15,8 L15,11 L19,11 L19,8 L15,8 Z M13,6 L21,6 L21,13 L13,13 L13,6 Z",id:"Rectangle-2-Copy-3"}))))),button:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-345.000000, -280.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"button-icon",transform:"translate(345.000000, 280.000000)"},wp.element.createElement("path",{d:"M4,8 L4,16 L20,16 L20,8 L4,8 Z M4,6 L20,6 C21.1045695,6 22,6.8954305 22,8 L22,16 C22,17.1045695 21.1045695,18 20,18 L4,18 C2.8954305,18 2,17.1045695 2,16 L2,8 C2,6.8954305 2.8954305,6 4,6 Z",id:"Rectangle-5"}),wp.element.createElement("path",{d:"M13.8320367,9.8101295 C14.2137832,9.41102047 14.8467917,9.3969454 15.2459008,9.77869195 C15.6450098,10.1604385 15.6590849,10.793447 15.2773383,11.192556 L12.2122748,14.3970238 C11.8300377,14.7966458 11.1960253,14.8101668 10.7970986,14.427204 L9.5128579,13.1943549 C9.11444327,12.8118837 9.10151859,12.1788506 9.48398981,11.780436 C9.86646103,11.3820214 10.4994941,11.3690967 10.8979087,11.7515679 L11.4594438,12.290632 L13.8320367,9.8101295 Z",id:"Line-6"}))))),productPreview:wp.element.createElement("svg",{width:"72px",height:"72px",viewBox:"0 0 72 72",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets",transform:"translate(-625.000000, -811.000000)",fill:"#AAAAAA"},wp.element.createElement("g",{id:"Group-2",transform:"translate(571.000000, 756.000000)"},wp.element.createElement("g",{id:"product-preview",transform:"translate(54.000000, 55.000000)"},wp.element.createElement("path",{d:"M6,25 L6,69 L66,69 L66,25 L6,25 Z M4,23 L68,23 L68,71 L4,71 L4,23 Z",id:"Rectangle-2-Copy-2","fill-rule":"nonzero"}),wp.element.createElement("path",{d:"M36.5,23.5 L65.836706,23.5 L67.2237665,22.8226349 L55.0328393,7.34740904 L39.8812213,0.895706316 L40.7501329,7.5 L17.0403124,7.5 L5.04031242,22.5 L6.32093727,22.5 L17.5209373,8.5 L36.5,8.5 L36.5,23.5 Z M42.9573255,16.6099474 L41.1011835,2.50206036 L54.4056315,8.16722056 L66.5284549,23.5566573 L42.9573255,16.6099474 Z",id:"Combined-Shape",stroke:"#AAAAAA"}),wp.element.createElement("path",{d:"M29.8056641,41.53125 C29.9375,38.2060547 32.2080078,35.6865234 36.4560547,35.6865234 C40.3232422,35.6865234 42.9306641,37.9863281 42.9306641,41.1210938 C42.9306641,43.3916016 41.7880859,44.9882812 39.8544922,46.1455078 C37.9648438,47.2587891 37.4228516,48.0351562 37.4228516,49.5439453 L37.4228516,50.4375 L34.390625,50.4375 L34.3759766,49.265625 C34.3027344,47.2001953 35.1962891,45.8818359 37.203125,44.6806641 C38.9755859,43.6113281 39.6054688,42.7617188 39.6054688,41.2529297 C39.6054688,39.5976562 38.3017578,38.3818359 36.2949219,38.3818359 C34.2734375,38.3818359 32.9697266,39.5976562 32.8378906,41.53125 L29.8056641,41.53125 Z M35.9287109,57.2197266 C34.859375,57.2197266 34.0097656,56.3994141 34.0097656,55.3300781 C34.0097656,54.2607422 34.859375,53.4404297 35.9287109,53.4404297 C37.0273438,53.4404297 37.8623047,54.2607422 37.8623047,55.3300781 C37.8623047,56.3994141 37.0273438,57.2197266 35.9287109,57.2197266 Z",id:"?"})))))),filters:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd","stroke-linecap":"square"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-354.000000, -500.000000)",stroke:"#555D66","stroke-width":"2"},wp.element.createElement("g",{id:"filter-icon",transform:"translate(354.000000, 500.000000)"},wp.element.createElement("path",{d:"M3,6 L21,6",id:"Line-5"}),wp.element.createElement("path",{d:"M7,12 L17,12",id:"Line-5"}),wp.element.createElement("path",{d:"M10,18 L14,18",id:"Line-5"}))))),cartPage:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-470.000000, -500.000000)",fill:"#555D66"},wp.element.createElement("g",{id:"cart-icon",transform:"translate(470.000000, 500.000000)"},wp.element.createElement("g",{id:"Group-6",transform:"translate(2.000000, 3.000000)"},wp.element.createElement("path",{d:"M2.5269723,1 L0,1 C-0.55228475,1 -1,0.55228475 -1,-1.11022302e-16 C-1,-0.55228475 -0.55228475,-1 0,-1 L3.33333333,-1 C3.80393835,-1 4.21086155,-0.671872981 4.31061146,-0.211960997 L6.74215205,10.9990234 L16.2517453,10.9990234 L17.6754416,6 L17.0067139,6 C16.4544291,6 16.0067139,5.55228475 16.0067139,5 C16.0067139,4.44771525 16.4544291,4 17.0067139,4 L19,4 C19.6640252,4 20.143636,4.63527258 19.9617572,5.27390353 L17.968471,12.272927 C17.8460922,12.7026358 17.4535094,12.9990234 17.0067139,12.9990234 L5.93579102,12.9990234 C5.465186,12.9990234 5.0582628,12.6708964 4.95851289,12.2109844 L2.5269723,1 Z",id:"Path-3","fill-rule":"nonzero"}),wp.element.createElement("path",{d:"M13.6266547,1.30878828 C14.0084012,0.909679249 14.6414097,0.895604177 15.0405188,1.27735072 C15.4396278,1.65909727 15.4537029,2.29210579 15.0719563,2.69121482 L11.0068929,6.89568259 C10.6246557,7.29530459 9.99064332,7.30882561 9.59171662,6.92586281 L7.61584318,5.00113813 C7.21742856,4.61866691 7.20450388,3.98563386 7.5869751,3.58721924 C7.96944632,3.18880462 8.60247937,3.17587994 9.00089399,3.55835116 L10.2540618,4.78929076 L13.6266547,1.30878828 Z",id:"Line-6","fill-rule":"nonzero"}),wp.element.createElement("circle",{id:"Oval-2",cx:"7",cy:"17",r:"2"}),wp.element.createElement("circle",{id:"Oval-2",cx:"16",cy:"17",r:"2"}))))))}},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=t.attributes,o=function(e,t,o,l){return wp.element.createElement(u,{label:o},wp.element.createElement(d,null,l.map(function(o){return wp.element.createElement(m,{isDefault:!0,isButton:!0,isPrimary:r[t]===o.value,onClick:function(){return e.setAttributes(n({},t,o.value))}},o.title)})))},l=function(e,t,r){return wp.element.createElement(w,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})},a=function(e,t,r,o){return wp.element.createElement(u,{label:r},wp.element.createElement("select",{onChange:function(r){e.setAttributes(n({},t,r.target.value))}},o.map(function(r){return wp.element.createElement("option",{value:r.value,selected:e.attributes[t]==r.value},r.title)})))},i=function(e,t,r){return wp.element.createElement(u,{label:r},wp.element.createElement("input",{type:"text",value:e.attributes[t],onChange:function(r){e.setAttributes(n({},t,r.target.value))}}))},p=function(e,t,r,o){return wp.element.createElement(u,{label:r},wp.element.createElement(g,{controls:o.map(function(r){return{icon:c.a[r.icon],title:r.title,isActive:e.attributes[t]===r.value,className:"ecwid-toolbar-icon",onClick:function(){return e.setAttributes(n({},t,r.value))}}})}))};return{buttonGroup:function(r){var n=e[r];return o(t,n.name,n.title,n.values)},toggle:function(r){var n=e[r];return l(t,n.name,n.title)},select:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=e[r];return a(t,o.name,n||o.title,o.values)},textbox:function(r){var n=e[r];return builtTextbox(t,n.name,n.title)},toolbar:function(r){var n=e[r];return p(t,n.name,n.title,n.values)},color:function(r){return wp.element.createElement(s.a,{props:t,name:r,title:e[r].title})},defaultCategoryId:function(r){var n=e[r];return n.values&&n.values.length>1?a(t,n.name,n.title,n.values):i(t,n.name,n.title)}}}function l(e){return wp.element.createElement("div",{className:"ec-store-inspector-subheader-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},e))}function a(e){return wp.element.createElement("div",{className:"ec-store-block ec-store-generic-block"},wp.element.createElement("div",{className:"ec-store-block-header"},e.icon,e.title),wp.element.createElement("div",{className:"ec-store-block-content"},e.children),e.showDemoButton&&wp.element.createElement("div",null,wp.element.createElement("a",{className:"button button-primary",href:"admin.php?page=ec-store"},h("Set up your store","ecwid-shopping-cart"))))}function i(e){var t=EcwidGutenbergParams.imagesUrl+e.src;return wp.element.createElement("img",{src:t})}r.d(t,"a",function(){return o}),r.d(t,"c",function(){return l}),r.d(t,"b",function(){return i}),r.d(t,"d",function(){return a});var c=r(0),s=r(6),p=wp.components,d=p.ButtonGroup,m=p.Button,u=p.BaseControl,g=p.Toolbar,w=p.ToggleControl,h=wp.i18n.__},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=(r(3),r(7),r(10),r(13),r(16),r(19),r(22),r(25),r(28),r(31),r(0));wp.blocks.updateCategory("ec-store",{icon:n.a.ecwid})},function(e,t,r){"use strict";var n=r(4),o=(r.n(n),r(5)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=wp.editor.InspectorControls,d=wp.components,m=d.PanelBody,u=(d.PanelRow,d.ToggleControl,d.ButtonGroup,d.Button,d.BaseControl),g=(d.Toolbar,d.ColorPalette,d.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ecwid/store-block"]);s("ecwid/store-block",{title:c("Store Home Page","ecwid-shopping-cart"),icon:l.a.store,category:"ec-store",attributes:g.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){return wp.element.createElement(u,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes;e.setAttributes({widgets:""});var n=wp.element.createElement(a.d,{icon:l.a.store,title:c("Store Home Page","ecwid-shopping-cart"),showDemoButton:g.isDemoStore},wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product1"}),wp.element.createElement("div",{className:"ec-store-product2"}),wp.element.createElement("div",{className:"ec-store-product3"})),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product4"}),wp.element.createElement("div",{className:"ec-store-product5"}),wp.element.createElement("div",{className:"ec-store-product6"}))),o=t("",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")),i=t(c("Display cart icon","ecwid-shopping-cart"),g.customizeMinicartText),s=(t("",c('To improve the look and feel of your product page and manage 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")),g.isNewProductList),d=g.isNewDetailsPage,w=g.attributes.default_category_id&&g.attributes.default_category_id.values&&g.attributes.default_category_id.values.length>0,h=Object(a.a)(g.attributes,e);return[n,wp.element.createElement(p,null,w&&wp.element.createElement(m,{title:c("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[h.select("product_list_category_title_behavior"),"SHOW_TEXT_ONLY"!==r.product_list_category_title_behavior&&[h.buttonGroup("product_list_category_image_size"),h.toolbar("product_list_category_image_aspect_ratio")]],!s&&o),wp.element.createElement(m,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[h.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[h.buttonGroup("product_list_image_size"),h.toolbar("product_list_image_aspect_ratio")],h.toolbar("product_list_product_info_layout"),h.select("product_list_title_behavior"),h.select("product_list_price_behavior"),h.select("product_list_sku_behavior"),h.select("product_list_buybutton_behavior"),h.toggle("product_list_show_additional_image_on_hover"),h.toggle("product_list_show_frame")],!s&&o),wp.element.createElement(m,{title:c("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},d&&[h.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===r.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===r.product_details_layout)&&h.toggle("show_description_under_image"),h.toolbar("product_details_gallery_layout"),Object(a.c)(c("Product sidebar content","ecwid-shopping-cart")),h.toggle("product_details_show_product_name"),h.toggle("product_details_show_breadcrumbs"),h.toggle("product_details_show_product_sku"),h.toggle("product_details_show_product_price"),h.toggle("product_details_show_qty"),h.toggle("product_details_show_number_of_items_in_stock"),h.toggle("product_details_show_in_stock_label"),h.toggle("product_details_show_wholesale_prices"),h.toggle("product_details_show_share_buttons")],!d&&o),w&&wp.element.createElement(m,{title:c("Store Front Page","ecwid-shopping-cart"),initialOpen:!1},h.defaultCategoryId("default_category_id")),wp.element.createElement(m,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},h.toggle("show_categories"),h.toggle("show_search"),h.toggle("show_breadcrumbs"),s&&h.toggle("show_footer_menu"),h.toggle("show_signin_link"),h.toggle("product_list_show_sort_viewas_options"),i),wp.element.createElement(m,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},h.color("chameleon_color_button"),h.color("chameleon_color_foreground"),h.color("chameleon_color_price"),h.color("chameleon_color_link"),h.color("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 r={widgets:t.join(" "),default_category_id:"undefined"!==typeof e.attributes.default_category_id?e.attributes.default_category_id:0};return new wp.shortcode({tag:g.shortcodeName,attrs:r,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={},r=["widgets","default_category_id"],n=0;n<r.length;n++)t[r[n]]=e.attributes[r[n]];return t.default_product_id=0,new wp.shortcode({tag:g.shortcodeName,attrs:t,type:"single"}).string()}},{save:function(e){return"[ecwid]"}},{save:function(e){return'[ecwid widgets="productbrowser" default_category_id="0" default_product_id="0"]'}},{save:function(e){return'[ecwid widgets="productbrowser" default_category_id="0"]'}}],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,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){function t(e){l(function(t){return{manual:"manual",color:e}}),m.setAttributes(n({},s,e))}var r=e.manual,o=e.color,l=e.setState,s=arguments[0].name,m=arguments[0].props,u=arguments[0].title,g=null===r&&null!==m.attributes[s]&&""!==m.attributes[s]||"manual"===r;g?null!==o&&m.setAttributes(n({},s,o)):m.setAttributes(n({},s,null));var w=m.attributes[s],h=wp.element.createElement("span",null,u,null!==w&&wp.element.createElement(c,{colorValue:m.attributes[s]}));return wp.element.createElement(a,{label:h,className:"ec-store-color-picker"},wp.element.createElement("select",{onChange:function(e){return l(function(e){return{manual:event.target.value,color:e.color}})}},wp.element.createElement("option",{value:"auto",selected:!g},p("Detect automatically","ecwid-shopping-cart")),wp.element.createElement("option",{value:"manual",selected:g},p("Set manually","ecwid-shopping-cart"))),g&&wp.element.createElement(i,{value:w,colors:d,onChange:t}))}r.d(t,"a",function(){return m});var l=wp.components,a=l.BaseControl,i=l.ColorPalette,c=l.ColorIndicator,s=wp.compose.withState,p=wp.i18n.__,d=[{name:p("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:p("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:p("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:p("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:p("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:p("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:p("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:p("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:p("Very light gray"),slug:"very-light-gray",color:"#eeeeee"},{name:p("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:p("Very dark gray"),slug:"very-dark-gray",color:"#313131"}],m=s({manual:null,color:null})(o)},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(8),l=(r.n(o),r(9)),a=(r.n(l),r(0));if(!EcwidGutenbergParams.isDemoStore){var i=wp.i18n,c=i.__,s=i._x,p=wp.blocks.registerBlockType,d=wp.editor.InspectorControls,m=wp.components,u=m.PanelBody,g=m.ToggleControl;wp.compose.withState,wp.element.Fragment;p("ecwid/product-block",{title:c("Product card small","ecwid-shopping-cart"),icon:a.a.product,category:"ec-store",attributes:{id:{type:"integer"},show_picture:{type:"boolean",default:!0},show_title:{type:"boolean",default:!0},show_price:{type:"boolean",default:!0},show_options:{type:"boolean",default:!0},show_qty:{type:"boolean",default:!1},show_addtobag:{type:"boolean",default:!0},show_price_on_button:{type:"boolean",default:!0},show_border:{type:"boolean",default:!0},center_align:{type:"boolean",default:!0}},description:c("Display product with a buy button","ecwid-shopping-cart"),alignWide:!1,supports:{customClassName:!1,className:!1,html:!1,align:!0,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){function t(e,t,r){return wp.element.createElement(g,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})}function r(e){ecwid_open_product_popup({saveCallback:l,props:e})}var o=e.attributes,l=function(e){var t={id:e.newProps.product.id};EcwidGutenbergParams.products[e.newProps.product.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)};return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-product"},EcwidGutenbergParams.products&&o.id&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("div",{className:"ec-store-block-image"},wp.element.createElement("img",{src:EcwidGutenbergParams.products[o.id].imageUrl})),EcwidGutenbergParams.products&&o.id&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("div",{className:"ec-store-product-title"},EcwidGutenbergParams.products[o.id].name),!o.id&&wp.element.createElement("div",{className:"ec-store-block-product-preview"},a.a.productPreview),!o.id&&wp.element.createElement("div",null,wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:l,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),wp.element.createElement(d,null,o.id&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Displayed product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[o.id].name),wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Change","ecwid-shopping-cart")))),!o.id&&wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Choose product","ecwid-shopping-cart"))),wp.element.createElement(u,{title:s("Content","gutenberg-product-block","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_picture",c("Picture","ecwid-shopping-cart")),t(e,"show_title",c("Title","ecwid-shopping-cart")),t(e,"show_price",c("Price","ecwid-shopping-cart")),t(e,"show_options",c("Options","ecwid-shopping-cart")),t(e,"show_qty",c("Quantity","ecwid-shopping-cart")),t(e,"show_addtobag",c("\xabBuy now\xbb button","ecwid-shopping-cart"))),wp.element.createElement(u,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_price_on_button",c("Show price inside the \xabBuy now\xbb button","ecwid-shopping-cart")),t(e,"show_border",c("Add border","ecwid-shopping-cart")),t(e,"center_align",c("Center align on a page","ecwid-shopping-cart"))))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(11),l=(r.n(o),r(12)),a=(r.n(l),r(0));if(!EcwidGutenbergParams.isDemoStore){var i=wp.i18n,c=i.__,s=(i._x,wp.blocks),p=(s.BlockControls,s.registerBlockType),d=wp.editor.InspectorControls,m=wp.components,u=m.PanelBody,g=m.ToggleControl;wp.compose.withState,wp.element.Fragment;p("ec-store/buynow",{title:c("Buy Now Button","ecwid-shopping-cart"),icon:a.a.button,category:"ec-store",attributes:{id:{type:"integer"},show_price_on_button:{type:"boolean",default:!0},center_align:{type:"boolean",default:!0}},description:c("Display a buy button","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,align:!0,alignWide:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){function t(e,t,r){return wp.element.createElement(g,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})}function r(e){ecwid_open_product_popup({saveCallback:l,props:e})}var o=e.attributes,l=function(e){var t={id:e.newProps.id};EcwidGutenbergParams.products[e.newProps.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)};return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-buynow"},!o.id&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"image"}),wp.element.createElement("div",{className:"button-container"},wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:l,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),o.id&&wp.element.createElement("div",{className:"image"})),wp.element.createElement(d,null,o.id&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Linked product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[o.id].name),wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Change","ecwid-shopping-cart")))),!o.id&&wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Choose product","ecwid-shopping-cart"))),wp.element.createElement("br",null),wp.element.createElement(u,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_price_on_button",c("Show price inside the \xabBuy now\xbb button","ecwid-shopping-cart")),t(e,"center_align",c("Center align on a page","ecwid-shopping-cart"))))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(14),o=(r.n(n),r(15)),l=(r.n(o),r(0));if(!EcwidGutenbergParams.isDemoStore){var a=wp.i18n,i=a.__;a._x;(0,wp.blocks.registerBlockType)("ec-store/search",{title:i("Product Search Box","ecwid-shopping-cart"),icon:l.a.search,category:"ec-store",description:i("Display search box","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){e.attributes;return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-search"},wp.element.createElement("div",{class:"image"}))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(17),o=(r.n(n),r(18)),l=(r.n(o),r(0));if(!EcwidGutenbergParams.isDemoStore){var a=wp.editor.InspectorControls,i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=EcwidGutenbergParams.blockParams["ec-store/categories"];s("ec-store/categories",{title:c("Store Categories Menu","ecwid-shopping-cart"),icon:l.a.categories,category:"ec-store",description:c("Display categories navigation bar","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){var t=(e.attributes,wp.element.createElement("div",{className:"ec-store-block ec-store-block-categories"},wp.element.createElement("div",{className:"ec-store-block-header"},l.a.categories,c("Categories","ecwid-shopping-cart")))),r=c('The block is hidden because you don\'t have categories in your store. <a target="_blank" href="admin.php?page=ec-store-admin-category-id-0-mode-edit">Add categories.</a>',"ecwid-shopping-cart");return[t,wp.element.createElement(a,null,wp.element.createElement("div",{style:{height:"10px"}}),!p.has_categories&&wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(20),l=(r.n(o),r(21)),a=(r.n(l),r(0));if(!EcwidGutenbergParams.isDemoStore){var i=wp.i18n,c=i.__,s=(i._x,wp.editor.InspectorControls),p=wp.components,d=p.PanelBody,m=p.BaseControl;(0,wp.blocks.registerBlockType)("ec-store/minicart",{title:c("Shopping Cart Icon","ecwid-shopping-cart"),icon:a.a.cart,category:"ec-store",description:c("Display shopping bag link and summary","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable,align:!0,alignWide:!1},attributes:EcwidGutenbergParams.minicartAttributes,edit:function(e){function t(e,t,r,o){return wp.element.createElement(m,{label:r},wp.element.createElement("select",{className:"ec-store-inspector-select",onChange:function(r){e.setAttributes(n({},t,r.target.value))}},o.map(function(r){return wp.element.createElement("option",{value:r.value,selected:e.attributes[t]==r.value},r.title)})))}function r(e,r,n){var o=EcwidGutenbergParams.minicartAttributes[r];return"undefined"===typeof n&&(n=o.type),t(e,o.name,o.title,o.values)}e.attributes;return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-minicart"},wp.element.createElement("div",{className:"image"})),wp.element.createElement(s,null,wp.element.createElement(d,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!0},r(e,"layout","select"),r(e,"icon","select"),r(e,"fixed_shape","select")))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(23),o=(r.n(n),r(24)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,l.a,wp.blocks.registerBlockType),p=wp.editor.InspectorControls,d=wp.components,m=d.PanelBody,u=d.BaseControl,g=EcwidGutenbergParams.blockParams["ec-store/category-page"];s("ec-store/category-page",{title:c("Store Category Page","ecwid-shopping-cart"),icon:l.a.category,category:"ec-store",attributes:EcwidGutenbergStoreBlockParams.attributes,description:c("Display category page","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e,t){return wp.element.createElement(u,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes;e.setAttributes({widgets:""});var n=wp.element.createElement(a.d,{icon:l.a.category,title:c("Store Category Page","ecwid-shopping-cart"),showDemoButton:g.isDemoStore},wp.element.createElement("div",{className:"ec-store-category-products"},wp.element.createElement("div",{className:"ec-store-category-product1"}),wp.element.createElement("div",{className:"ec-store-category-product2"}),wp.element.createElement("div",{className:"ec-store-category-product3"})),wp.element.createElement("div",{className:"ec-store-category-products"},wp.element.createElement("div",{className:"ec-store-category-product4"}),wp.element.createElement("div",{className:"ec-store-category-product5"}),wp.element.createElement("div",{className:"ec-store-category-product6"}))),o=t("",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")),i=t(c("Display cart icon","ecwid-shopping-cart"),g.customizeMinicartText),s=g.isNewProductList,d=g.isNewDetailsPage,w=Object(a.a)(g.attributes,e);return[n,wp.element.createElement(p,null,wp.element.createElement("div",{style:{height:"10px"}}),!EcwidGutenbergParams.hasCategories&&wp.element.createElement("div",{style:{margin:"10px"}},wp.element.createElement("a",{href:"admin.php?page=ec-store-admin-category-id-0-mode-edit",target:"_blank",class:"button button-primary"},c("Add categories","ecwid-shopping-cart"))),EcwidGutenbergParams.hasCategories&&[!e.attributes.default_category_id&&w.select("default_category_id",c("Select category","ecwid-shopping-cart")),e.attributes.default_category_id&&w.select("default_category_id",c("Selected category","ecwid-shopping-cart"))],wp.element.createElement(m,{title:c("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[w.select("product_list_category_title_behavior"),"SHOW_TEXT_ONLY"!==r.product_list_category_title_behavior&&[w.buttonGroup("product_list_category_image_size"),w.toolbar("product_list_category_image_aspect_ratio")]],!s&&o),wp.element.createElement(m,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[w.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[w.buttonGroup("product_list_image_size"),w.toolbar("product_list_image_aspect_ratio")],w.toolbar("product_list_product_info_layout"),w.select("product_list_title_behavior"),w.select("product_list_price_behavior"),w.select("product_list_sku_behavior"),w.select("product_list_buybutton_behavior"),w.toggle("product_list_show_additional_image_on_hover"),w.toggle("product_list_show_frame")],!s&&o),wp.element.createElement(m,{title:c("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},d&&[w.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===r.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===r.product_details_layout)&&w.toggle("show_description_under_image"),w.toolbar("product_details_gallery_layout"),Object(a.c)(c("Product sidebar content","ecwid-shopping-cart")),w.toggle("product_details_show_product_name"),w.toggle("product_details_show_breadcrumbs"),w.toggle("product_details_show_product_sku"),w.toggle("product_details_show_product_price"),w.toggle("product_details_show_qty"),w.toggle("product_details_show_number_of_items_in_stock"),w.toggle("product_details_show_in_stock_label"),w.toggle("product_details_show_wholesale_prices"),w.toggle("product_details_show_share_buttons")],!d&&productDetailsMigrationWarning),wp.element.createElement(m,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},w.toggle("show_categories"),w.toggle("show_search"),w.toggle("show_breadcrumbs"),s&&w.toggle("show_footer_menu"),w.toggle("show_signin_link"),w.toggle("product_list_show_sort_viewas_options"),i),wp.element.createElement(m,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},w.color("chameleon_color_button"),w.color("chameleon_color_foreground"),w.color("chameleon_color_price"),w.color("chameleon_color_link"),w.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(26),o=(r.n(n),r(27)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=wp.editor.InspectorControls,d=wp.components,m=d.PanelBody,u=d.BaseControl,g=(wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/product-page"]);s("ec-store/product-page",{title:c("Product Card Large","ecwid-shopping-cart"),icon:l.a.product,category:"ec-store",attributes:g.attributes,description:c("Display product page with description and a buy button","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e){ecwid_open_product_popup({saveCallback:o,props:e})}function r(e,t){return wp.element.createElement(u,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var n=e.attributes,o=function(e){var t={default_product_id:e.newProps.product.id};EcwidGutenbergParams.products[e.newProps.product.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)},i=wp.element.createElement(a.d,{icon:l.a.product,title:c("Product Card Large","ecwid-shopping-cart")},wp.element.createElement(a.b,{src:"product-page-preview.png"}),!n.default_product_id&&wp.element.createElement("div",{className:"button-container"},wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:o,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),s=r("",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")),d=(r("",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")),g.isNewDetailsPage),w=Object(a.a)(g.attributes,e);return[i,wp.element.createElement(p,null,n.default_product_id>0&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Linked product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[n.default_product_id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[n.default_product_id].name),wp.element.createElement("button",{className:"button",onClick:function(){return t(e)}},c("Change","ecwid-shopping-cart")))),!n.default_product_id&&wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("button",{className:"button",onClick:function(){return t(e)}},c("Choose product","ecwid-shopping-cart"))),wp.element.createElement(m,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!1},d&&[w.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===n.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===n.product_details_layout)&&w.toggle("show_description_under_image"),w.toolbar("product_details_gallery_layout"),Object(a.c)(c("Product sidebar content","ecwid-shopping-cart")),w.toggle("product_details_show_product_name"),w.toggle("product_details_show_breadcrumbs"),w.toggle("product_details_show_product_sku"),w.toggle("product_details_show_product_price"),w.toggle("product_details_show_qty"),w.toggle("product_details_show_number_of_items_in_stock"),w.toggle("product_details_show_in_stock_label"),w.toggle("product_details_show_wholesale_prices"),w.toggle("product_details_show_share_buttons")],!d&&s),wp.element.createElement(m,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},w.color("chameleon_color_button"),w.color("chameleon_color_foreground"),w.color("chameleon_color_price"),w.color("chameleon_color_link"),w.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(29),o=(r.n(n),r(30)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=wp.editor.InspectorControls,d=wp.components,m=d.PanelBody,u=(d.PanelRow,d.ToggleControl,d.ButtonGroup,d.Button,d.BaseControl),g=(d.Toolbar,d.ColorPalette,d.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/filters-page"]);s("ec-store/filters-page",{title:c("Product Search and filters","ecwid-shopping-cart"),icon:l.a.filters,category:"ec-store",attributes:g.attributes,description:c("Display search page with filters on a side","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e,t){return wp.element.createElement(u,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes,n=wp.element.createElement(a.d,{icon:l.a.filters,title:c("Search and Filters","ecwid-shopping-cart")},wp.element.createElement(a.b,{src:"filter-preview.png"})),o=t("",c('You can enable filters in the store settings: (\u201c<a target="_blank" href="admin.php?page=ec-store-admin-product-filters-mode-main">Settings \u2192 Product Filters</a>\u201d).',"ecwid-shopping-cart")),i=t("",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")),s=g.isNewProductList,d=Object(a.a)(g.attributes,e);return[n,wp.element.createElement(p,null,wp.element.createElement(m,{title:c("Filters","ecwid-shopping-cart"),initialOpen:!1},!g.filtersEnabled&&o,g.filtersEnabled&&[d.select("product_filters_position_search_page")]),wp.element.createElement(m,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[d.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[d.buttonGroup("product_list_image_size"),d.toolbar("product_list_image_aspect_ratio")],d.toolbar("product_list_product_info_layout"),d.select("product_list_title_behavior"),d.select("product_list_price_behavior"),d.select("product_list_sku_behavior"),d.select("product_list_buybutton_behavior"),d.toggle("product_list_show_additional_image_on_hover"),d.toggle("product_list_show_frame")],!s&&i),wp.element.createElement(m,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},d.toggle("show_categories"),d.toggle("show_breadcrumbs"),s&&d.toggle("show_footer_menu"),d.toggle("show_signin_link"),d.toggle("product_list_show_sort_viewas_options")),wp.element.createElement(m,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},d.color("chameleon_color_button"),d.color("chameleon_color_foreground"),d.color("chameleon_color_price"),d.color("chameleon_color_link"),d.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(32),o=(r.n(n),r(33)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=(wp.editor.InspectorControls,wp.components),d=(p.PanelBody,p.PanelRow,p.ToggleControl,p.ButtonGroup,p.Button,p.BaseControl,p.Toolbar,p.ColorPalette,p.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/cart-page"]);s("ec-store/cart-page",{title:c("Cart and Checkout","ecwid-shopping-cart"),icon:l.a.cartPage,category:"ec-store",attributes:d.attributes,description:c("Display shopping cart and checkout page","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){e.attributes;return[wp.element.createElement(a.d,{icon:l.a.cartPage,title:c("Cart and Checkout","ecwid-shopping-cart")},wp.element.createElement(a.b,{src:"cart-page-preview.png"}))]},save:function(e){return null}})},function(e,t){},function(e,t){}]);
js/importer.js CHANGED
@@ -1,3 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  jQuery(document).ready(function() {
2
  $wrapper = jQuery('.ecwid-importer');
3
 
@@ -75,73 +190,80 @@ jQuery(document).ready(function() {
75
  jQuery.ajax({
76
  'url': ajaxurl,
77
  'data': data,
78
- 'success': function (json) {
79
-
80
  try {
81
- data = jQuery.parseJSON(json);
82
  } catch(e) {
83
- status.errorMessages['json_failed'] = [];
84
- status.errorMessages['json_failed'][json] = 1;
85
- doImportComplete(status);
86
  }
87
 
88
- for (var i = 0; i < data.success.length; i++) {
89
- if (typeof status.success[data.success[i]] == 'undefined') {
90
- status.success[data.success[i]] = 1;
91
- } else {
92
- status.success[data.success[i]]++;
93
- }
94
- }
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
 
97
- for (var i = 0; i < data.error.length; i++) {
98
- if (typeof status.error[data.error[i]] == 'undefined') {
99
- status.error[data.error[i]] = 1;
100
- } else {
101
- status.error[data.error[i]]++;
102
- }
103
- }
104
 
105
- status.planLimitHit |= typeof data.plan_limit_hit != 'undefined';
106
 
107
- if (data.error_messages) {
108
- for (var import_type in data.error_messages) {
109
 
110
- var messages = data.error_messages[import_type];
111
 
112
- if ( !status.errorMessages[import_type] ) {
113
- status.errorMessages[import_type] = {};
114
- }
115
 
116
- for ( var message in messages ) {
117
- if ( !status.errorMessages[import_type].hasOwnProperty(message) ) {
118
- status.errorMessages[import_type][message] = 0;
119
- }
120
- status.errorMessages[import_type][message] += messages[message];
121
- }
122
  }
123
- }
124
 
125
- jQuery('#import-progress-current').text((status.success.create_category || 0) + (status.success.create_product || 0));
126
 
127
- if (data.status == 'complete') {
128
 
129
- doImportComplete(status);
130
- } else {
131
- do_import();
132
  }
133
- },
134
- 'error': function(jqXHR, textStatus, errorThrown) {
135
- status.errorMessages[textStatus] = [];
136
- status.errorMessages[textStatus][errorThrown] = 1;
137
- doImportComplete(status);
138
  }
139
- });
140
- };
 
141
 
 
 
 
 
 
 
 
 
142
  do_import( true );
143
 
144
- doImportComplete = function( status ) {
145
  jQuery('#import-results-products').text(status.success.create_product || 0);
146
  jQuery('#import-results-categories').text(status.success.create_category || 0);
147
  $wrapper.removeClass('state-woo-in-progress').addClass('state-woo-complete');
@@ -149,6 +271,13 @@ jQuery(document).ready(function() {
149
  if (status.planLimitHit) {
150
  jQuery('plan-limit-message').show();
151
  }
 
 
 
 
 
 
 
152
 
153
  var errorContent = '';
154
  for (var importType in status.errorMessages) {
@@ -157,9 +286,13 @@ jQuery(document).ready(function() {
157
  errorContent += ' ' + message + ':' + status.errorMessages[importType][message] + "\n";
158
  }
159
  }
160
-
161
  if (errorContent.length > 0) {
162
- jQuery('.ecwid-importer .errors').show().find('pre').text(errorContent);
 
 
 
 
163
  }
164
  }
165
  };
@@ -167,7 +300,7 @@ jQuery(document).ready(function() {
167
  jQuery('#ecwid-importer-woo-go').click(startWooImport);
168
 
169
  jQuery('.ecwid-importer .errors .btn-details').click(function() {
170
- jQuery('.ecwid-importer .errors .details').toggle();
171
  });
172
 
173
 
1
+ /* var sample = {"success":["main","import-woo-categories","create_category","create_category","upload_category_image","upload_category_image","import-woo-products","import-woo-products-batch","import-woo-product","import-woo-product","import-woo-product","create_product","create_product","create_variation","create_variation"],"error":["create_product","create_variation","create_variation","create_variation","create_variation","create_variation"],"total":21,"current":20,"error_messages":{"create_product":{"400 Bad Request:Negative numbers are not allowed: -4.0":[{"woo_id":21,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=21&action=edit","name":"neg price"}]},"create_variation":{"400 Bad Request:Stock settings are not same for product and combination. Please set the combination's SKU":[{"woo_id":9,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=9&action=edit","name":"test","ecwid_id":139559751,"ecwid_link":"http://localhost/wordpress/woocommerce/wp-admin/admin.php?page=ec-store&ec-store-page=product%3Amode%3Dedit%26id%3D139559751","variation_id":14},{"woo_id":9,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=9&action=edit","name":"test","ecwid_id":139559751,"ecwid_link":"http://localhost/wordpress/woocommerce/wp-admin/admin.php?page=ec-store&ec-store-page=product%3Amode%3Dedit%26id%3D139559751","variation_id":15},{"woo_id":9,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=9&action=edit","name":"test","ecwid_id":139559751,"ecwid_link":"http://localhost/wordpress/woocommerce/wp-admin/admin.php?page=ec-store&ec-store-page=product%3Amode%3Dedit%26id%3D139559751","variation_id":16}],"409 Conflict:New combination duplicates existing combination or the base product: {}":[{"woo_id":11,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=11&action=edit","name":"Test Var atts without value","ecwid_id":139559752,"ecwid_link":"http://localhost/wordpress/woocommerce/wp-admin/admin.php?page=ec-store&ec-store-page=product%3Amode%3Dedit%26id%3D139559752","variation_id":20}],"409 Conflict:New combination duplicates existing combination or the base product: {size**ZZZ=l}":[{"woo_id":11,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=11&action=edit","name":"Test Var atts without value","ecwid_id":139559752,"ecwid_link":"http://localhost/wordpress/woocommerce/wp-admin/admin.php?page=ec-store&ec-store-page=product%3Amode%3Dedit%26id%3D139559752","variation_id":12}]}},"status":"complete"}
2
+ jQuery(document).ready(function() {
3
+ jQuery('h2').after(renderImportLog(buildImportLog(sample)));
4
+
5
+ });
6
+
7
+ */
8
+
9
+ function renderImportLog(log) {
10
+ var logContainer = jQuery('<div>');
11
+ for ( var type in log ) {
12
+
13
+ var entryTypeContainer = jQuery('<div>').append('<h4>' + type + '</h4>').appendTo(logContainer);
14
+ entryTypeContainer.append(
15
+ renderImportLogEntryType(type, log[type])
16
+ ).appendTo(logContainer);
17
+ }
18
+
19
+ return logContainer;
20
+ }
21
+ function renderImportLogEntryType(type, data) {
22
+
23
+ var items = [];
24
+ for ( var error in data ) {
25
+ var item = jQuery('<div class="log-entry">');
26
+ var code = error.substr(0, error.indexOf(':'));
27
+ var errorText = error.substr(error.indexOf(':') + 1);
28
+ item.append('<div class="hidden">' + code + '</div>').append(errorText);
29
+ item.append(' ');
30
+ jQuery('<a href="#">')
31
+ .append('(' + Object.keys(data[error]).length + " total)" )
32
+ .click(function() {jQuery(this).closest('.log-entry').toggleClass('expanded'); return false;})
33
+ .appendTo(item);
34
+
35
+ item.append( renderProductLogEntries(data[error]) );
36
+
37
+ items[items.length] = item;
38
+ }
39
+ return items;
40
+ }
41
+
42
+ function renderProductLogEntries(data) {
43
+ var products = [];
44
+ for ( var i in data ) {
45
+ var entry = data[i];
46
+ var productContainer = jQuery('<div class="log-entry-product">');
47
+
48
+ var woo_link = jQuery('<a>').attr('href', entry.woo_link).append(entry.name).appendTo(productContainer);
49
+
50
+ if (entry.ecwid_link) {
51
+ var ecwid_link = jQuery('<a>').attr('href', entry.ecwid_link).append("Product at Ecwid");
52
+ productContainer.append(' (').append(ecwid_link).append( ' )');
53
+ }
54
+
55
+ if ( typeof entry.variations == 'array' && entry.variations.length > 0 ) {
56
+ productContainer.append(" Variations ");
57
+ for ( var j = 0; j < entry.variations.length; j++ ) {
58
+ productContainer.append('#' + entry.variations[j]);
59
+
60
+ if ( j + 1 < entry.variations.length ) {
61
+ productContainer.append(', ');
62
+ }
63
+ }
64
+ }
65
+ products[products.length] = productContainer;
66
+ }
67
+
68
+ return products;
69
+ }
70
+
71
+ function buildImportLog(data) {
72
+
73
+ var log = {};
74
+
75
+ for ( var type in data.error_messages) {
76
+ if ( typeof log[type] == 'undefined' ) {
77
+ log[type] = {};
78
+ }
79
+
80
+ for ( var message in data.error_messages[type] ) {
81
+ if ( typeof log[type][message] == 'undefined' ) {
82
+ log[type][message] = [];
83
+ }
84
+ log[type][message].concat( buildProductErrorLog( log[type][message], data.error_messages[type][message] ) );
85
+ }
86
+ }
87
+
88
+ return log;
89
+ }
90
+
91
+ function buildProductErrorLog(log, items) {
92
+
93
+ for (var i = 0; i < items.length; i++) {
94
+ var item = items[i];
95
+ if (!log[item.woo_id]) {
96
+ var entry = {
97
+ name: item.name,
98
+ type: 'variation',
99
+ woo_link: item.woo_link,
100
+ ecwid_link: item.ecwid_link,
101
+ variations: []
102
+ };
103
+ } else {
104
+ entry = log[item.woo_id];
105
+ }
106
+
107
+ if ( item.variation_id ) {
108
+ entry.variations[entry.variations.length] = item.variation_id;
109
+ }
110
+ log[item.woo_id] = entry;
111
+ }
112
+
113
+ return log;
114
+ }
115
+
116
  jQuery(document).ready(function() {
117
  $wrapper = jQuery('.ecwid-importer');
118
 
190
  jQuery.ajax({
191
  'url': ajaxurl,
192
  'data': data,
193
+ 'success': function(json) {
 
194
  try {
195
+ data = jQuery.parseJSON(json);
196
  } catch(e) {
197
+ status.errorMessages['json_failed'] = [];
198
+ status.errorMessages['json_failed'][json] = 1;
199
+ doImportComplete(status);
200
  }
201
 
202
+ processImportProgress(data);
203
+ },
204
+ 'error': function(jqXHR, textStatus, errorThrown) {
205
+ status.errorMessages[textStatus] = [];
206
+ status.errorMessages[textStatus][errorThrown] = 1;
207
+ doImportComplete(status);
208
+ }
209
+ });
210
+ };
211
+
212
+ processImportProgress = function (data) {
213
+
214
+ for (var i = 0; i < data.success.length; i++) {
215
+ if (typeof status.success[data.success[i]] == 'undefined') {
216
+ status.success[data.success[i]] = 1;
217
+ } else {
218
+ status.success[data.success[i]]++;
219
+ }
220
+ }
221
 
222
 
223
+ for (var i = 0; i < data.error.length; i++) {
224
+ if (typeof status.error[data.error[i]] == 'undefined') {
225
+ status.error[data.error[i]] = 1;
226
+ } else {
227
+ status.error[data.error[i]]++;
228
+ }
229
+ }
230
 
231
+ status.planLimitHit |= typeof data.plan_limit_hit != 'undefined';
232
 
233
+ if (data.error_messages) {
234
+ for (var import_type in data.error_messages) {
235
 
236
+ var messages = data.error_messages[import_type];
237
 
238
+ if ( !status.errorMessages[import_type] ) {
239
+ status.errorMessages[import_type] = {};
240
+ }
241
 
242
+ for ( var message in messages ) {
243
+ if ( !status.errorMessages[import_type].hasOwnProperty(message) ) {
244
+ status.errorMessages[import_type][message] = '';
 
 
 
245
  }
 
246
 
247
+ status.errorMessages[import_type][message] += messages[message];
248
 
 
249
 
 
 
 
250
  }
 
 
 
 
 
251
  }
252
+ }
253
+
254
+ jQuery('#import-progress-current').text((status.success.create_category || 0) + (status.success.create_product || 0));
255
 
256
+ if (data.status == 'complete') {
257
+
258
+ doImportComplete(data, status);
259
+ } else {
260
+ do_import();
261
+ }
262
+ }
263
+
264
  do_import( true );
265
 
266
+ doImportComplete = function( data, status ) {
267
  jQuery('#import-results-products').text(status.success.create_product || 0);
268
  jQuery('#import-results-categories').text(status.success.create_category || 0);
269
  $wrapper.removeClass('state-woo-in-progress').addClass('state-woo-complete');
271
  if (status.planLimitHit) {
272
  jQuery('plan-limit-message').show();
273
  }
274
+
275
+ var log = buildImportLog(data);
276
+ jQuery('#fancy-errors').append(renderImportLog(log));
277
+
278
+ for(var type in log) {
279
+ delete status.errorMessages[type];
280
+ }
281
 
282
  var errorContent = '';
283
  for (var importType in status.errorMessages) {
286
  errorContent += ' ' + message + ':' + status.errorMessages[importType][message] + "\n";
287
  }
288
  }
289
+
290
  if (errorContent.length > 0) {
291
+ jQuery('.ecwid-importer .errors').find('pre').text(errorContent).show();
292
+ }
293
+
294
+ if ( jQuery('pre.details').text().length || jQuery('#fancy-errors').text().length) {
295
+ jQuery('.ecwid-importer .errors').show();
296
  }
297
  }
298
  };
300
  jQuery('#ecwid-importer-woo-go').click(startWooImport);
301
 
302
  jQuery('.ecwid-importer .errors .btn-details').click(function() {
303
+ jQuery('.ecwid-importer .errors .details').each(function(idx, el) {if (jQuery(el).text().length) jQuery(el).toggle() });
304
  });
305
 
306
 
js/post-product.js CHANGED
@@ -1,5 +1,7 @@
1
- Ecwid.OnPageLoad.add(function(page) {
2
- if ( page.type != 'PRODUCT' || page.productId != ecwidPost.productId ) {
3
- location.href = ecwidPost.storePageUrl + location.hash;
4
- }
5
- });
 
 
1
+ if (typeof Ecwid != 'undefined') {
2
+ Ecwid.OnPageLoad.add(function(page) {
3
+ if ( page.type != 'PRODUCT' || page.productId != ecwidPost.productId ) {
4
+ location.href = ecwidPost.storePageUrl + location.hash;
5
+ }
6
+ });
7
+ }
js/product-popup.js CHANGED
@@ -8,9 +8,10 @@ jQuery(document).ready(function() {
8
  };
9
 
10
  popup().data( 'defaultSortBy', 'ADDED_TIME_DESC' );
11
-
12
  jQuery(document).on('click', '#insert-ecwid-product-button', function() {
13
  openPopup();
 
14
  });
15
 
16
  openPopup = function() {
8
  };
9
 
10
  popup().data( 'defaultSortBy', 'ADDED_TIME_DESC' );
11
+
12
  jQuery(document).on('click', '#insert-ecwid-product-button', function() {
13
  openPopup();
14
+ return false;
15
  });
16
 
17
  openPopup = function() {
js/static-page.js ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function () {
2
+ var isTouchDevice = false;
3
+ var staticId = null;
4
+ var staticContentClass = 'static-content';
5
+ var dynamicId = null;
6
+ var ecwidPageOpened = false;
7
+ var autoSwitchStaticToDynamicWhenReady = false;
8
+ var autoSwitchStaticToDynamicWhenReadyDefault = false;
9
+ var invisibleDynamicContainerStyle = "display: block !important; height: 0 !important; max-height: 0 !important; min-height: 0 !important; overflow-y: auto !important;";
10
+ var mainCategoryId = 0;
11
+
12
+ function find(selector) {
13
+ return document.querySelector(selector);
14
+ }
15
+
16
+ function isDynamicMode() {
17
+ function isVisible(elem) {
18
+ return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
19
+ }
20
+
21
+ var staticHtml = find('#' + staticId);
22
+ return !staticHtml || !isVisible(staticHtml);
23
+ }
24
+
25
+ function processStaticHomePage() {
26
+
27
+ window.ec = window.ec || {};
28
+ window.ec.storefront = window.ec.storefront || {};
29
+ window.ec.storefront.staticPages = window.ec.storefront.staticPages || {};
30
+
31
+
32
+ window.ec.storefront.staticPages.switchStaticToDynamic = switchToDynamicMode;
33
+
34
+ function isRootCategory() {
35
+ return window.location.hash === '' || window.location.hash.indexOf("#!/c/0/") !== -1;
36
+ }
37
+
38
+ function onDocumentReady(fn) {
39
+ if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading") {
40
+ fn();
41
+ } else {
42
+ document.addEventListener('DOMContentLoaded', fn);
43
+ }
44
+ }
45
+
46
+ onDocumentReady(function () {
47
+ var staticStorefrontEnabled = window.ec.storefront.staticPages.staticStorefrontEnabled || false;
48
+
49
+ if (staticStorefrontEnabled !== true) {
50
+ return;
51
+ }
52
+
53
+ staticId = ec.storefront.staticPages.staticContainerID;
54
+ dynamicId = ec.storefront.staticPages.dynamicContainerID;
55
+ if (!staticId || !document.querySelector("#" + staticId)) {
56
+ if (!!console) {
57
+ console.warn("Static storefront is enabled, but no staticContainerID is provided or container is not present");
58
+ }
59
+ return;
60
+ }
61
+ if (!dynamicId || !document.querySelector("#" + dynamicId)) {
62
+ if (!!console) {
63
+ console.warn("Static storefront is enabled, but no dynamicContainerID is provided or container is not present");
64
+ }
65
+ return;
66
+ }
67
+
68
+ var mainCategoryIdFromConfig = ec.storefront.staticPages.mainCategoryId;
69
+ if (mainCategoryIdFromConfig) {
70
+ mainCategoryId = mainCategoryIdFromConfig;
71
+ }
72
+
73
+
74
+ var autoSwitchStaticToDynamicWhenReadyFromConfig = ec.storefront.staticPages.autoSwitchStaticToDynamicWhenReady;
75
+ if (autoSwitchStaticToDynamicWhenReadyFromConfig) {
76
+ autoSwitchStaticToDynamicWhenReady = autoSwitchStaticToDynamicWhenReadyFromConfig;
77
+ } else {
78
+ autoSwitchStaticToDynamicWhenReady = autoSwitchStaticToDynamicWhenReadyDefault;
79
+ }
80
+
81
+ hideStorefront();
82
+ showStaticHtml();
83
+
84
+ window.ec.config = window.ec.config || {};
85
+ window.ec.config.navigation_scrolling = "DISABLED";
86
+ if (!!('ontouchstart' in window)) {
87
+ isTouchDevice = true;
88
+ document.body.classList.add('touchable');
89
+ }
90
+
91
+ if (!isRootCategory()) {
92
+ hideStorefront();
93
+ switchToDynamicMode();
94
+ return;
95
+ }
96
+
97
+ addStaticPageHandlers();
98
+
99
+
100
+ function setupAfterEcwidLoaded() {
101
+
102
+ Ecwid.OnAPILoaded.add(function () {
103
+ var storeClosed = window.ecwid_initial_data.data.storeClosed;
104
+ var storeClosedWrapper = document.querySelectorAll('.ecwid-maintenance-wrapper');
105
+ var storeClosedAndWrapperNotExists = storeClosed && storeClosedWrapper.length === 0;
106
+ var storeNotClosedAndWrapperExists = !storeClosed && storeClosedWrapper.length > 0;
107
+
108
+ if (!isDynamicMode()
109
+ && (storeNotClosedAndWrapperExists || storeClosedAndWrapperNotExists)) {
110
+ switchToDynamicMode();
111
+ }
112
+ });
113
+
114
+ Ecwid.OnPageLoad.add(function (openedPage) {
115
+ if (isDynamicMode()) {
116
+ // if we've already switched to dynamic, we don't need to dispatch this event anymore
117
+ return;
118
+ }
119
+
120
+ if (openedPage.type === "CART"
121
+ || openedPage.type === "ORDERS"
122
+ || openedPage.type === "FAVORITES"
123
+ || openedPage.type === "SIGN_IN") {
124
+ // static links from bottom of the page should be processed before page load event finishes,
125
+ // so self pre-opening scroll didn't make the page jump
126
+ switchToDynamicMode();
127
+ }
128
+ });
129
+
130
+ Ecwid.OnPageLoaded.add(function (openedPage) {
131
+ if (isDynamicMode()) {
132
+ // if we've already switched to dynamic, we don't need to dispatch this event anymore
133
+ return;
134
+ }
135
+
136
+ if (autoSwitchStaticToDynamicWhenReady) {
137
+ switchToDynamicMode();
138
+ return;
139
+ }
140
+
141
+ if (!ecwidPageOpened
142
+ && openedPage.type === "CATEGORY"
143
+ && openedPage.categoryId === mainCategoryId
144
+ && openedPage.offset === 0) {
145
+
146
+ // we don't need to dispatch root category loading,
147
+ // since our static contents covers it for the first time
148
+ return;
149
+ }
150
+ // other than self we must show opened page in dynamic view,
151
+ // because static view contains only root category page
152
+ switchToDynamicMode();
153
+ });
154
+ }
155
+
156
+ function ecwidLoaded() {
157
+ return !!Ecwid && !!Ecwid.OnAPILoaded && !!Ecwid.OnAPILoaded.add;
158
+ }
159
+
160
+ if (ecwidLoaded()) {
161
+ setupAfterEcwidLoaded();
162
+ } else {
163
+ var setupIntervalId = setInterval(function () {
164
+ if (ecwidLoaded()) {
165
+ setupAfterEcwidLoaded();
166
+ clearInterval(setupIntervalId);
167
+ }
168
+ }, 100);
169
+ }
170
+ });
171
+ }
172
+
173
+ function addStaticPageHandlers() {
174
+ function addClickHandlers(selector, elementProcessor) {
175
+ document.querySelectorAll(selector).forEach(elementProcessor);
176
+ }
177
+
178
+ addClickHandlers('#' + staticId + ' .ec-breadcrumbs a', function (element) {
179
+ var categoryId = element.getAttribute('categoryId');
180
+ if (categoryId !== mainCategoryId) {
181
+ addStaticClickEvent(element, openEcwidPage('category', {'id': categoryId}));
182
+ }
183
+ });
184
+
185
+ var orderByOptions = document.querySelector('#' + staticId + ' .grid__sort select');
186
+ if (!!orderByOptions) {
187
+ orderByOptions.addEventListener("change", function (event) {
188
+ openEcwidPage('category', {
189
+ 'id': mainCategoryId,
190
+ 'sort': orderByOptions.value
191
+ })(event);
192
+ });
193
+ }
194
+
195
+ addClickHandlers('#' + staticId + ' .grid__sort .grid-sort__item--filter', function (element) {
196
+ addStaticClickEvent(element, function () {
197
+ Ecwid.OnPageLoaded.add(function () {
198
+ if (isDynamicMode()) {
199
+ return;
200
+ }
201
+ switchToDynamicMode();
202
+ Ecwid.showProductFilters();
203
+ });
204
+ });
205
+ });
206
+
207
+ addClickHandlers('#' + staticId + ' .grid-category__card a', function (element) {
208
+ var categoryId = element.getAttribute('data-category-id');
209
+ addStaticClickEvent(element, openEcwidPage('category', {'id': categoryId}));
210
+ });
211
+
212
+ addClickHandlers('#' + staticId + ' .grid-product a', function (element) {
213
+ var productId = element.getAttribute('data-product-id');
214
+ addStaticClickEvent(element, openEcwidPage('product', {'id': productId}));
215
+ });
216
+
217
+ addClickHandlers('#' + staticId + ' .grid-product__buy-now', function (element) {
218
+ var productId = element.getAttribute('data-product-id');
219
+ addStaticClickEvent(element, openEcwidPage('product', {'id': productId}));
220
+ });
221
+
222
+ addClickHandlers('#' + staticId + ' .footer__link--all-products', function (element) {
223
+ addStaticClickEvent(element, openEcwidPage('search'));
224
+ });
225
+
226
+ addClickHandlers('#' + staticId + ' .footer__link--track-order', function (element) {
227
+ addStaticClickEvent(element, openEcwidPage('account/orders'));
228
+ });
229
+
230
+ addClickHandlers('#' + staticId + ' .footer__link--shopping-favorites', function (element) {
231
+ addStaticClickEvent(element, openEcwidPage('account/favorites'));
232
+ });
233
+
234
+ addClickHandlers('#' + staticId + ' .footer__link--shopping-cart', function (element) {
235
+ addStaticClickEvent(element, openEcwidPage('cart'));
236
+ });
237
+
238
+
239
+ addClickHandlers('#' + staticId + ' .footer__link--sigin-in', function (element) {
240
+ addStaticClickEvent(element, openEcwidPage('signin'));
241
+ });
242
+
243
+ addClickHandlers('#' + staticId + ' .pager__button', function (element) {
244
+ addStaticClickEvent(element, openEcwidPage('category', {
245
+ 'id': mainCategoryId,
246
+ 'page': 2
247
+ }));
248
+ });
249
+
250
+ addClickHandlers('#' + staticId + ' .pager__number', function (element) {
251
+ var pageNumber = element.getAttribute('data-page-number');
252
+ addStaticClickEvent(element, openEcwidPage('category', {
253
+ 'id': mainCategoryId,
254
+ 'page': pageNumber
255
+ }));
256
+ });
257
+
258
+ }
259
+
260
+ function addStaticClickEvent(el, callback) {
261
+ var x = 0,
262
+ y = 0,
263
+ dx = 0,
264
+ dy = 0,
265
+ isTap = false;
266
+
267
+ if (isTouchDevice) {
268
+ el.addEventListener('touchstart', function (e) {
269
+ isTap = true;
270
+ x = e.touches[0].clientX;
271
+ y = e.touches[0].clientY;
272
+ dx = 0;
273
+ dy = 0;
274
+ });
275
+ el.addEventListener('touchmove', function (e) {
276
+ dx = e.changedTouches[0].clientX - x;
277
+ dy = e.changedTouches[0].clientY - y;
278
+ });
279
+ el.addEventListener('touchend', function (e) {
280
+ if (isTap && Math.abs(dx) < 10 && Math.abs(dy) < 10) {
281
+ callback(e);
282
+ }
283
+ });
284
+ }
285
+
286
+ el.addEventListener('click', function (e) {
287
+ if (!isTap) {
288
+ callback(e);
289
+ } else {
290
+ isTap = false;
291
+ }
292
+ });
293
+ }
294
+
295
+ function openEcwidPage(page, params) {
296
+ return function (e) {
297
+ e.preventDefault();
298
+ // we must wait for Ecwid first page to be ready before changing it
299
+ Ecwid.OnPageLoaded.add(function () {
300
+ if (isDynamicMode()) {
301
+ // if we've already switched to dynamic, we don't need to dispatch this event anymore
302
+ return;
303
+ }
304
+ var onClickCallback = window.ec.storefront.staticPages.onClickCallback;
305
+ if (!autoSwitchStaticToDynamicWhenReady && onClickCallback) {
306
+ onClickCallback();
307
+ }
308
+ ecwidPageOpened = true;
309
+ Ecwid.openPage(page, params);
310
+ });
311
+ }
312
+ }
313
+
314
+ function hideStorefront() {
315
+ var dynamicEl = find('#' + dynamicId);
316
+ dynamicEl.setAttribute("style", dynamicEl.getAttribute("style") + invisibleDynamicContainerStyle);
317
+ }
318
+
319
+ function showStorefront() {
320
+ var dynamicEl = find('#' + dynamicId);
321
+ // disable zero-height trick to show the storefront
322
+ dynamicEl.style.height = "";
323
+ dynamicEl.style.maxHeight = "";
324
+ dynamicEl.style.minHeight = "";
325
+ dynamicEl.style.overflowY = "";
326
+ dynamicEl.style.display = "block";
327
+ }
328
+
329
+ function hideStaticHtml() {
330
+ var staticEl = find('#' + staticId);
331
+ if (!!staticEl) {
332
+ staticEl.style.opacity = 0;
333
+ staticEl.style.display = 'none';
334
+ }
335
+ }
336
+
337
+ function showStaticHtml() {
338
+ var element = find('#' + staticId + " ." + staticContentClass);
339
+ if (!!element) {
340
+ element.style.opacity = 1;
341
+ }
342
+ }
343
+
344
+ function switchToDynamicMode() {
345
+ requestAnimationFrame(function () {
346
+ showStorefront();
347
+ hideStaticHtml();
348
+ var staticEl = find('#' + staticId);
349
+ staticEl.remove();
350
+ var switchToDynamicCallback = window.ec.storefront.staticPages.switchToDynamicCallback;
351
+ if (!autoSwitchStaticToDynamicWhenReady && switchToDynamicCallback) {
352
+ switchToDynamicCallback();
353
+ }
354
+ });
355
+ }
356
+
357
+
358
+ processStaticHomePage();
359
+
360
+ })();
languages/ecwid-shopping-cart-ru_RU.mo CHANGED
Binary file
languages/ecwid-shopping-cart-ru_RU.po CHANGED
@@ -1293,8 +1293,12 @@ msgid "We're synchronizing your products. This may take a few minutes. Please do
1293
  msgstr "Товары загружаются. Это может занять несколько минут. Пожалуйста, не перезагружайте страницу."
1294
 
1295
  #: templates/sync.php:179
1296
- msgid "Products synchronized: %s out of %s"
1297
- msgstr "Загружено товаров: %s из %s"
 
 
 
 
1298
 
1299
  #: templates/sync.php:186
1300
  msgid "Products are successfully synchronized. The product pages are up to date."
1293
  msgstr "Товары загружаются. Это может занять несколько минут. Пожалуйста, не перезагружайте страницу."
1294
 
1295
  #: templates/sync.php:179
1296
+ msgid "Products synchronized: %1$s out of %2$s"
1297
+ msgstr "Загружено товаров: %1$s из %2$s"
1298
+
1299
+ #: templates/sync.php:179
1300
+ msgid "Deleted products synchronized: %1$s out of %2$s"
1301
+ msgstr "Обработано удалённых товаров: %1$s из %2$s"
1302
 
1303
  #: templates/sync.php:186
1304
  msgid "Products are successfully synchronized. The product pages are up to date."
lib/ecwid_catalog.php CHANGED
@@ -37,7 +37,8 @@ class EcwidCatalog
37
 
38
  public function get_category($id)
39
  {
40
- $data = $this->_get_data_for_category( $id, @$_GET['offset'] );
 
41
 
42
  if ( !$data ) {
43
  return '';
37
 
38
  public function get_category($id)
39
  {
40
+ $offset = ( isset($_GET['offset']) ) ? $_GET['offset'] : 0;
41
+ $data = $this->_get_data_for_category( $id, $offset );
42
 
43
  if ( !$data ) {
44
  return '';
lib/ecwid_platform.php CHANGED
@@ -456,8 +456,7 @@ class EcwidPlatform {
456
  $valid_from = max(
457
  EcwidPlatform::get( self::CATEGORIES_CACHE_VALID_FROM ),
458
  EcwidPlatform::get( self::PRODUCTS_CACHE_VALID_FROM ),
459
- EcwidPlatform::get( self::PROFILE_CACHE_VALID_FROM ),
460
- EcwidPlatform::get( self::FORCES_CATALOG_CACHE_RESET_VALID_FROM )
461
  );
462
 
463
  self::cache_log_record(
456
  $valid_from = max(
457
  EcwidPlatform::get( self::CATEGORIES_CACHE_VALID_FROM ),
458
  EcwidPlatform::get( self::PRODUCTS_CACHE_VALID_FROM ),
459
+ EcwidPlatform::get( self::PROFILE_CACHE_VALID_FROM )
 
460
  );
461
 
462
  self::cache_log_record(
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Ecwid
3
  Tags: ecommerce, e-commerce, storefront, online store, sell
4
  Requires at least: 3.7
5
  Tested up to: 5.2
6
- Stable tag: 6.7.1
7
 
8
  Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
@@ -48,6 +48,9 @@ With Ecwid, you can include your ecommerce shop on multiple websites, blogs, soc
48
 
49
  Ecwid works great on any Wordpress site, especially those running on mobile-optimized themes. Your online store looks perfect on smartphones and automatically adapts to your customer’s screen size: laptops, tablets, smart TVs or smart watches. Check out this [demo](https://ecwid.to/ecwid-demo-store)
50
 
 
 
 
51
 
52
  = Your Favorite Free Plugin =
53
 
@@ -149,9 +152,16 @@ You can use Ecwid’s built-in import tools to copy your store products from any
149
  * [Ecwid Help Center](http://help.ecwid.com/?source=wporg-plugin-site "Ecwid Help")
150
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
151
 
152
- == Changelog ==
153
- = 6.7.1 - May 8, 2019 =
154
- - Minor fixes and improvements.
 
 
 
 
 
 
 
155
 
156
  = 6.7 - May 8, 2019 =
157
  - **Improved compatibility with WPML (part 2)**. WPML is a popular plugin for multilingual sites. Ecwid now supports full-featured multilingual storefronts, too. So, in this update, we added a few more improvements for WPML support. Now, if you have enabled the multilingual mode in your ecommerce store and are using WPML on your WordPress site, your shop pages will be displayed in the language selected by a visitor in a language selector. Read more about setting up a multilingual e-commerce store in Ecwid in the Ecwid blog: [https://www.ecwid.com/blog/sell-around-the-globe-with-a-fully-multilingual-storefront.html](https://www.ecwid.com/blog/sell-around-the-globe-with-a-fully-multilingual-storefront.html)
3
  Tags: ecommerce, e-commerce, storefront, online store, sell
4
  Requires at least: 3.7
5
  Tested up to: 5.2
6
+ Stable tag: 6.7.2
7
 
8
  Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
48
 
49
  Ecwid works great on any Wordpress site, especially those running on mobile-optimized themes. Your online store looks perfect on smartphones and automatically adapts to your customer’s screen size: laptops, tablets, smart TVs or smart watches. Check out this [demo](https://ecwid.to/ecwid-demo-store)
50
 
51
+ = Hundreds of extensions and powerful API =
52
+
53
+ There is a lot of in-house and third party extensions built on the Ecwid Ecommerce APIs. You can find a ready made plugin extending features of your online storefront the way you want or build a custom addon yourself. The existing family of third party plugins include tax automation apps like TaxJar, fulfilment services like ShipStation, customer support tools like LiveChat and many others.
54
 
55
  = Your Favorite Free Plugin =
56
 
152
  * [Ecwid Help Center](http://help.ecwid.com/?source=wporg-plugin-site "Ecwid Help")
153
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
154
 
155
+ == Changelog ==
156
+ = 6.7.2 - May 28, 2019 =
157
+ - **SEO improvement: new ld+json and improved [schema.org](https://schema.org/) markup on product pages**. Ecwid adds product ecommerce data to product pages in a SEO-friendly microdata format so that search engines can index your store pages and better display them in search results. In this update, we enhanced the structured products data on store pages to make it meet the latest Google recommendations. Also, the plugin now adds the same product data in ld+json format in your storefront, which is an alternative way to expose your e-commerce information to search engines. This should increase chances the Google bot will crawl and index your product catalog well.
158
+ - **Improved compatibility with WPML (part 3): hreflang tags for SEO**. WPML is a popular plugin to build multilingual sites. As we mentioned before, Ecwid now supports full-featured multilingual storefronts, too. In this update, we further improved WPML support in Ecwid. Now, if you have enabled the multilingual mode in your ecommerce store and are using WPML on your WordPress site, your shop pages will have links to the alternative language versions so that search engines will know which version to display to customer. Those alternative links are specified in hreflang tags in your storefront — special HTML elements aimed to link language versions of the same page between each other.
159
+ - **Several fixes and improvements for the “Import from WooCommerce” tool**. If you import your products from WooCommerce to Ecwid, the import process now should be more stable and friendly.
160
+ - **A few fixes for the “Integrate with the site search” tool**. You can find that tool on the Ecwid Advanced setting page — it’s used to display your products in site search results.
161
+ - Minor fixes and improvements.
162
+
163
+ = 6.7.1 - May 8, 2019 =
164
+ - Minor fixes and improvements.
165
 
166
  = 6.7 - May 8, 2019 =
167
  - **Improved compatibility with WPML (part 2)**. WPML is a popular plugin for multilingual sites. Ecwid now supports full-featured multilingual storefronts, too. So, in this update, we added a few more improvements for WPML support. Now, if you have enabled the multilingual mode in your ecommerce store and are using WPML on your WordPress site, your shop pages will be displayed in the language selected by a visitor in a language selector. Read more about setting up a multilingual e-commerce store in Ecwid in the Ecwid blog: [https://www.ecwid.com/blog/sell-around-the-globe-with-a-fully-multilingual-storefront.html](https://www.ecwid.com/blog/sell-around-the-globe-with-a-fully-multilingual-storefront.html)
templates/importer/woo-complete.tpl.php CHANGED
@@ -23,5 +23,6 @@
23
 
24
  <div class="errors">
25
  <?php _e( 'Some of the items could not be imported.', 'ecwid-shopping-cart' ); ?> <a class="btn-details"><?php _e( 'Details...', 'ecwid-shopping-cart' ); ?></a>
 
26
  <pre class="details"></pre>
27
  </div>
23
 
24
  <div class="errors">
25
  <?php _e( 'Some of the items could not be imported.', 'ecwid-shopping-cart' ); ?> <a class="btn-details"><?php _e( 'Details...', 'ecwid-shopping-cart' ); ?></a>
26
+ <div class="details" id="fancy-errors"></div>
27
  <pre class="details"></pre>
28
  </div>
templates/sync.php CHANGED
@@ -26,16 +26,16 @@ function do_no_sse_sync(mode, offset, limit, time) {
26
  }
27
 
28
  function process_no_sse_sync(data) {
29
- var mode = 'deleted', offset = 0, limit = 20;
30
 
31
  var processed_updates = data.updated + data.created + data.deleted_disabled;
32
  var processed_deletes = data.deleted + data.skipped_deleted;
33
 
34
- if (processed_updates + processed_deletes == 0) {
35
  return do_no_sse_over();
36
  }
37
 
38
- update_no_sse_stuff(data);
39
 
40
  if (data.total == data.count + data.offset) {
41
  if (processed_updates > 0) {
@@ -49,27 +49,29 @@ function process_no_sse_sync(data) {
49
  }
50
  offset = parseInt(data.offset) + parseInt(data.limit);
51
  }
52
- if (mode == 'updated') {
53
- jQuery('#current_item').text('Updating products...');
54
- } else {
55
- jQuery('#current_item').text('Deleting products...');
56
- }
57
- do_no_sse_sync(mode, offset, limit, updatedFrom);
58
  }
59
 
60
  function update_no_sse_stuff(data) {
61
- var counters = ['created', 'updated', 'deleted', 'skipped_deleted', 'deleted_disabled'];
 
 
 
 
62
  for (var i = 0; i < counters.length; i++) {
63
- increment_progress_counter(data[counters[i]]);
64
  }
65
  }
66
 
67
- function increment_progress_counter(increment = 1) {
 
 
68
  if (increment == 0) {
69
  return;
70
  }
71
 
72
- var name = 'count_updated';
73
 
74
  var css = '#' + name;
75
  var current = jQuery(css).data('count');
@@ -79,16 +81,18 @@ function increment_progress_counter(increment = 1) {
79
  current += increment;
80
  }
81
  jQuery(css).data('count', current).text(current);
 
82
  }
83
 
84
  function do_no_sse_over() {
85
  jQuery('#sync-container').removeClass('state-in-progress').addClass('state-complete');
 
86
  }
87
 
88
  jQuery('#sync-button-slow').click(function() {
89
 
90
  jQuery('#sync-container').removeClass('state-initial').addClass('state-in-progress');
91
- var mode = 'deleted', offset = 0, limit = 100;
92
 
93
  jQuery('#current_item').text('Started importing...');
94
 
@@ -121,8 +125,16 @@ jQuery('#sync-button-slow').click(function() {
121
  <?php _e('We\'re synchronizing your products. This may take a few minutes. Please do not reload the page.', 'ecwid-shopping-cart'); ?>
122
  </div>
123
  </div>
124
- <div class="sync-block" id="update-progress">
125
- <?php echo sprintf(__( 'Products synchronized: %s out of %s', 'ecwid-shopping-cart' ),
 
 
 
 
 
 
 
 
126
  '<span id="count_updated">0</span>',
127
  '<span id="total_updated">' . ($estimation['total_updated']) . '</span>'
128
  );
26
  }
27
 
28
  function process_no_sse_sync(data) {
29
+ var mode = '<?php echo $estimation['last_update'] == 0 ? 'updated' : 'deleted'; ?>', offset = 0, limit = 20;
30
 
31
  var processed_updates = data.updated + data.created + data.deleted_disabled;
32
  var processed_deletes = data.deleted + data.skipped_deleted;
33
 
34
+ if ( processed_updates + processed_deletes == 0 ) {
35
  return do_no_sse_over();
36
  }
37
 
38
+ update_no_sse_stuff(data);
39
 
40
  if (data.total == data.count + data.offset) {
41
  if (processed_updates > 0) {
49
  }
50
  offset = parseInt(data.offset) + parseInt(data.limit);
51
  }
52
+
53
+ do_no_sse_sync(mode, offset, limit, updatedFrom);
 
 
 
 
54
  }
55
 
56
  function update_no_sse_stuff(data) {
57
+ var counters = ['deleted', 'skipped_deleted', 'deleted_disabled'];
58
+ for (var i = 0; i < counters.length; i++) {
59
+ increment_progress_counter(data[counters[i]], 'deleted');
60
+ }
61
+ var counters = ['created', 'updated'];
62
  for (var i = 0; i < counters.length; i++) {
63
+ increment_progress_counter(data[counters[i]], 'updated');
64
  }
65
  }
66
 
67
+ function increment_progress_counter(increment = 1, counter_type) {
68
+ debugger;
69
+
70
  if (increment == 0) {
71
  return;
72
  }
73
 
74
+ var name = 'count_' + counter_type;
75
 
76
  var css = '#' + name;
77
  var current = jQuery(css).data('count');
81
  current += increment;
82
  }
83
  jQuery(css).data('count', current).text(current);
84
+ jQuery('#' + counter_type + '-progress').show();
85
  }
86
 
87
  function do_no_sse_over() {
88
  jQuery('#sync-container').removeClass('state-in-progress').addClass('state-complete');
89
+ jQuery('#deleted-progress,#updated-progress').hide();
90
  }
91
 
92
  jQuery('#sync-button-slow').click(function() {
93
 
94
  jQuery('#sync-container').removeClass('state-initial').addClass('state-in-progress');
95
+ var mode = '<?php echo $estimation['last_update'] == 0 ? 'updated' : 'deleted'; ?>', offset = 0, limit = 100;
96
 
97
  jQuery('#current_item').text('Started importing...');
98
 
125
  <?php _e('We\'re synchronizing your products. This may take a few minutes. Please do not reload the page.', 'ecwid-shopping-cart'); ?>
126
  </div>
127
  </div>
128
+ <div class="sync-block" id="deleted-progress">
129
+ <?php echo sprintf(__( 'Deleted products synchronized: %1$s out of %2$s', 'ecwid-shopping-cart' ),
130
+ '<span id="count_deleted">0</span>',
131
+ '<span id="total_deleted">' . ($estimation['total_deleted']) . '</span>'
132
+ );
133
+ ?>
134
+ </div>
135
+
136
+ <div class="sync-block" id="updated-progress">
137
+ <?php echo sprintf(__( 'Products synchronized: %1$s out of %2$s', 'ecwid-shopping-cart' ),
138
  '<span id="count_updated">0</span>',
139
  '<span id="total_updated">' . ($estimation['total_updated']) . '</span>'
140
  );