Ecwid Ecommerce Shopping Cart - Version 6.1

Version Description

  • May 30, 2018 =
  • Compatibility with Gutenberg: buy now buttons in the page editor. Gutenberg editor is getting more and more popular and will soon be the default WordPress editor. To make sure Ecwid users are ready for it, we are adding Gutenberg support to our plugin. In the previous update, we added a Store block to the Gutenberg editor toolbar. This update brings another button to the editor toolbar Ecwid product. Use this one to add product widgets and buy now buttons to the pages and posts of your site.
  • Revamped cart widget for sidebar. We added a new sidebar widget that allows to display a cart icon along with items count and subtotal in the sidebar. The new shopping cart icon widget looks better and provides a lot of layout customization options dont forget to play with its settings when adding it to your sidebar. You can find the new widget under Appearance Widgets in your Wordpress admin backend.
  • New design/appearance settings: new customization options for your storefront. We added a lot of new design settings to your store dashboard. Read this detailed post to learn how to tweak your store appearance: https://www.ecwid.com/blog/new-ecwid-design-settings-dozens-of-customization-options-no-coding.html
  • Compatibility with WP Bakery page builder. We fixed a few issues and made Ecwid widgets work fine in the WP Bakery page builder. Now you can use that sitebuilder with the Ecwid plugin everything should work fine.
  • Fixed a pre-renderering issue in IE browser. The Ecwid e-commerce plugin adds prerender/preload tags to your site code those are special html codes aimed to make the store page loads faster for your customers. This pre-rendering technology didnt work well in old IE browsers (IE 11 and older) so we disabled it for IE visitors on your site. It works automatically, so no actions required from your side.
  • Compatibility with Polylang plugin. We got a report from one of our customers stating that Ecwid didnt work well with Polylang plugin. We fixed an issue, now everything should work fine.
  • Improvements and fixes for the plugin navigation in the WP admin menu.
  • Improvements and fixes for store pages SEO friendly urls.
Download this release

Release Info

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

Code changes from version 6.0.4 to 6.1

Files changed (53) hide show
  1. css/admin.css +3 -1
  2. css/gutenberg-product.css +0 -0
  3. css/gutenberg-store.css +132 -0
  4. css/product-popup.css +6 -2
  5. css/settings.css +1 -1
  6. ecwid-shopping-cart.php +26 -4
  7. images/ecwid-logo-blue.svg +30 -0
  8. images/gutenberg-block-product.svg +13 -0
  9. images/wordpress_20x20.svg +2 -4
  10. includes/class-ecwid-admin.php +2 -2
  11. includes/class-ecwid-integration-gutenberg.php +83 -8
  12. includes/class-ecwid-integration-wpbakery-composer.php +137 -0
  13. includes/class-ecwid-message-manager.php +4 -4
  14. includes/class-ecwid-seo-links.php +4 -7
  15. includes/class-ecwid-store-page.php +2 -2
  16. includes/importer/class-ecwid-import-page.php +1 -1
  17. includes/importer/class-ecwid-import.php +1 -1
  18. includes/importer/class-ecwid-importer.php +2 -7
  19. includes/oembed.php +2 -2
  20. includes/shortcodes/class-ecwid-shortcode-product.php +1 -1
  21. includes/shortcodes/class-ecwid-shortcode-productbrowser.php +1 -1
  22. includes/widgets.php +16 -4
  23. includes/widgets/class-ecwid-widget-floating-shopping-cart.php +1 -1
  24. includes/widgets/class-ecwid-widget-minicart-miniview.php +1 -1
  25. includes/widgets/class-ecwid-widget-minicart.php +1 -1
  26. includes/widgets/class-ecwid-widget-nsf-minicart.php +93 -0
  27. includes/widgets/nsf-minicart-editor.tpl.php +57 -0
  28. includes/widgets/nsf-minicart.tpl.php +18 -0
  29. js/admin-menu.js +6 -1
  30. js/admin.js +2 -1
  31. js/dashboard-blog.js +1 -1
  32. js/gutenberg-product.js +114 -0
  33. js/gutenberg-store.js +155 -0
  34. js/product-popup.js +160 -57
  35. js/store-editor-gutenberg.js +2 -2
  36. js/store-editor-page.js +1 -1
  37. languages/ecwid-shopping-cart-ru_RU.mo +0 -0
  38. languages/ecwid-shopping-cart-ru_RU.po +13 -0
  39. lib/ecwid_api_v3.php +2 -1
  40. lib/ecwid_catalog_entry.php +8 -4
  41. readme.txt +15 -3
  42. screenshot-1.png +0 -0
  43. screenshot-2.png +0 -0
  44. screenshot-3.png +0 -0
  45. screenshot-4.png +0 -0
  46. screenshot-5.png +0 -0
  47. screenshot-6.png +0 -0
  48. screenshot-7.png +0 -0
  49. templates/admin-head.php +1 -1
  50. templates/dashboard.php +1 -1
  51. templates/importer/landing.tpl.php +8 -6
  52. templates/importer/woo-main.tpl.php +3 -1
  53. templates/product-popup.php +28 -0
css/admin.css CHANGED
@@ -259,7 +259,9 @@ body[class*="_page_ecwid"] .ecwid-message {
259
 
260
  #available-widgets .widget-top.ecwid-widget-minicart .widget-title:before,
261
  #available-widgets .widget-top.ecwid-widget-minicart_miniview .widget-title:before,
262
- #available-widgets .widget-top.ecwid-widget-floatingshoppingcart .widget-title:before
 
 
263
  {
264
  content: "\e601";
265
  }
259
 
260
  #available-widgets .widget-top.ecwid-widget-minicart .widget-title:before,
261
  #available-widgets .widget-top.ecwid-widget-minicart_miniview .widget-title:before,
262
+ #available-widgets .widget-top.ecwid-widget-floatingshoppingcart .widget-title:before,
263
+ #available-widgets .widget-top.ecwid-widget-nsfminicart .widget-title:before
264
+
265
  {
266
  content: "\e601";
267
  }
css/gutenberg-product.css ADDED
File without changes
css/gutenberg-store.css ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ecwid-store-block-icon {
2
+ background: url('../images/wordpress_20x20.svg');
3
+ background-size: contain;
4
+ width: 20px;
5
+ height: 20px;
6
+ margin-bottom: 3px;
7
+ }
8
+
9
+ .ecwid-store-block {
10
+ position: relative;
11
+ }
12
+
13
+ .ecwid-store-block-button {
14
+ font-family: Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;
15
+ position: relative;
16
+ top:135px;
17
+ font-size: 14px;
18
+ }
19
+
20
+ .ecwid-product-block-icon {
21
+ background: url('../images/gutenberg-block-product.svg');
22
+ background-size: contain;
23
+ width: 20px;
24
+ height: 20px;
25
+ margin-bottom: 3px;
26
+ }
27
+
28
+ .ecwid-block {
29
+ text-align: center;
30
+ font-size: 13px;
31
+ font-family: 'Open Sans';
32
+ padding: 1em;
33
+ background-color: #f8f9f9;
34
+ display: flex;
35
+ flex-direction: column;
36
+ justify-content: center;
37
+ min-height: 220px;
38
+ }
39
+
40
+ .ecwid-block > div {
41
+ display: flex;
42
+ justify-content: center;
43
+ }
44
+
45
+ .ecwid-block .ecwid-block-header {
46
+ font-weight: 600;
47
+ margin-bottom: 1em;
48
+ }
49
+
50
+ .ecwid-block .ecwid-block-header svg {
51
+ max-height: 20px;
52
+ margin-right: 1ch;
53
+ }
54
+
55
+ .ecwid-block .ecwid-store-block-icon,
56
+ .ecwid-block .ecwid-product-block-icon {
57
+ margin-right: 10px;
58
+ }
59
+
60
+ .ecwid-block .ecwid-block-image {
61
+ height: 90px;
62
+ background-repeat: no-repeat;
63
+ background-size: contain;
64
+ background-position: 50% 50%;
65
+ }
66
+
67
+ .ecwid-block .ecwid-block-image img {
68
+ width: auto;
69
+ max-height: 100%;
70
+ -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
71
+ -moz-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
72
+ box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
73
+ }
74
+
75
+ .ecwid-block .ecwid-block-title {
76
+ margin-top: 11px;
77
+ margin-bottom: 1em;
78
+ }
79
+
80
+ .ecwid-block .ecwid-block-button {
81
+ font-weight: 400;
82
+ }
83
+
84
+ /*
85
+ Popup styles for selected product block
86
+ */
87
+
88
+ .ecwid-selected-product {
89
+ font-family: Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;
90
+ }
91
+
92
+ .ecwid-selected-product > div {
93
+ display: table-cell;
94
+ }
95
+
96
+ .ecwid-selected-product .ecwid-selected-product-image img {
97
+ -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
98
+ -moz-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
99
+ box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
100
+ }
101
+
102
+ .ecwid-selected-product .ecwid-selected-product-image {
103
+ padding-right: 25px;
104
+ vertical-align: top;
105
+ }
106
+
107
+ .ecwid-selected-product .ecwid-selected-product-details {
108
+ vertical-align: middle;
109
+ }
110
+
111
+ .ecwid-selected-product .ecwid-selected-product-name {
112
+ font-size: 20px;
113
+ font-weight: 600;
114
+ margin-bottom: 0.5em;
115
+ }
116
+
117
+ .ecwid-selected-product .ecwid-selected-product-sku {
118
+ font-size: 16px;
119
+ margin-bottom: 1em;
120
+ }
121
+
122
+ .media-frame-content.has-selected-product form,
123
+ .media-frame-content.has-selected-product .products,
124
+ .media-frame-content.has-selected-product .tablenav
125
+ {
126
+ display: none;
127
+ }
128
+
129
+ #ecwid-product-popup-content .media-frame-content.ecwid-selected-product {
130
+ padding-left: 20px;
131
+ padding-top: 40px;
132
+ }
css/product-popup.css CHANGED
@@ -5494,7 +5494,8 @@ body, html {
5494
  }
5495
 
5496
  #ecwid-product-popup-content .media-modal-content[data-mode=add-product] .media-menu a[data-content=add-product],
5497
- #ecwid-product-popup-content .media-modal-content .media-menu a[data-content=customize] {
 
5498
  display: inherit;
5499
  }
5500
 
@@ -5509,9 +5510,12 @@ body, html {
5509
 
5510
  #ecwid-product-popup-content .media-modal-content[data-active-dialog=add-product] .media-frame-title.add-product,
5511
  #ecwid-product-popup-content .media-modal-content[data-active-dialog=customize] .media-frame-title.customize,
 
5512
  #ecwid-product-popup-content .media-modal-content[data-active-dialog=add-product] .media-frame-content.add-product,
5513
  #ecwid-product-popup-content .media-modal-content[data-active-dialog=customize] .media-frame-content.customize,
 
5514
  #ecwid-product-popup-content .media-modal-content[data-mode=add-product] .media-frame-toolbar .media-toolbar-primary.add-product,
 
5515
  #ecwid-product-popup-content .media-modal-content[data-mode=customize] .media-frame-toolbar .media-toolbar-primary.customize {
5516
  display: inherit;
5517
  }
@@ -5635,7 +5639,7 @@ body, html {
5635
  vertical-align: top;
5636
  }
5637
 
5638
- .media-toolbar-primary.add-product .toolbar-link {
5639
  margin-top: 21px;
5640
  float: left;
5641
  }
5494
  }
5495
 
5496
  #ecwid-product-popup-content .media-modal-content[data-mode=add-product] .media-menu a[data-content=add-product],
5497
+ #ecwid-product-popup-content .media-modal-content .media-menu a[data-content=customize],
5498
+ #ecwid-product-popup-content .media-modal-content[data-mode=selected-product] .media-menu a[data-content=selected-product] {
5499
  display: inherit;
5500
  }
5501
 
5510
 
5511
  #ecwid-product-popup-content .media-modal-content[data-active-dialog=add-product] .media-frame-title.add-product,
5512
  #ecwid-product-popup-content .media-modal-content[data-active-dialog=customize] .media-frame-title.customize,
5513
+ #ecwid-product-popup-content .media-modal-content[data-active-dialog=selected-product] .media-frame-title.selected-product,
5514
  #ecwid-product-popup-content .media-modal-content[data-active-dialog=add-product] .media-frame-content.add-product,
5515
  #ecwid-product-popup-content .media-modal-content[data-active-dialog=customize] .media-frame-content.customize,
5516
+ #ecwid-product-popup-content .media-modal-content[data-active-dialog=selected-product] .media-frame-content.selected-product,
5517
  #ecwid-product-popup-content .media-modal-content[data-mode=add-product] .media-frame-toolbar .media-toolbar-primary.add-product,
5518
+ #ecwid-product-popup-content .media-modal-content[data-mode=selected-product] .media-frame-toolbar .media-toolbar-primary.selected-product,
5519
  #ecwid-product-popup-content .media-modal-content[data-mode=customize] .media-frame-toolbar .media-toolbar-primary.customize {
5520
  display: inherit;
5521
  }
5639
  vertical-align: top;
5640
  }
5641
 
5642
+ .media-toolbar-primary .toolbar-link {
5643
  margin-top: 21px;
5644
  float: left;
5645
  }
css/settings.css CHANGED
@@ -310,7 +310,7 @@ display: none;
310
 
311
 
312
  .ecwid-admin h2:before {
313
- background: url(../images/ecwid_logo_symbol_RGB.svg);
314
  width: 100px;
315
  height: 20px;
316
  border: 2px solid blue;
310
 
311
 
312
  .ecwid-admin h2:before {
313
+ background: url(../images/ecwid-logo-blue.svg);
314
  width: 100px;
315
  height: 20px;
316
  border: 2px solid blue;
ecwid-shopping-cart.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.ecwid.com?source=wporg
5
  Description: Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
6
  Text Domain: ecwid-shopping-cart
7
  Author: Ecwid Team
8
- Version: 6.0.4
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
@@ -153,7 +153,8 @@ function ecwid_init_integrations()
153
  'wordpress-seo-premium/wp-seo-premium.php' => 'wpseo',
154
  'divi-builder/divi-builder.php' => 'divibuilder',
155
  'autoptimize/autoptimize.php' => 'autoptimize',
156
- 'above-the-fold-optimization/abovethefold.php' => 'above-the-fold'
 
157
  );
158
 
159
 
@@ -650,6 +651,9 @@ function ecwid_check_version()
650
 
651
  // Since 5.8.1+
652
  add_option( Ecwid_Products::OPTION_SYNC_LIMIT, 20 );
 
 
 
653
 
654
  Ecwid_Config::load_from_ini();
655
 
@@ -1010,6 +1014,13 @@ function ecwid_ajax_crawling_fragment() {
1010
 
1011
  function ecwid_meta() {
1012
 
 
 
 
 
 
 
 
1013
  echo '<meta http-equiv="x-dns-prefetch-control" content="on">' . PHP_EOL;
1014
 
1015
  if (!Ecwid_Store_Page::is_store_page()) {
@@ -1514,6 +1525,9 @@ function _ecwid_get_single_product_widget_parts_v2($attributes) {
1514
 
1515
  function ecwid_shortcode($attributes)
1516
  {
 
 
 
1517
  $defaults = ecwid_get_default_pb_size();
1518
 
1519
  $attributes = shortcode_atts(
@@ -1617,7 +1631,7 @@ function ecwid_store_activate() {
1617
  $shortcode = Ecwid_Shortcode_Base::get_current_store_shortcode_name();
1618
 
1619
  $content = <<<EOT
1620
- [$shortcode widgets="productbrowser minicart categories search" grid="$defaults[grid_rows],$defaults[grid_columns]" list="$defaults[list_rows]" table="$defaults[table_rows]" default_category_id="0" category_view="grid" search_view="grid" minicart_layout="MiniAttachToProductBrowser" ]
1621
  EOT;
1622
  add_option("ecwid_store_page_id", '', '', 'yes');
1623
 
@@ -1871,6 +1885,14 @@ function ecwid_get_update_params_options() {
1871
  ),
1872
  'ecwid_print_html_catalog' => array(
1873
  'type' => 'bool'
 
 
 
 
 
 
 
 
1874
  )
1875
  );
1876
 
@@ -2777,7 +2799,7 @@ function ecwid_get_store_page_url()
2777
  static $link = null;
2778
 
2779
  if (is_null($link)) {
2780
- $link = get_page_link( Ecwid_Store_Page::get_current_store_page_id() );
2781
  }
2782
 
2783
  return $link;
5
  Description: Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
6
  Text Domain: ecwid-shopping-cart
7
  Author: Ecwid Team
8
+ Version: 6.1
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
153
  'wordpress-seo-premium/wp-seo-premium.php' => 'wpseo',
154
  'divi-builder/divi-builder.php' => 'divibuilder',
155
  'autoptimize/autoptimize.php' => 'autoptimize',
156
+ 'above-the-fold-optimization/abovethefold.php' => 'above-the-fold',
157
+ 'js_composer/js_composer.php' => 'wpbakery-composer'
158
  );
159
 
160
 
651
 
652
  // Since 5.8.1+
653
  add_option( Ecwid_Products::OPTION_SYNC_LIMIT, 20 );
654
+
655
+ // Since 6.0.x
656
+ add_option( 'ecwid_hide_prefetch', 'off' );
657
 
658
  Ecwid_Config::load_from_ini();
659
 
1014
 
1015
  function ecwid_meta() {
1016
 
1017
+ $is_ie = strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false
1018
+ || strpos( $_SERVER['HTTP_USER_AGENT'], 'Trident' ) !== false;
1019
+
1020
+ if ( $is_ie || ( get_option( 'ecwid_hide_prefetch' ) == 'on' ) ) {
1021
+ return;
1022
+ }
1023
+
1024
  echo '<meta http-equiv="x-dns-prefetch-control" content="on">' . PHP_EOL;
1025
 
1026
  if (!Ecwid_Store_Page::is_store_page()) {
1525
 
1526
  function ecwid_shortcode($attributes)
1527
  {
1528
+ if ( isset( $_GET['fl_builder'] ) ) {
1529
+ return '<div>Here goes the store </div>';
1530
+ }
1531
  $defaults = ecwid_get_default_pb_size();
1532
 
1533
  $attributes = shortcode_atts(
1631
  $shortcode = Ecwid_Shortcode_Base::get_current_store_shortcode_name();
1632
 
1633
  $content = <<<EOT
1634
+ [$shortcode widgets="productbrowser minicart search" grid="$defaults[grid_rows],$defaults[grid_columns]" list="$defaults[list_rows]" table="$defaults[table_rows]" default_category_id="0" category_view="grid" search_view="grid" minicart_layout="MiniAttachToProductBrowser" ]
1635
  EOT;
1636
  add_option("ecwid_store_page_id", '', '', 'yes');
1637
 
1885
  ),
1886
  'ecwid_print_html_catalog' => array(
1887
  'type' => 'bool'
1888
+ ),
1889
+
1890
+ 'ecwid_hide_prefetch' => array(
1891
+ 'values' => array(
1892
+ 'on',
1893
+ 'off',
1894
+ 'auto'
1895
+ )
1896
  )
1897
  );
1898
 
2799
  static $link = null;
2800
 
2801
  if (is_null($link)) {
2802
+ $link = get_permalink( Ecwid_Store_Page::get_current_store_page_id() );
2803
  }
2804
 
2805
  return $link;
images/ecwid-logo-blue.svg ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ viewBox="0 0 215 215" enable-background="new 0 0 215 215" xml:space="preserve">
6
+ <g>
7
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="#0086CC" d="M215,166.12c0,27-21.88,48.88-48.88,48.88H48.88
8
+ C21.89,215,0,193.11,0,166.12V48.89C0,21.89,21.89,0,48.88,0h117.23c27,0,48.88,21.89,48.88,48.88V166.12z"/>
9
+ <path fill="#FFFFFF" d="M53.46,150.61c-10.24,0-18.55,8.31-18.55,18.56c0,10.23,8.31,18.55,18.55,18.55
10
+ c10.25,0,18.56-8.31,18.56-18.55C72.03,158.92,63.71,150.61,53.46,150.61z M53.46,175.83c-3.67,0-6.65-2.98-6.65-6.66
11
+ c0-3.68,2.98-6.66,6.65-6.66c3.68,0,6.66,2.98,6.66,6.66C60.12,172.85,57.14,175.83,53.46,175.83z"/>
12
+ <path fill="#FFFFFF" d="M160.68,151.44c-10.24,0-18.55,8.31-18.55,18.56c0,10.23,8.31,18.55,18.55,18.55
13
+ c10.25,0,18.56-8.31,18.56-18.55C179.24,159.76,170.93,151.44,160.68,151.44z M160.68,176.66c-3.67,0-6.65-2.98-6.65-6.66
14
+ c0-3.68,2.98-6.66,6.65-6.66c3.68,0,6.66,2.98,6.66,6.66C167.34,173.68,164.36,176.66,160.68,176.66z"/>
15
+ <path fill="#FFFFFF" d="M191.17,33.62c-0.24-0.1-0.5-0.14-0.76-0.14l-2.74,0c-7.79,0-14.64,5.26-16.67,12.78l-15.53,57.84
16
+ c-2.86,10.67-13.58,18.11-24.62,18.11l-4.43-0.01c-4.84,0-8.36-2.62-10.33-4.79c-1-1.09-2.43-1.68-3.91-1.68l-10.44-0.01
17
+ c-1.57,0-3.05,0.66-4.11,1.82c-2.03,2.21-5.42,4.66-10.22,4.66l-4.65,0.01c-10.69,0-21.06-6.85-24.3-17.04L46.49,67.56
18
+ c-2.28-7.16-8.86-11.99-16.38-12.02l-3.12-0.01c-1.09,0-2.06,0.5-2.69,1.36c-0.63,0.86-0.81,1.95-0.49,2.97l16.29,51.17
19
+ c5.81,18.22,20.3,29.12,39.41,29.12h13.9c4.18,0,10.23-2.26,12.74-4.62c0.42-0.39,1.08-0.39,1.5,0c2.51,2.36,8.56,4.62,12.74,4.62
20
+ h12.65c19.74,0,35.9-11.97,41.03-31.04l19.18-71.44C193.7,36.08,192.93,34.37,191.17,33.62z"/>
21
+ <g>
22
+ <circle fill="#FFFFFF" cx="134.43" cy="94.95" r="9.7"/>
23
+ <circle fill="#FFFFFF" cx="107.09" cy="94.95" r="9.7"/>
24
+ <circle fill="#FFFFFF" cx="79.75" cy="94.95" r="9.7"/>
25
+ <circle fill="#FFFFFF" cx="134.43" cy="67.55" r="9.7"/>
26
+ <circle fill="#FFFFFF" cx="107.09" cy="67.55" r="9.7"/>
27
+ <circle fill="#FFFFFF" cx="79.75" cy="67.55" r="9.7"/>
28
+ </g>
29
+ </g>
30
+ </svg>
images/gutenberg-block-product.svg ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
6
+ <path fill="#231F20" d="M16.43,5.12c-0.13-1.19-0.15-1.19-1.35-1.33c-0.21-0.02-0.21-0.02-0.43-0.05c-0.01,0.06,0.06,0.78,0.14,1.13
7
+ c0.57,0.37,0.87,0.98,0.87,1.71c0,1.14-0.93,2.07-2.07,2.07s-2.07-0.93-2.07-2.07c0-0.54,0.09-0.97,0.55-1.4
8
+ c-0.06-0.61-0.19-1.54-0.18-1.64C10.14,3.46,8.72,3.46,8.58,3.6l-8.17,8.13c-0.56,0.55-0.56,1.43,0,1.97l5.54,5.93
9
+ c0.56,0.55,1.46,0.55,2.01,0l8.67-8.14C17.04,11.09,16.68,7.14,16.43,5.12z M16.06,0.04c-1.91,0-3.46,1.53-3.46,3.41c0,0.74,0.4,3.09,0.44,3.28c0.07,0.34,0.52,0.56,0.86,0.49
10
+ C14,7.19,14.07,7.15,14.12,7.1c0.24-0.11,0.32-0.39,0.25-0.68c-0.09-0.45-0.39-2.44-0.39-2.94c0-1.16,0.94-2.09,2.11-2.09
11
+ c1.24,0,2.11,0.96,2.11,2.34c0,2.43-0.31,4.23-0.32,4.26c-0.1,0.17-0.1,0.38-0.03,0.55c0.03,0.17,0.13,0.31,0.28,0.4
12
+ c0.1,0.06,0.22,0.09,0.33,0.09c0.21,0,0.42-0.1,0.54-0.3c0.06-0.09,0.52-2.17,0.52-5.03C19.52,1.61,18.04,0.04,16.06,0.04z"/>
13
+ </svg>
images/wordpress_20x20.svg CHANGED
@@ -4,8 +4,7 @@
4
  <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
  viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
6
  <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
7
- C15.98,15.88,15.69,15.58,15.32,15.58z"/>
8
- <path fill="#555d66" d="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
9
  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
10
  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
11
  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
@@ -17,7 +16,6 @@
17
  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
18
  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
19
  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
20
- c0.1,0,0.2,0.05,0.26,0.13C18.48,2.58,18.5,2.68,18.48,2.79z"/>
21
- <path fill="#555d66" d="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
22
  S4.96,15.5,4.6,15.5z"/>
23
  </svg>
4
  <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
  viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
6
  <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
7
+ 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
 
8
  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
9
  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
10
  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
16
  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
17
  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
18
  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
19
+ 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
 
20
  S4.96,15.5,4.6,15.5z"/>
21
  </svg>
includes/class-ecwid-admin.php CHANGED
@@ -290,8 +290,8 @@ class Ecwid_Admin {
290
  } else {
291
  $match = array();
292
 
293
- $slug = strtolower( $title );
294
- $result = preg_match_all( '#[\p{L}0-9\-_]+#u', strtolower( $title ), $match );
295
 
296
  if ( $result && count( @$match[0] ) > 0 ) {
297
  $slug = implode('-', $match[0] );
290
  } else {
291
  $match = array();
292
 
293
+ $slug = mb_strtolower( $title );
294
+ $result = preg_match_all( '#[\p{L}0-9\-_]+#u', $slug, $match );
295
 
296
  if ( $result && count( @$match[0] ) > 0 ) {
297
  $slug = implode('-', $match[0] );
includes/class-ecwid-integration-gutenberg.php CHANGED
@@ -3,6 +3,7 @@
3
  class Ecwid_Integration_Gutenberg {
4
 
5
  const STORE_BLOCK = 'ecwid/store-block';
 
6
 
7
  public function __construct() {
8
 
@@ -12,14 +13,26 @@ class Ecwid_Integration_Gutenberg {
12
  add_action( 'admin_enqueue_scripts', function() {
13
  EcwidPlatform::enqueue_script( 'store-editor-gutenberg' );
14
  EcwidPlatform::enqueue_style( 'store-popup' );
15
-
16
  wp_localize_script( 'ecwid-store-editor-gutenberg', 'EcwidGutenbergParams',
17
  array(
18
  'ecwid_pb_defaults' => ecwid_get_default_pb_size(),
19
  'storeImageUrl' => site_url('?file=ecwid_store_svg.svg'),
20
- 'title' => sprintf( __( '%s store', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ),
21
  'storeShortcodeName' => Ecwid_Shortcode_Base::get_current_store_shortcode_name(),
22
- 'storeBlock' => self::STORE_BLOCK
 
 
 
 
 
 
 
 
 
 
 
 
23
  )
24
  );
25
 
@@ -28,10 +41,15 @@ class Ecwid_Integration_Gutenberg {
28
  add_action( "rest_insert_post", array( $this, 'on_save_post' ), 10, 3 );
29
  add_action( "rest_insert_page", array( $this, 'on_save_post' ), 10, 3 );
30
 
31
- register_block_type('ecwid/store-block', array(
32
- 'editor_script' => 'ecwid-block-store',
33
  'render_callback' => array( $this, 'render_callback' ),
34
  ));
 
 
 
 
 
35
 
36
  add_action( 'in_admin_header', array( $this, 'add_popup' ) );
37
  }
@@ -43,12 +61,16 @@ class Ecwid_Integration_Gutenberg {
43
  }
44
 
45
  public function enqueue_block_editor_assets() {
46
- EcwidPlatform::enqueue_script( 'gutenberg-block', array( 'wp-blocks', 'wp-i18n', 'wp-element' ) );
47
- EcwidPlatform::enqueue_style( 'gutenberg-block', array( 'wp-edit-blocks' ) );
 
 
 
 
48
 
49
  $storeImageUrl = site_url('?file=ecwid_store_svg.svg');
50
 
51
- wp_add_inline_style('ecwid-gutenberg-block', <<<CSS
52
  .editor-block-list__block[data-type="ecwid/store-block"] .editor-block-list__block-edit {
53
  background-image: url("$storeImageUrl")
54
  }
@@ -56,6 +78,29 @@ CSS
56
  );
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  public function render_callback( $params ) {
60
  if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
61
  return '';
@@ -77,6 +122,36 @@ CSS
77
 
78
  return get_option( 'ecwid_plugin_version' );
79
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
81
 
82
  $ecwid_gutenberg = new Ecwid_Integration_Gutenberg();
3
  class Ecwid_Integration_Gutenberg {
4
 
5
  const STORE_BLOCK = 'ecwid/store-block';
6
+ const PRODUCT_BLOCK = 'ec-store/product-block';
7
 
8
  public function __construct() {
9
 
13
  add_action( 'admin_enqueue_scripts', function() {
14
  EcwidPlatform::enqueue_script( 'store-editor-gutenberg' );
15
  EcwidPlatform::enqueue_style( 'store-popup' );
16
+
17
  wp_localize_script( 'ecwid-store-editor-gutenberg', 'EcwidGutenbergParams',
18
  array(
19
  'ecwid_pb_defaults' => ecwid_get_default_pb_size(),
20
  'storeImageUrl' => site_url('?file=ecwid_store_svg.svg'),
21
+ 'storeBlockTitle' => sprintf( __( '%s store', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ),
22
  'storeShortcodeName' => Ecwid_Shortcode_Base::get_current_store_shortcode_name(),
23
+ 'storeBlock' => self::STORE_BLOCK,
24
+ 'productBlockTitle' => sprintf( __( '%s product', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ),
25
+ 'productShortcodeName' => Ecwid_Shortcode_Product::get_shortcode_name(),
26
+ 'productBlock' => self::PRODUCT_BLOCK,
27
+ 'storeId' => get_ecwid_store_id(),
28
+ 'chooseProduct' => __( 'Choose product', 'ecwid-shopping-cart' ),
29
+ 'editAppearance' => __( 'Edit Appearance', 'ecwid-shopping-cart' ),
30
+ 'yourStoreWill' => __( 'Your store will be shown here', 'ecwid-shopping-cart' ),
31
+ 'storeIdLabel' => __( 'Store ID', 'ecwid-shopping-cart' ),
32
+ 'yourProductLabel' => __( 'Your product', 'ecwid-shopping-cart' ),
33
+ 'storeIcon' => $this->_get_store_icon_path(),
34
+ 'productIcon' => $this->_get_product_icon_path(),
35
+
36
  )
37
  );
38
 
41
  add_action( "rest_insert_post", array( $this, 'on_save_post' ), 10, 3 );
42
  add_action( "rest_insert_page", array( $this, 'on_save_post' ), 10, 3 );
43
 
44
+ register_block_type(self::STORE_BLOCK, array(
45
+ 'editor_script' => 'ecwid-gutenberg-store',
46
  'render_callback' => array( $this, 'render_callback' ),
47
  ));
48
+
49
+ register_block_type(self::PRODUCT_BLOCK, array(
50
+ 'editor_script' => 'ecwid-gutenberg-product',
51
+ 'render_callback' => array( $this, 'product_render_callback' ),
52
+ ));
53
 
54
  add_action( 'in_admin_header', array( $this, 'add_popup' ) );
55
  }
61
  }
62
 
63
  public function enqueue_block_editor_assets() {
64
+ EcwidPlatform::enqueue_script( 'gutenberg-store', array( 'wp-blocks', 'wp-i18n', 'wp-element' ) );
65
+ EcwidPlatform::enqueue_style( 'gutenberg-store', array( 'wp-edit-blocks' ) );
66
+
67
+ if ( Ecwid_Api_V3::is_available() ) {
68
+ EcwidPlatform::enqueue_script( 'gutenberg-product', array( 'wp-blocks', 'wp-i18n', 'wp-element' ) );
69
+ }
70
 
71
  $storeImageUrl = site_url('?file=ecwid_store_svg.svg');
72
 
73
+ wp_add_inline_style('ecwid-gutenberg-store', <<<CSS
74
  .editor-block-list__block[data-type="ecwid/store-block"] .editor-block-list__block-edit {
75
  background-image: url("$storeImageUrl")
76
  }
78
  );
79
  }
80
 
81
+ public function product_render_callback($params) {
82
+
83
+ if (!@$params['id']) return '';
84
+
85
+ $display = array(
86
+ 'picture', 'title', 'price', 'options', 'qty', 'addtobag'
87
+ );
88
+
89
+ $params['display'] = '';
90
+ $display_string = '';
91
+ foreach ( $display as $name ) {
92
+ if ($params['show_' . $name]) {
93
+ $params['display'] .= ' ' . $name;
94
+ }
95
+ }
96
+
97
+ $params['version'] = 2;
98
+
99
+ $shortcode = new Ecwid_Shortcode_Product( $params );
100
+
101
+ return $shortcode->render();
102
+ }
103
+
104
  public function render_callback( $params ) {
105
  if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
106
  return '';
122
 
123
  return get_option( 'ecwid_plugin_version' );
124
  }
125
+
126
+ protected function _get_store_icon_path()
127
+ {
128
+ return 'M15.32,15.58c-0.37,0-0.66,0.3-0.66,0.67c0,0.37,0.3,0.67,0.66,0.67c0.37,0,0.67-0.3,0.67-0.67
129
+ 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
130
+ 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
131
+ 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
132
+ 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
133
+ 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
134
+ 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
135
+ 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
136
+ 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
137
+ 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
138
+ 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
139
+ 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
140
+ 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
141
+ 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
142
+ S4.96,15.5,4.6,15.5z';
143
+ }
144
+
145
+ protected function _get_product_icon_path()
146
+ {
147
+ return 'M16.43,5.12c-0.13-1.19-0.15-1.19-1.35-1.33c-0.21-0.02-0.21-0.02-0.43-0.05c-0.01,0.06,0.06,0.78,0.14,1.13
148
+ c0.57,0.37,0.87,0.98,0.87,1.71c0,1.14-0.93,2.07-2.07,2.07s-2.07-0.93-2.07-2.07c0-0.54,0.09-0.97,0.55-1.4
149
+ c-0.06-0.61-0.19-1.54-0.18-1.64C10.14,3.46,8.72,3.46,8.58,3.6l-8.17,8.13c-0.56,0.55-0.56,1.43,0,1.97l5.54,5.93
150
+ c0.56,0.55,1.46,0.55,2.01,0l8.67-8.14C17.04,11.09,16.68,7.14,16.43,5.12z M16.06,0.04c-1.91,0-3.46,1.53-3.46,3.41c0,0.74,0.4,3.09,0.44,3.28c0.07,0.34,0.52,0.56,0.86,0.49
151
+ C14,7.19,14.07,7.15,14.12,7.1c0.24-0.11,0.32-0.39,0.25-0.68c-0.09-0.45-0.39-2.44-0.39-2.94c0-1.16,0.94-2.09,2.11-2.09
152
+ c1.24,0,2.11,0.96,2.11,2.34c0,2.43-0.31,4.23-0.32,4.26c-0.1,0.17-0.1,0.38-0.03,0.55c0.03,0.17,0.13,0.31,0.28,0.4
153
+ c0.1,0.06,0.22,0.09,0.33,0.09c0.21,0,0.42-0.1,0.54-0.3c0.06-0.09,0.52-2.17,0.52-5.03C19.52,1.61,18.04,0.04,16.06,0.04z';
154
+ }
155
  }
156
 
157
  $ecwid_gutenberg = new Ecwid_Integration_Gutenberg();
includes/class-ecwid-integration-wpbakery-composer.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecwid_Integration_WPBakery_Composer {
4
+
5
+ public function __construct()
6
+ {
7
+ add_action( 'vc_before_init', array( $this, 'before_init_actions' ) );
8
+ }
9
+
10
+ function before_init_actions() {
11
+
12
+ //.. Code from other Tutorials ..//
13
+
14
+ // Require new custom Element
15
+ }
16
+ }
17
+
18
+ $ecwid_wpbakery_composer = new Ecwid_Integration_WPBakery_Composer();
19
+
20
+ /*
21
+ Element Description: VC Info Box
22
+ */
23
+
24
+ // Element Class
25
+ class vcInfoBox extends WPBakeryShortCode {
26
+
27
+ // Element Init
28
+ function __construct() {
29
+ add_action( 'init', array( $this, 'vc_infobox_mapping' ) );
30
+ add_shortcode( 'vc_ecwid_store', array( $this, 'vc_ecwid_store' ) );
31
+ }
32
+
33
+ // Element Mapping
34
+ public function vc_infobox_mapping() {
35
+
36
+ // Stop all if VC is not enabled
37
+ if ( !defined( 'WPB_VC_VERSION' ) ) {
38
+ return;
39
+ }
40
+
41
+ $categories = ecwid_get_categories_for_selector();
42
+ //die(var_dump($categories));
43
+
44
+ $cats = array(
45
+ __( 'Store root category', 'ecwid-shopping-cart' ) => 0
46
+ );
47
+ foreach ($categories as $category) {
48
+ $cats[$category->path] = $category->id;
49
+ }
50
+
51
+
52
+ // Map the block with vc_map()
53
+ vc_map(
54
+
55
+ array(
56
+ 'name' => sprintf( _x('Online store', 'vc-tab', 'ecwid-shopping-cart' ) ),
57
+ 'base' => 'vc_ecwid_store',
58
+ 'description' => __( 'Displays storefront: product listing and checkout', 'ecwid-shopping-cart' ),
59
+ 'category' => _x( 'Online store', 'vc-tab', 'ecwid-shopping-cart' ),
60
+ 'icon' => ECWID_PLUGIN_URL . 'images/wordpress_20x20.svg',
61
+ 'params' => array(
62
+
63
+ array(
64
+ 'type' => 'checkbox',
65
+ 'param_name' => 'show_search',
66
+ 'group' => __( 'Settings', 'ecwid-shopping-cart' ),
67
+ 'value' => array( __( 'Show search', 'ecwid-shopping-cart' ) => 'yes' ),
68
+ 'std' => 'yes',
69
+ ),
70
+
71
+
72
+ array(
73
+ 'type' => 'checkbox',
74
+ 'param_name' => 'show_categories',
75
+ 'value' => array( __( 'Show categories', 'ecwid-shopping-cart' ) => 'yes' ),
76
+ 'group' => __( 'Settings', 'ecwid-shopping-cart' ),
77
+ 'std' => 'yes'
78
+ ),
79
+
80
+ array(
81
+ 'type' => 'checkbox',
82
+ 'param_name' => 'show_minicart',
83
+ 'value' => array( __( 'Show minicart', 'ecwid-shopping-cart' ) => 'yes' ),
84
+ 'group' => __( 'Settings', 'ecwid-shopping-cart' ),
85
+ 'std' => 'yes'
86
+ ),
87
+ array(
88
+ 'type' => 'dropdown',
89
+ 'param_name' => 'default_category_id',
90
+ 'heading' => __( 'Category shown by default', 'ecwid-shopping-cart' ),
91
+ 'value' => $cats,
92
+ 'group' => __( 'Settings', 'ecwid-shopping-cart' )
93
+ ),
94
+ )
95
+ )
96
+ );
97
+ }
98
+
99
+
100
+ // Element HTML
101
+ public function vc_ecwid_store( $atts ) {
102
+
103
+ $atts = shortcode_atts(
104
+ array(
105
+ 'show_search' => 1,
106
+ 'show_categories' => 1,
107
+ 'show_minicart' => 1,
108
+ 'default_category_id' => 0
109
+ ),
110
+ $atts
111
+ );
112
+
113
+ $ecwid_attributes = array(
114
+ 'widgets' => ''
115
+ );
116
+
117
+ $widgets = array(
118
+ 'search',
119
+ 'categories',
120
+ 'minicart'
121
+ );
122
+ foreach ( $widgets as $widget ) {
123
+ if ( $atts['show_' . $widget] ) {
124
+ $ecwid_attributes['widgets'] .= $widget . ' ';
125
+ }
126
+ }
127
+
128
+ $ecwid_attributes['widgets'] .= 'productbrowser';
129
+ $ecwid_attributes['default_category_id'] = $atts['default_category_id'];
130
+
131
+ return ecwid_shortcode( $ecwid_attributes );
132
+ }
133
+
134
+ } // End Element Class
135
+
136
+ // Element Class Init
137
+ new vcInfoBox();
includes/class-ecwid-message-manager.php CHANGED
@@ -297,13 +297,13 @@ TXT
297
  return $no_token && $is_not_demo && !$is_ecwid_menu;
298
 
299
  case self::MSG_WOO_IMPORT_ONBOARDING:
300
- return 0
301
- && is_plugin_active( 'woocommerce/woocommerce.php' )
302
  && strpos( $admin_page, Ecwid_Import::PAGE_SLUG ) === false
303
  && !$this->need_to_show_message( 'on_activate' )
304
  && Ecwid_Api_V3::is_available()
305
- && get_ecwid_store_id() % 2 == 0
306
- && !Ecwid_Config::is_wl();
307
 
308
  case 'please_vote':
309
 
297
  return $no_token && $is_not_demo && !$is_ecwid_menu;
298
 
299
  case self::MSG_WOO_IMPORT_ONBOARDING:
300
+ return
301
+ is_plugin_active( 'woocommerce/woocommerce.php' )
302
  && strpos( $admin_page, Ecwid_Import::PAGE_SLUG ) === false
303
  && !$this->need_to_show_message( 'on_activate' )
304
  && Ecwid_Api_V3::is_available()
305
+ && wp_count_posts( 'product' )->publish > 0
306
+ && get_option( 'ecwid_plugin_migration_since_version' ) == get_option('ecwid_plugin_version' );
307
 
308
  case 'please_vote':
309
 
includes/class-ecwid-seo-links.php CHANGED
@@ -211,7 +211,7 @@ class Ecwid_Seo_Links {
211
  }
212
  }
213
 
214
- $url = esc_js( get_page_link( $page_id ) );
215
 
216
  echo <<<JS
217
  window.ec.config.storefrontUrls = window.ec.config.storefrontUrls || {};
@@ -326,14 +326,11 @@ JS;
326
 
327
  if (
328
  is_plugin_active('polylang/polylang.php')
 
329
  && function_exists('pll_get_post_language')
330
- && class_exists('PLL_Model')
331
- && method_exists('PLL_Model', 'get_links_model')
332
  ) {
333
- $options = get_option('polylang');
334
- $model = new PLL_Model($options);
335
- $links_model = $model->get_links_model();
336
- if ($links_model instanceof PLL_Links_Directory) {
337
  $patterns = $this->get_seo_links_patterns();
338
  foreach ( $pages as $page_id ) {
339
  $link = urldecode( get_page_uri( $page_id ) );
211
  }
212
  }
213
 
214
+ $url = esc_js( get_permalink( $page_id ) );
215
 
216
  echo <<<JS
217
  window.ec.config.storefrontUrls = window.ec.config.storefrontUrls || {};
326
 
327
  if (
328
  is_plugin_active('polylang/polylang.php')
329
+ && function_exists( 'PLL' )
330
  && function_exists('pll_get_post_language')
 
 
331
  ) {
332
+
333
+ if ( PLL()->options['force_lang'] == 1 ) {
 
 
334
  $patterns = $this->get_seo_links_patterns();
335
  foreach ( $pages as $page_id ) {
336
  $link = urldecode( get_page_uri( $page_id ) );
includes/class-ecwid-store-page.php CHANGED
@@ -108,7 +108,7 @@ class Ecwid_Store_Page {
108
  return get_bloginfo( 'url' );
109
  }
110
 
111
- $link = get_page_link( $id );
112
  }
113
 
114
  return $link;
@@ -351,7 +351,7 @@ class Ecwid_Store_Page {
351
  $category = $attributes['default_category_id'];
352
  }
353
 
354
- $page_url = get_page_link($store_page);
355
 
356
  include_once ECWID_PLUGIN_DIR . 'lib/ecwid_catalog.php';
357
 
108
  return get_bloginfo( 'url' );
109
  }
110
 
111
+ $link = get_permalink( $id );
112
  }
113
 
114
  return $link;
351
  $category = $attributes['default_category_id'];
352
  }
353
 
354
+ $page_url = get_permalink( $store_page );
355
 
356
  include_once ECWID_PLUGIN_DIR . 'lib/ecwid_catalog.php';
357
 
includes/importer/class-ecwid-import-page.php CHANGED
@@ -129,7 +129,7 @@ class Ecwid_Import_Page
129
 
130
  protected function _need_to_show_woo()
131
  {
132
- return is_plugin_active( 'woocommerce/woocommerce.php' );
133
  }
134
 
135
  public function do_page()
129
 
130
  protected function _need_to_show_woo()
131
  {
132
+ return is_plugin_active( 'woocommerce/woocommerce.php' ) && wp_count_posts( 'product' )->publish > 0;
133
  }
134
 
135
  public function do_page()
includes/importer/class-ecwid-import.php CHANGED
@@ -28,7 +28,7 @@ class Ecwid_Import
28
 
29
  public function admin_init()
30
  {
31
- if ( !Ecwid_Config::is_wl() ) {
32
  if ( !function_exists( 'register_importer' ) ) {
33
  require_once ABSPATH . 'wp-admin/includes/import.php';
34
  }
28
 
29
  public function admin_init()
30
  {
31
+ if ( 1 || !Ecwid_Config::is_wl() ) {
32
  if ( !function_exists( 'register_importer' ) ) {
33
  require_once ABSPATH . 'wp-admin/includes/import.php';
34
  }
includes/importer/class-ecwid-importer.php CHANGED
@@ -338,18 +338,13 @@ class Ecwid_Importer
338
 
339
  $result = array();
340
  foreach ( $product_categories as $category ) {
 
341
  $result[] = array(
342
  'woo_id' => $category->term_id,
343
  'parent_id' => $parent,
344
  'has_image' => get_term_meta( $category->term_id, 'thumbnail_id', true )
345
  );
346
-
347
-
348
- if ($parent != 0) {
349
- // die(var_dump($product_categories, $parent));
350
- }
351
-
352
-
353
  //if ( $category->category_count > 0 ) {
354
  $result = array_merge(
355
  $result,
338
 
339
  $result = array();
340
  foreach ( $product_categories as $category ) {
341
+
342
  $result[] = array(
343
  'woo_id' => $category->term_id,
344
  'parent_id' => $parent,
345
  'has_image' => get_term_meta( $category->term_id, 'thumbnail_id', true )
346
  );
347
+
 
 
 
 
 
 
348
  //if ( $category->category_count > 0 ) {
349
  $result = array_merge(
350
  $result,
includes/oembed.php CHANGED
@@ -69,7 +69,7 @@ function ecwid_get_embed_content()
69
  $result .= '<div>' . ecwid_trim_description($category->description);
70
 
71
  if (mb_strlen($trimmed) < mb_strlen($category->description) && mb_strlen($trimmed) == ECWID_TRIMMED_DESCRIPTION_LENGTH) {
72
- $result .= '... <a class="wp-embed-more" href="' . get_page_link(get_post(get_the_ID())) . '">' . __('See more', 'ecwid-shopping-cart') . '</a>';
73
  }
74
  $result .= '</div>';
75
  }
@@ -98,7 +98,7 @@ function ecwid_get_embed_content()
98
  }
99
 
100
  if ($see_more) {
101
- $result .= '<li><a class="wp-embed-more" href="' . get_page_link(get_post(get_the_ID())) . '">' . __('See more', 'ecwid-shopping-cart') . '</a></li>';
102
  }
103
 
104
  $result .= '</ul>';
69
  $result .= '<div>' . ecwid_trim_description($category->description);
70
 
71
  if (mb_strlen($trimmed) < mb_strlen($category->description) && mb_strlen($trimmed) == ECWID_TRIMMED_DESCRIPTION_LENGTH) {
72
+ $result .= '... <a class="wp-embed-more" href="' . get_permalink() . '">' . __('See more', 'ecwid-shopping-cart') . '</a>';
73
  }
74
  $result .= '</div>';
75
  }
98
  }
99
 
100
  if ($see_more) {
101
+ $result .= '<li><a class="wp-embed-more" href="' . get_permalink() . '">' . __('See more', 'ecwid-shopping-cart') . '</a></li>';
102
  }
103
 
104
  $result .= '</ul>';
includes/shortcodes/class-ecwid-shortcode-product.php CHANGED
@@ -50,7 +50,7 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
50
 
51
  public function render_placeholder() {
52
  $widget_parts = array();
53
-
54
  if ($this->params['version'] == 1) {
55
  $widget_parts = $this->_get_widget_parts_v1();
56
  } else if ($this->params['version'] == 2) {
50
 
51
  public function render_placeholder() {
52
  $widget_parts = array();
53
+
54
  if ($this->params['version'] == 1) {
55
  $widget_parts = $this->_get_widget_parts_v1();
56
  } else if ($this->params['version'] == 2) {
includes/shortcodes/class-ecwid-shortcode-productbrowser.php CHANGED
@@ -87,7 +87,7 @@ HTML;
87
  }
88
 
89
  if ($id) {
90
- $page_url = get_page_link( $id );
91
  } else {
92
  $page_url = '';
93
  }
87
  }
88
 
89
  if ($id) {
90
+ $page_url = get_permalink( $id );
91
  } else {
92
  $page_url = '';
93
  }
includes/widgets.php CHANGED
@@ -3,14 +3,16 @@
3
  include_once "widgets/class-ecwid-widget-badge.php";
4
  include_once "widgets/class-ecwid-widget-minicart.php";
5
  include_once "widgets/class-ecwid-widget-minicart-miniview.php";
 
6
  include_once "widgets/class-ecwid-widget-recently-viewed.php";
7
  include_once "widgets/class-ecwid-widget-latest-products.php";
8
  include_once "widgets/class-ecwid-widget-search.php";
9
  include_once "widgets/class-ecwid-widget-store-link.php";
10
- include_once "widgets/class-ecwid-widget-floating-shopping-cart.php";
11
  include_once "widgets/class-ecwid-widget-vertical-categories-list.php";
12
  include_once "widgets/class-ecwid-widget-random-product.php";
13
 
 
 
14
 
15
  if (ecwid_migrations_is_original_plugin_version_older_than('4.3')) {
16
  include_once "widgets/class-ecwid-widget-vcategories.php";
@@ -30,13 +32,23 @@ function ecwid_sidebar_widgets_init() {
30
 
31
  register_widget('Ecwid_Widget_Search');
32
 
33
- register_widget('Ecwid_Widget_Minicart_Miniview');
34
- register_widget('Ecwid_Widget_Minicart');
 
 
 
 
 
 
 
 
 
 
 
35
  register_widget('Ecwid_Widget_Store_Link');
36
  register_widget('Ecwid_Widget_Recently_Viewed');
37
  register_widget('Ecwid_Widget_Latest_Products');
38
 
39
- register_widget('Ecwid_Widget_Floating_Shopping_Cart');
40
  register_widget('Ecwid_Widget_Vertical_Categories_List');
41
  register_widget('Ecwid_Widget_Random_Product');
42
 
3
  include_once "widgets/class-ecwid-widget-badge.php";
4
  include_once "widgets/class-ecwid-widget-minicart.php";
5
  include_once "widgets/class-ecwid-widget-minicart-miniview.php";
6
+ include_once "widgets/class-ecwid-widget-floating-shopping-cart.php";
7
  include_once "widgets/class-ecwid-widget-recently-viewed.php";
8
  include_once "widgets/class-ecwid-widget-latest-products.php";
9
  include_once "widgets/class-ecwid-widget-search.php";
10
  include_once "widgets/class-ecwid-widget-store-link.php";
 
11
  include_once "widgets/class-ecwid-widget-vertical-categories-list.php";
12
  include_once "widgets/class-ecwid-widget-random-product.php";
13
 
14
+ include_once "widgets/class-ecwid-widget-nsf-minicart.php";
15
+
16
 
17
  if (ecwid_migrations_is_original_plugin_version_older_than('4.3')) {
18
  include_once "widgets/class-ecwid-widget-vcategories.php";
32
 
33
  register_widget('Ecwid_Widget_Search');
34
 
35
+ register_widget('Ecwid_Widget_NSF_Minicart');
36
+
37
+ $old_minicarts = array(
38
+ 'ecwidminicart_miniview' => 'Ecwid_Widget_Minicart_Miniview',
39
+ 'ecwidminicart' => 'Ecwid_Widget_Minicart',
40
+ 'ecwidfloatingshoppingcart' => 'Ecwid_Widget_Floating_Shopping_Cart' );
41
+
42
+ foreach ( $old_minicarts as $idbase => $widget_class ) {
43
+ if ( is_active_widget( false, false, $idbase ) ) {
44
+ register_widget( $widget_class );
45
+ }
46
+ }
47
+
48
  register_widget('Ecwid_Widget_Store_Link');
49
  register_widget('Ecwid_Widget_Recently_Viewed');
50
  register_widget('Ecwid_Widget_Latest_Products');
51
 
 
52
  register_widget('Ecwid_Widget_Vertical_Categories_List');
53
  register_widget('Ecwid_Widget_Random_Product');
54
 
includes/widgets/class-ecwid-widget-floating-shopping-cart.php CHANGED
@@ -14,7 +14,7 @@ class Ecwid_Widget_Floating_Shopping_Cart extends WP_Widget {
14
 
15
  public function __construct() {
16
  $widget_ops = array('classname' => 'widget_ecwid_floating_shopping_cart', 'description' => __("Adds a shopping cart widget to the top right corner of your site.", 'ecwid-shopping-cart') );
17
- parent::__construct('ecwidfloatingshoppingcart', __('Shopping Cart (Floating)', 'ecwid-shopping-cart'), $widget_ops);
18
 
19
  add_action('init', array($this, 'init'));
20
  }
14
 
15
  public function __construct() {
16
  $widget_ops = array('classname' => 'widget_ecwid_floating_shopping_cart', 'description' => __("Adds a shopping cart widget to the top right corner of your site.", 'ecwid-shopping-cart') );
17
+ parent::__construct('ecwidfloatingshoppingcart', __('Shopping Cart Floating (deprecated)', 'ecwid-shopping-cart'), $widget_ops);
18
 
19
  add_action('init', array($this, 'init'));
20
  }
includes/widgets/class-ecwid-widget-minicart-miniview.php CHANGED
@@ -3,7 +3,7 @@ class Ecwid_Widget_Minicart_Miniview extends WP_Widget {
3
 
4
  function __construct() {
5
  $widget_ops = array('classname' => 'widget_ecwid_minicart_miniview', 'description' => __("Adds a compact cart widget for customer to see the products they added to the cart.", 'ecwid-shopping-cart') );
6
- parent::__construct('ecwidminicart_miniview', __('Shopping Cart (Mini)', 'ecwid-shopping-cart'), $widget_ops);
7
  }
8
 
9
  function widget($args, $instance) {
3
 
4
  function __construct() {
5
  $widget_ops = array('classname' => 'widget_ecwid_minicart_miniview', 'description' => __("Adds a compact cart widget for customer to see the products they added to the cart.", 'ecwid-shopping-cart') );
6
+ parent::__construct('ecwidminicart_miniview', __('Shopping Cart Mini (deprecated)', 'ecwid-shopping-cart'), $widget_ops);
7
  }
8
 
9
  function widget($args, $instance) {
includes/widgets/class-ecwid-widget-minicart.php CHANGED
@@ -3,7 +3,7 @@ class Ecwid_Widget_Minicart extends WP_Widget {
3
 
4
  function __construct() {
5
  $widget_ops = array('classname' => 'widget_ecwid_minicart', 'description' => __("Adds a cart widget for customer to see the products they added to the cart.", 'ecwid-shopping-cart') );
6
- parent::__construct('ecwidminicart', __('Shopping Cart', 'ecwid-shopping-cart'), $widget_ops);
7
 
8
  }
9
 
3
 
4
  function __construct() {
5
  $widget_ops = array('classname' => 'widget_ecwid_minicart', 'description' => __("Adds a cart widget for customer to see the products they added to the cart.", 'ecwid-shopping-cart') );
6
+ parent::__construct('ecwidminicart', __('Shopping Cart (deprecated)', 'ecwid-shopping-cart'), $widget_ops);
7
 
8
  }
9
 
includes/widgets/class-ecwid-widget-nsf-minicart.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // nsf stands for new storefront I guess
3
+ class Ecwid_Widget_NSF_Minicart extends WP_Widget {
4
+
5
+ protected $__idbase;
6
+
7
+ const FIELD_TITLE = 'title';
8
+ const FIELD_LAYOUT = 'layout';
9
+ const FIELD_ICON = 'icon';
10
+ const FIELD_FIXED_SHAPE = 'fixed-shape';
11
+
12
+ function __construct() {
13
+
14
+ $this->__idbase = 'ecwidnsfminicart';
15
+
16
+ $widget_ops = array('classname' => 'widget_' . $this->__idbase, 'description' => __("Adds a cart widget for customer to see the products they added to the cart.", 'ecwid-shopping-cart') );
17
+ parent::__construct($this->__idbase, __('Shopping Cart', 'ecwid-shopping-cart'), $widget_ops);
18
+
19
+ }
20
+
21
+ function widget($args, $instance) {
22
+ extract($args);
23
+ $title = apply_filters('widget_title', empty($instance['title']) ? '&nbsp;' : $instance['title']);
24
+
25
+ echo $before_widget;
26
+
27
+ if ( $title )
28
+ echo $before_title . $title . $after_title;
29
+
30
+ echo '<div>';
31
+
32
+ require 'nsf-minicart.tpl.php';
33
+
34
+ echo '</div>';
35
+
36
+ echo $after_widget;
37
+ }
38
+
39
+ function update($new_instance, $old_instance) {
40
+
41
+ $new_instance = wp_parse_args( (array) $new_instance, array(
42
+ self::FIELD_TITLE => '',
43
+ self::FIELD_LAYOUT => 'BIG_ICON_DETAILS_SUBTOTAL',
44
+ self::FIELD_ICON => 'BAG',
45
+ self::FIELD_FIXED_SHAPE => '',
46
+ ) );
47
+
48
+ $new_instance['title'] = strip_tags( stripslashes( $new_instance['title'] ) );
49
+
50
+ return $new_instance;
51
+ }
52
+
53
+ function form( $instance ) {
54
+ $instance = wp_parse_args( (array) $instance, array(
55
+ self::FIELD_TITLE => '',
56
+ self::FIELD_LAYOUT => 'BIG_ICON_TITLE_SUBTOTAL',
57
+ self::FIELD_ICON => 'BAG',
58
+ self::FIELD_FIXED_SHAPE => 'RECT'
59
+ ) );
60
+
61
+ require 'nsf-minicart-editor.tpl.php';
62
+ }
63
+
64
+ protected function _get_layouts() {
65
+ return array(
66
+ 'SMALL_ICON' => __( 'Small icon', 'ecwid-shopping-cart' ),
67
+ 'SMALL_ICON_COUNTER' => __( 'Small icon and item count', 'ecwid-shopping-cart' ),
68
+ 'COUNTER_ONLY' => __( 'Item count only', 'ecwid-shopping-cart' ),
69
+ 'TITLE_COUNTER' => __( 'Label and item count', 'ecwid-shopping-cart' ),
70
+ 'MEDIUM_ICON_COUNTER' => __( 'Icon and item count', 'ecwid-shopping-cart' ),
71
+ 'MEDIUM_ICON_TITLE_COUNTER' => __( 'Icon, label and item count', 'ecwid-shopping-cart' ),
72
+ 'BIG_ICON_TITLE_SUBTOTAL' => __( 'Icon, label, item count and subtotal', 'ecwid-shopping-cart' ),
73
+ 'BIG_ICON_DETAILS_SUBTOTAL' => __( 'Icon, label, item count, subtotal and link', 'ecwid-shopping-cart' )
74
+ );
75
+ }
76
+
77
+ protected function _get_icons() {
78
+ return array(
79
+ 'BAG' => __( 'Bag', 'ecwid-shopping-cart' ),
80
+ 'CART' => __( 'Cart', 'ecwid-shopping-cart' ),
81
+ 'BASKET' => __( 'Basket', 'ecwid-shopping-cart' )
82
+ );
83
+ }
84
+
85
+ protected function _get_fixed_shapes() {
86
+ return array(
87
+ 'RECT' => __( 'Rectangle', 'ecwid-shopping-cart' ),
88
+ 'PILL' => __( 'Pill', 'ecwid-shopping-cart' ),
89
+ '' => __( 'No border', 'ecwid-shopping-cart' )
90
+ );
91
+ }
92
+
93
+ }
includes/widgets/nsf-minicart-editor.tpl.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p>
2
+ <label>
3
+ <?php _e( 'Layout:', 'ecwid-shopping-cart' ); ?>
4
+ <select class="widefat"
5
+ name="<?php echo $this->get_field_name( self::FIELD_LAYOUT ); ?>"
6
+ id="<?php echo $this->get_field_id( self::FIELD_LAYOUT ); ?>"
7
+ >
8
+ <?php foreach( $this->_get_layouts() as $value => $label ) : ?>
9
+ <option value="<?php echo $value; ?>"<?php if ( $instance[self::FIELD_LAYOUT] == $value ): ?> selected="selected"<?php endif; ?>>
10
+ <?php echo $label; ?>
11
+ </option>
12
+ <?php endforeach; ?>
13
+ </select>
14
+ </label>
15
+ </p>
16
+
17
+ <p>
18
+ <label>
19
+ <?php _e( 'Cart icon:', 'ecwid-shopping-cart' ); ?>
20
+ <select class="widefat"
21
+ name="<?php echo $this->get_field_name( self::FIELD_ICON ); ?>"
22
+ id="<?php echo $this->get_field_id( self::FIELD_ICON ); ?>"
23
+ >
24
+ <?php foreach( $this->_get_icons() as $value => $label ) : ?>
25
+ <option value="<?php echo $value; ?>"<?php if ( $instance[self::FIELD_ICON] == $value ): ?> selected="selected"<?php endif; ?>>
26
+ <?php echo $label; ?>
27
+ </option>
28
+ <?php endforeach; ?>
29
+ </select>
30
+ </label>
31
+ </p>
32
+
33
+ <p>
34
+ <label>
35
+ <?php _e( 'Border:', 'ecwid-shopping-cart' ); ?>
36
+ <select class="widefat"
37
+ name="<?php echo $this->get_field_name( self::FIELD_FIXED_SHAPE ); ?>"
38
+ id="<?php echo $this->get_field_id( self::FIELD_FIXED_SHAPE ); ?>"
39
+ >
40
+ <?php foreach( $this->_get_fixed_shapes() as $value => $label ) : ?>
41
+ <option value="<?php echo $value; ?>" <?php if ( $instance[self::FIELD_FIXED_SHAPE] == $value ): ?> selected="selected"<?php endif; ?>>
42
+ <?php echo $label; ?>
43
+ </option>
44
+ <?php endforeach; ?>
45
+ </select>
46
+ </label>
47
+ </p>
48
+
49
+ <p>
50
+ <label for="<?php echo $this->get_field_name( self::FIELD_TITLE ); ?>"><?php _e ( 'Title:' ); ?>
51
+ <input class="widefat"
52
+ id="<?php echo $this->get_field_id( self::FIELD_TITLE ); ?>"
53
+ name="<?php echo $this->get_field_name( self::FIELD_TITLE ); ?>"
54
+ type="text" value="<?php esc_html( $instance['title'] ); ?>"
55
+ />
56
+ </label>
57
+ </p>
includes/widgets/nsf-minicart.tpl.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- noptimize -->
2
+ <?php
3
+
4
+ echo ecwid_get_scriptjs_code();
5
+ echo ecwid_get_product_browser_url_script();
6
+ ?>
7
+
8
+ <div class='ec-cart-widget'
9
+ data-fixed='false'
10
+ data-fixed-shape='<?php echo $instance[self::FIELD_FIXED_SHAPE]; ?>'
11
+ data-layout='<?php echo $instance[self::FIELD_LAYOUT]; ?>'
12
+ data-icon='<?php echo $instance[self::FIELD_ICON]; ?>'
13
+ ></div>
14
+
15
+ <script>
16
+ Ecwid.init();
17
+ </script>
18
+ <!-- /noptimize -->
js/admin-menu.js CHANGED
@@ -5,12 +5,17 @@ function ecwidRefreshEcwidMenuItemSelection(slug)
5
  slug = ecwidGetCurrentMenuSlug();
6
  }
7
 
8
- if (!slug) return;
9
 
10
  var parent = jQuery('li#toplevel_page_' + ecwid_admin_menu.baseSlug);
 
11
  parent.addClass('wp-has-current-submenu').addClass('wp-menu-open');
12
 
13
  var selector = 'a[data-ecwid-menu-slug="' + slug + '"]';
 
 
 
 
14
 
15
  jQuery('.current', parent).removeClass('current');
16
  jQuery('.wp-has-current-submenu3', parent).removeClass('wp-has-current-submenu3');
5
  slug = ecwidGetCurrentMenuSlug();
6
  }
7
 
8
+ if (!slug || slug.indexOf(ecwid_admin_menu.baseSlug) == -1) return;
9
 
10
  var parent = jQuery('li#toplevel_page_' + ecwid_admin_menu.baseSlug);
11
+
12
  parent.addClass('wp-has-current-submenu').addClass('wp-menu-open');
13
 
14
  var selector = 'a[data-ecwid-menu-slug="' + slug + '"]';
15
+ if (jQuery(selector).length == 0) {
16
+ selector = 'a[data-ecwid-menu-slug="' + decodeURI(slug) + '"]';
17
+ }
18
+
19
 
20
  jQuery('.current', parent).removeClass('current');
21
  jQuery('.wp-has-current-submenu3', parent).removeClass('wp-has-current-submenu3');
js/admin.js CHANGED
@@ -74,7 +74,8 @@ jQuery(document).ready(function() {
74
  'ecwid-widget-vcategories': 'storeCategories',
75
  'ecwid-widget-storelink': 'storePageLink',
76
  'ecwid-widget-floatingshoppingcart': 'floatingShoppingCart',
77
- 'ecwid-widget-vcategorieslist': 'storeRootCategories'
 
78
  };
79
  }
80
 
74
  'ecwid-widget-vcategories': 'storeCategories',
75
  'ecwid-widget-storelink': 'storePageLink',
76
  'ecwid-widget-floatingshoppingcart': 'floatingShoppingCart',
77
+ 'ecwid-widget-vcategorieslist': 'storeRootCategories',
78
+ 'ecwid-widget-nsfminicart': 'shoppingCart',
79
  };
80
  }
81
 
js/dashboard-blog.js CHANGED
@@ -57,7 +57,7 @@ jQuery(document).ready(function() {
57
  for (var i = 0; i < posts.length; i++) {
58
  var post = jQuery('#ecwid_blog_feed .template-container .ecwid-blog-post').clone();
59
  post.addClass('ecwid-post-id-' + posts[i].id);
60
- jQuery('.ecwid-blog-post-link', post).attr('href', posts[i].link);
61
  jQuery('.ecwid-blog-post-title', post).html(posts[i].title);
62
  jQuery('.ecwid-blog-post-excerpt', post).html(posts[i].excerpt);
63
 
57
  for (var i = 0; i < posts.length; i++) {
58
  var post = jQuery('#ecwid_blog_feed .template-container .ecwid-blog-post').clone();
59
  post.addClass('ecwid-post-id-' + posts[i].id);
60
+ jQuery('.ecwid-blog-post-link', post).attr('href', posts[i].link + '?utm_source=wpdashboard');
61
  jQuery('.ecwid-blog-post-title', post).html(posts[i].title);
62
  jQuery('.ecwid-blog-post-excerpt', post).html(posts[i].excerpt);
63
 
js/gutenberg-product.js ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( blocks, components, i18n, element, _ ) {
2
+ var el = element.createElement;
3
+
4
+ var saveCallback = function( params ) {
5
+
6
+ var attributes = {
7
+ 'id': params.newProps.id
8
+ };
9
+
10
+ for (var i in {center_align:1, show_border:1, show_price_on_button:1}) {
11
+ attributes[i] = params.newProps[i];
12
+ }
13
+
14
+ for (var i in {picture:1,title:1,price:1,options:1,qty:1,addtobag:1}) {
15
+ attributes['show_' + i] = params.newProps.display.indexOf(i) != -1;
16
+ }
17
+
18
+ attributes.productName = params.newProps.product.name;
19
+ attributes.productSKU = params.newProps.product.sku;
20
+ attributes.productImageURL = params.newProps.product.thumb;
21
+
22
+ params.originalProps.setAttributes(attributes);
23
+ }
24
+
25
+ var getIcon = function() {
26
+ return el("svg", {
27
+ "aria-hidden": !0,
28
+ role: "img",
29
+ focusable: "false",
30
+ xmlns: "http://www.w3.org/2000/svg",
31
+ className: "dashicon",
32
+ width: 20,
33
+ height: 20,
34
+ viewBox: "0 0 20 20"
35
+ }, el("path", {
36
+ d: EcwidGutenbergParams.productIcon
37
+ }));
38
+ }
39
+
40
+ var ecwidBlockParams = {
41
+ title: EcwidGutenbergParams.productBlockTitle,
42
+ icon: getIcon(),
43
+ category: 'common',
44
+ attributes: {
45
+ id: { type: 'integer' },
46
+ show_picture: { type: 'boolean' },
47
+ show_title: { type: 'boolean' },
48
+ show_price: { type: 'boolean' },
49
+ show_options: { type: 'boolean' },
50
+ show_qty: { type: 'boolean' },
51
+ show_addtobag: { type: 'boolean' },
52
+ show_price_on_button: { type: 'boolean' },
53
+ show_border: { type: 'boolean' },
54
+ center_align: { type: 'boolean' },
55
+ productName: {type: 'string' },
56
+ productSKU: {type: 'string' },
57
+ productImageURL: {type: 'string' }
58
+ },
59
+ supports: {
60
+ customClassName: false,
61
+ className: false,
62
+ html: false
63
+ },
64
+
65
+ edit: function( props ) {
66
+
67
+ var imageUrl = props.attributes.productImageURL;
68
+ var productName = props.attributes.productName;
69
+
70
+ if ( !props.attributes.id ) {
71
+ return el( 'div', { className: 'ecwid-block' },
72
+ el( 'div', { className: 'ecwid-block-header' },
73
+ getIcon(),
74
+ EcwidGutenbergParams.yourProductLabel
75
+ ),
76
+ el( 'div', {},
77
+ el( 'button', { className: 'button ecwid-block-button', onClick: function() { var params = {'saveCallback':saveCallback, 'props': props}; ecwid_open_product_popup( params ); } }, EcwidGutenbergParams.chooseProduct )
78
+ )
79
+ );
80
+ }
81
+
82
+ return el( 'div', {className: 'ecwid-block' },
83
+ el( 'div', { className: 'ecwid-block-header' },
84
+ el('div', {className: 'ecwid-product-block-icon'} ),
85
+ EcwidGutenbergParams.yourProductLabel
86
+ ), el( 'div', { className: 'ecwid-block-image' }, el( 'img', {src: imageUrl } )
87
+ ),
88
+ el( 'div', { className: 'ecwid-block-title' } , productName ),
89
+ el( 'div', {},
90
+ el( 'button', { className: 'button ecwid-block-button', onClick: function() { var params = {'saveCallback':saveCallback, 'props': props}; ecwid_open_product_popup( params ); } }, EcwidGutenbergParams.editAppearance )
91
+ )
92
+ );
93
+ },
94
+ save: function( props ) {
95
+ return false;
96
+ var shortcode = new wp.shortcode({
97
+ 'tag': EcwidGutenbergParams.productShortcodeName,
98
+ 'attrs': props.attributes,
99
+ 'type': 'single'
100
+ });
101
+
102
+ return el( element.RawHTML, null, shortcode.string() );
103
+ }
104
+ };
105
+ blocks.registerBlockType( EcwidGutenbergParams.productBlock, ecwidBlockParams);
106
+
107
+ } )(
108
+ window.wp.blocks,
109
+ window.wp.components,
110
+ window.wp.i18n,
111
+ window.wp.element,
112
+ window._
113
+ );
114
+ ecwid_pb_defaults = EcwidGutenbergParams.ecwid_pb_defaults;
js/gutenberg-store.js ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( blocks, components, i18n, element, _ ) {
2
+ var el = element.createElement;
3
+
4
+ var getIcon = function() {
5
+ return el("svg", {
6
+ "aria-hidden": !0,
7
+ role: "img",
8
+ focusable: "false",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ className: "dashicon",
11
+ width: 20,
12
+ height: 20,
13
+ viewBox: "0 0 20 20"
14
+ }, el("path", {
15
+ d: EcwidGutenbergParams.storeIcon
16
+ }));
17
+ }
18
+
19
+ var ecwidStoreParams = {
20
+ title: EcwidGutenbergParams.storeBlockTitle,
21
+ icon: getIcon(),
22
+ category: 'common',
23
+ attributes: {
24
+ widgets: { type: 'string' },
25
+ categories_per_row: { type: 'integer' },
26
+ grid: { type: 'string' },
27
+ list: { type: 'integer' },
28
+ table: { type: 'integer' },
29
+ default_category_id: { type: 'integer' },
30
+ default_product_id: { type: 'integer' },
31
+ category_view: { type: 'string' },
32
+ search_view: { type: 'string' },
33
+ minicart_layout: {type: 'string' }
34
+ },
35
+ supports: {
36
+ customClassName: false,
37
+ className: false,
38
+ html: false
39
+ },
40
+ useOnce: true,
41
+
42
+ edit: function( props ) {
43
+
44
+ return el( 'div', {className: 'ecwid-block' },
45
+ el( 'div', { className: 'ecwid-block-header' },
46
+ getIcon(),
47
+ EcwidGutenbergParams.yourStoreWill
48
+ ),
49
+ el( 'div', { className: 'ecwid-block-title' } , EcwidGutenbergParams.storeIdLabel + ': ' + EcwidGutenbergParams.storeId ),
50
+ el( 'div', {},
51
+ el( 'button', { className: 'button ecwid-block-button', onClick: function() { ecwid_open_store_popup( props ); } }, EcwidGutenbergParams.editAppearance )
52
+ )
53
+ );
54
+
55
+ return el( 'div', { className: 'ecwid-store-block' },
56
+ el( 'button', { className: 'button button-primary ecwid-block-button', onClick: function() { ecwid_open_store_popup( props ); } }, i18n.__( 'Edit Appearance' ) )
57
+ );
58
+ },
59
+ save: function( props ) {
60
+
61
+ return false;
62
+
63
+ var shortcode = new wp.shortcode({
64
+ 'tag': EcwidGutenbergParams.storeShortcodeName,
65
+ 'attrs': props.attributes,
66
+ 'type': 'single'
67
+ });
68
+
69
+ return wp.blocks.serialize(
70
+ wp.blocks.createBlock(EcwidGutenbergParams.storeBlock, props),
71
+ el( element.RawHTML, null, shortcode.string() )
72
+ );
73
+ },
74
+
75
+ transforms: {
76
+ from: [{
77
+ type: 'shortcode',
78
+ tag: ['ecwid', 'ec_store'],
79
+ attributes: {
80
+ widgets: {
81
+ type: 'string',
82
+ shortcode: function(named) {
83
+ return named.widgets
84
+ }
85
+ },
86
+ categories_per_row: {
87
+ type: 'integer',
88
+ shortcode: function(named) {
89
+ return named.categories_per_row
90
+ }
91
+ },
92
+ grid: {
93
+ type: 'string',
94
+ shortcode: function(named) {
95
+ return named.grid
96
+ }
97
+ },
98
+ list: {
99
+ type: 'integer',
100
+ shortcode: function(named) {
101
+ return named.list
102
+ }
103
+ },
104
+ table: {
105
+ type: 'integer',
106
+ shortcode: function(named) {
107
+ return named.table
108
+ }
109
+ },
110
+ default_category_id: {
111
+ type: 'integer',
112
+ shortcode: function(named) {
113
+ return named.default_category_id
114
+ }
115
+ },
116
+ default_product_id: {
117
+ type: 'integer',
118
+ shortcode: function(named) {
119
+ return named.default_product_id
120
+ }
121
+ },
122
+ category_view: {
123
+ type: 'string',
124
+ shortcode: function(named) {
125
+ return named.category_view
126
+ }
127
+ },
128
+ search_view: {
129
+ type: 'string',
130
+ shortcode: function(named) {
131
+ return named.search_view
132
+ }
133
+ },
134
+ minicart_layout: {
135
+ type: 'string',
136
+ shortcode: function(named) {
137
+ return named.minicart_layout
138
+ }
139
+ }
140
+ },
141
+ priority: 10
142
+ }]
143
+ },
144
+ };
145
+
146
+ blocks.registerBlockType( EcwidGutenbergParams.storeBlock, ecwidStoreParams);
147
+
148
+ } )(
149
+ window.wp.blocks,
150
+ window.wp.components,
151
+ window.wp.i18n,
152
+ window.wp.element,
153
+ window._
154
+ );
155
+ ecwid_pb_defaults = EcwidGutenbergParams.ecwid_pb_defaults;
js/product-popup.js CHANGED
@@ -6,6 +6,10 @@ jQuery(document).ready(function() {
6
  popup().data( 'defaultSortBy', 'ADDED_TIME_DESC' );
7
 
8
  jQuery('#insert-ecwid-product-button').click(function() {
 
 
 
 
9
  if (ecwidSpwParams && typeof ecwidSpwParams.no_token != 'undefined') {
10
  location.href='admin.php?page=ec-store&reconnect&reason=spw';
11
  return false;
@@ -15,16 +19,51 @@ jQuery(document).ready(function() {
15
 
16
  populateWidgetParams();
17
  setSearchParams({});
18
-
19
  if (getInitialSearchData()) {
20
  buildProductsTable(getInitialSearchData());
21
  } else {
22
  updateSearchParams();
23
  }
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  popup().addClass('open');
 
26
 
27
- });
 
28
 
29
  jQuery(document).keydown(function(e) {
30
  if (e.keyCode == 27 && popup().hasClass('open')) {
@@ -44,14 +83,55 @@ jQuery(document).ready(function() {
44
 
45
  var populateWidgetParams = function() {
46
 
47
- if (ecwidSpwParams && ecwidSpwParams.display) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  jQuery('input[type=checkbox]', popup()).prop('checked', false);
49
 
50
- for (var i in ecwidSpwParams.display) {
51
  jQuery('input[type=checkbox][data-display-option=' + i + ']')
52
  .prop('checked', true);
53
  }
54
- for (var i in ecwidSpwParams.attributes) {
55
  jQuery('input[type=checkbox][data-shortcode-attribute=' + i + ']')
56
  .prop('checked', true);
57
  }
@@ -68,6 +148,10 @@ jQuery(document).ready(function() {
68
  jQuery('.toolbar-link').show();
69
  jQuery('.toolbar-link[data-content=' + tab + ']', popup()).hide();
70
  }
 
 
 
 
71
 
72
  jQuery('.media-menu-item', popup()).click(function() {
73
  changeTab(jQuery(this).attr('data-content'));
@@ -87,37 +171,42 @@ jQuery(document).ready(function() {
87
  });
88
 
89
 
90
- jQuery('.media-button-select', popup()).click(function() {
91
-
92
- var shortcode = buildShortcode();
93
-
94
- if (tinymce.activeEditor && !tinymce.activeEditor.isHidden()) {
95
- tinymce.activeEditor.execCommand('mceInsertContent', false, shortcode);
 
96
  } else {
97
-
98
- getCursorPosition = function(el) {
99
- var pos = 0;
100
- if('selectionStart' in el) {
101
- pos = el.selectionStart;
102
- } else if('selection' in document) {
103
- el.focus();
104
- var Sel = document.selection.createRange();
105
- var SelLength = document.selection.createRange().text.length;
106
- Sel.moveStart('character', -el.value.length);
107
- pos = Sel.text.length - SelLength;
108
- }
109
- return pos;
110
- };
111
-
112
- var el = jQuery('#content');
113
- var cursorPosition = getCursorPosition(el.get(0));
114
-
115
- el.val(el.val().substr(0, cursorPosition) + shortcode + el.val().substr(cursorPosition));
116
-
 
 
 
 
 
 
 
117
  }
118
-
119
- saveParams();
120
-
121
  popup().removeClass('open');
122
  });
123
 
@@ -139,17 +228,10 @@ jQuery(document).ready(function() {
139
  };
140
 
141
  var buildShortcode = function() {
142
- var params = {};
143
 
144
- product = getCurrentProduct();
145
-
146
- params.id = product.id;
147
- params.version = '2';
148
- params.display = [];
149
 
150
- jQuery('input[type=checkbox][data-display-option]:checked').each(function(idx, el) {
151
- params.display[params.display.length] = jQuery(el).data('display-option');
152
- });
153
 
154
  if (params.display.length == 0) {
155
  params.display = 'picture title price options addtobag';
@@ -157,12 +239,6 @@ jQuery(document).ready(function() {
157
  params.display = params.display.join(' ');
158
  }
159
 
160
- jQuery('input[type=checkbox][data-shortcode-attribute]').each(function(idx, el) {
161
- params[jQuery(el).data('shortcode-attribute')] = jQuery(el).is(':checked') ? 1 : 0;
162
- });
163
-
164
- var params_order = ['id', 'display', 'version', 'show_border', 'show_price_on_button', 'center_align'];
165
-
166
  var shortcode = '[' + ecwid_params.product_shortcode;
167
 
168
  for (var i = 0; i < params_order.length; i++) {
@@ -173,13 +249,34 @@ jQuery(document).ready(function() {
173
 
174
  return shortcode;
175
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
 
177
- var setCurrentProduct = function( product ) {
 
 
 
 
 
 
 
178
  popup().data('currentProduct', product);
179
  updateFormOnCurrentProduct();
180
  };
181
 
182
- var getCurrentProduct = function() {
183
  return popup().data('currentProduct');
184
  };
185
 
@@ -209,12 +306,12 @@ jQuery(document).ready(function() {
209
  };
210
 
211
  var updateFormOnCurrentProduct = function() {
212
- var product = getCurrentProduct();
213
 
214
  if (product) {
215
- jQuery( '.media-button-select', popup() ).removeClass( 'disabled' );
216
  } else {
217
- jQuery( '.media-button-select', popup() ).addClass( 'disabled' );
218
  }
219
 
220
  }
@@ -227,11 +324,11 @@ jQuery(document).ready(function() {
227
 
228
  if (jQuery(this).hasClass('selected-product')) {
229
  jQuery(this).closest('tbody').find('tr').removeClass('selected-product');
230
- setCurrentProduct(null);
231
  } else {
232
  jQuery(this).closest('tbody').find('tr').removeClass('selected-product');
233
  jQuery(this).addClass('selected-product');
234
- setCurrentProduct(jQuery(this).data('productData'));
235
  }
236
  };
237
 
@@ -351,7 +448,6 @@ jQuery(document).ready(function() {
351
 
352
  renderSearchParams();
353
  assignHandlers();
354
- setCurrentProduct(null);
355
  jQuery('#search-submit').removeClass('searching');
356
 
357
  if (totalPages <= 1) {
@@ -513,6 +609,7 @@ jQuery(document).ready(function() {
513
  jQuery('#ecwid-reset-search').click(function() {
514
  setSearchParams({});
515
  buildProductsTable(getInitialSearchData());
 
516
  });
517
  };
518
 
@@ -547,3 +644,9 @@ ecwidRenderCheckboxOption = function(data) {
547
  jQuery('#ecwid-product-popup-content .widget-settings.' + data.section + ' .widget-settings__' + that.nextTarget)
548
  .append(that.template(data));
549
  }
 
 
 
 
 
 
6
  popup().data( 'defaultSortBy', 'ADDED_TIME_DESC' );
7
 
8
  jQuery('#insert-ecwid-product-button').click(function() {
9
+ openPopup();
10
+ });
11
+
12
+ openPopup = function() {
13
  if (ecwidSpwParams && typeof ecwidSpwParams.no_token != 'undefined') {
14
  location.href='admin.php?page=ec-store&reconnect&reason=spw';
15
  return false;
19
 
20
  populateWidgetParams();
21
  setSearchParams({});
22
+
23
  if (getInitialSearchData()) {
24
  buildProductsTable(getInitialSearchData());
25
  } else {
26
  updateSearchParams();
27
  }
28
 
29
+ setSelectedProduct(null);
30
+
31
+ if (popup().data('params')) {
32
+
33
+ var props = popup().data('params').props.attributes;
34
+ if (props.id) {
35
+ var productTemplate = wp.template('selected-product');
36
+
37
+ setSelectedProduct(
38
+ {'name': props.productName, 'thumb': props.productImageURL, 'sku': props.productSKU, 'id': props.id}
39
+ );
40
+
41
+ var productHtml = productTemplate(
42
+ getSelectedProduct()
43
+ );
44
+
45
+ jQuery('.media-frame-content.selected-product').empty().append(productHtml);
46
+ changeMode('selected-product');
47
+ changeTab('selected-product');
48
+
49
+ jQuery('#choose-another-product').click(function() {
50
+ jQuery('.media-modal-content', popup()).attr('data-active-dialog', 'add-product');
51
+ jQuery('.media-button-update').addClass('disabled');
52
+ });
53
+ jQuery('media-modal-content', popup()).attr('data-mode', 'selected-product');
54
+ changeTab('customize');
55
+ }
56
+ }
57
+
58
+ if ( !getSelectedProduct() ) {
59
+ changeMode('add-product');
60
+ }
61
+
62
  popup().addClass('open');
63
+ }
64
 
65
+ popup().data('openPopup', openPopup);
66
+
67
 
68
  jQuery(document).keydown(function(e) {
69
  if (e.keyCode == 27 && popup().hasClass('open')) {
83
 
84
  var populateWidgetParams = function() {
85
 
86
+ var params;
87
+ debugger;
88
+ if (popup().data('params') && popup().data('params').props.attributes.id) {
89
+
90
+ debugger;
91
+
92
+ var selectedParams = popup().data('params').props.attributes;
93
+ params = {
94
+ 'display': []
95
+ };
96
+ var displayMap = [
97
+ 'picture',
98
+ 'title',
99
+ 'price',
100
+ 'options',
101
+ 'addtobag',
102
+ 'qty'
103
+ ];
104
+ for (var i = 0; i < displayMap.length; i++) {
105
+ var param = displayMap[i];
106
+ if ( selectedParams['show_' + param] ) {
107
+ params.display[param] = true;
108
+ }
109
+ }
110
+
111
+
112
+ var shortcodeMap = [
113
+ 'show_price_on_button',
114
+ 'show_border',
115
+ 'center_align'
116
+ ];
117
+ for (var i = 0; i < shortcodeMap.length; i++) {
118
+ var name = shortcodeMap[i];
119
+ params.attributes = params.attributes || {};
120
+ if (selectedParams[name])
121
+ params.attributes[name] = selectedParams[name];
122
+ }
123
+ } else {
124
+ params = ecwidSpwParams;
125
+ }
126
+
127
+ if (params && params.display) {
128
  jQuery('input[type=checkbox]', popup()).prop('checked', false);
129
 
130
+ for (var i in params.display) {
131
  jQuery('input[type=checkbox][data-display-option=' + i + ']')
132
  .prop('checked', true);
133
  }
134
+ for (var i in params.attributes) {
135
  jQuery('input[type=checkbox][data-shortcode-attribute=' + i + ']')
136
  .prop('checked', true);
137
  }
148
  jQuery('.toolbar-link').show();
149
  jQuery('.toolbar-link[data-content=' + tab + ']', popup()).hide();
150
  }
151
+
152
+ var changeMode = function(mode) {
153
+ jQuery('.media-modal-content', popup()).attr('data-mode', mode);
154
+ }
155
 
156
  jQuery('.media-menu-item', popup()).click(function() {
157
  changeTab(jQuery(this).attr('data-content'));
171
  });
172
 
173
 
174
+ jQuery('.media-button-select, .media-button-update', popup()).click(function() {
175
+
176
+ if (popup().data('params') && popup().data('params').saveCallback) {
177
+ popup().data('params').saveCallback({
178
+ originalProps: popup().data('params').props,
179
+ newProps: buildOutputParams()
180
+ });
181
  } else {
182
+ var shortcode = buildShortcode();
183
+
184
+ if (tinymce.activeEditor && !tinymce.activeEditor.isHidden()) {
185
+ tinymce.activeEditor.execCommand('mceInsertContent', false, shortcode);
186
+ } else {
187
+
188
+ getCursorPosition = function(el) {
189
+ var pos = 0;
190
+ if('selectionStart' in el) {
191
+ pos = el.selectionStart;
192
+ } else if('selection' in document) {
193
+ el.focus();
194
+ var Sel = document.selection.createRange();
195
+ var SelLength = document.selection.createRange().text.length;
196
+ Sel.moveStart('character', -el.value.length);
197
+ pos = Sel.text.length - SelLength;
198
+ }
199
+ return pos;
200
+ };
201
+
202
+ var el = jQuery('#content');
203
+ var cursorPosition = getCursorPosition(el.get(0));
204
+
205
+ el.val(el.val().substr(0, cursorPosition) + shortcode + el.val().substr(cursorPosition));
206
+
207
+ }
208
+ saveParams();
209
  }
 
 
 
210
  popup().removeClass('open');
211
  });
212
 
228
  };
229
 
230
  var buildShortcode = function() {
231
+ var params = buildOutputParams();
232
 
233
+ var params_order = ['id', 'display', 'version', 'show_border', 'show_price_on_button', 'center_align'];
 
 
 
 
234
 
 
 
 
235
 
236
  if (params.display.length == 0) {
237
  params.display = 'picture title price options addtobag';
239
  params.display = params.display.join(' ');
240
  }
241
 
 
 
 
 
 
 
242
  var shortcode = '[' + ecwid_params.product_shortcode;
243
 
244
  for (var i = 0; i < params_order.length; i++) {
249
 
250
  return shortcode;
251
  };
252
+
253
+ var buildOutputParams = function() {
254
+
255
+ var params = {};
256
+ product = getSelectedProduct();
257
+
258
+ params.id = product.id;
259
+ params.version = '2';
260
+ params.display = [];
261
+ params.product = product;
262
+
263
+ jQuery('input[type=checkbox][data-display-option]:checked').each(function(idx, el) {
264
+ params.display[params.display.length] = jQuery(el).data('display-option');
265
+ });
266
 
267
+ jQuery('input[type=checkbox][data-shortcode-attribute]').each(function(idx, el) {
268
+ params[jQuery(el).data('shortcode-attribute')] = jQuery(el).is(':checked') ? 1 : 0;
269
+ });
270
+
271
+ return params;
272
+ }
273
+
274
+ var setSelectedProduct = function( product ) {
275
  popup().data('currentProduct', product);
276
  updateFormOnCurrentProduct();
277
  };
278
 
279
+ var getSelectedProduct = function() {
280
  return popup().data('currentProduct');
281
  };
282
 
306
  };
307
 
308
  var updateFormOnCurrentProduct = function() {
309
+ var product = getSelectedProduct();
310
 
311
  if (product) {
312
+ jQuery( '.media-button-select, .media-button-update', popup() ).removeClass( 'disabled' );
313
  } else {
314
+ jQuery( '.media-button-select, .media-button-update', popup() ).addClass( 'disabled' );
315
  }
316
 
317
  }
324
 
325
  if (jQuery(this).hasClass('selected-product')) {
326
  jQuery(this).closest('tbody').find('tr').removeClass('selected-product');
327
+ setSelectedProduct(null);
328
  } else {
329
  jQuery(this).closest('tbody').find('tr').removeClass('selected-product');
330
  jQuery(this).addClass('selected-product');
331
+ setSelectedProduct(jQuery(this).data('productData'));
332
  }
333
  };
334
 
448
 
449
  renderSearchParams();
450
  assignHandlers();
 
451
  jQuery('#search-submit').removeClass('searching');
452
 
453
  if (totalPages <= 1) {
609
  jQuery('#ecwid-reset-search').click(function() {
610
  setSearchParams({});
611
  buildProductsTable(getInitialSearchData());
612
+ setSelectedProduct(null);
613
  });
614
  };
615
 
644
  jQuery('#ecwid-product-popup-content .widget-settings.' + data.section + ' .widget-settings__' + that.nextTarget)
645
  .append(that.template(data));
646
  }
647
+
648
+ function ecwid_open_product_popup(params) {
649
+ jQuery('#ecwid-product-popup-content').data('params', params);
650
+ var open = jQuery('#ecwid-product-popup-content').data('openPopup');
651
+ open();//jQuery('#ecwid-product-popup-content').addClass('open');
652
+ }
js/store-editor-gutenberg.js CHANGED
@@ -41,7 +41,7 @@ jQuery(document).ready(function() {
41
  return {
42
  'show_search': true,
43
  'show_minicart': true,
44
- 'show_categories': true,
45
  'categories_per_row': 3,
46
  'grid_rows': ecwid_pb_defaults.grid_rows,
47
  'grid_columns': ecwid_pb_defaults.grid_columns,
@@ -173,7 +173,7 @@ buildParams = function(attributes) {
173
 
174
  var widgets = attributes.widgets;
175
  if (typeof widgets == 'undefined') {
176
- widgets = "productbrowser search categories minicart";
177
  }
178
 
179
  widgets = widgets.split(/[^a-z^A-Z^0-9^-^_]/);
41
  return {
42
  'show_search': true,
43
  'show_minicart': true,
44
+ 'show_categories': false,
45
  'categories_per_row': 3,
46
  'grid_rows': ecwid_pb_defaults.grid_rows,
47
  'grid_columns': ecwid_pb_defaults.grid_columns,
173
 
174
  var widgets = attributes.widgets;
175
  if (typeof widgets == 'undefined') {
176
+ widgets = "productbrowser search minicart";
177
  }
178
 
179
  widgets = widgets.split(/[^a-z^A-Z^0-9^-^_]/);
js/store-editor-page.js CHANGED
@@ -93,7 +93,7 @@ jQuery(document).ready(function() {
93
  return {
94
  'show_search': true,
95
  'show_minicart': true,
96
- 'show_categories': true,
97
  'categories_per_row': 3,
98
  'grid_rows': ecwid_pb_defaults.grid_rows,
99
  'grid_columns': ecwid_pb_defaults.grid_columns,
93
  return {
94
  'show_search': true,
95
  'show_minicart': true,
96
+ 'show_categories': false,
97
  'categories_per_row': 3,
98
  'grid_rows': ecwid_pb_defaults.grid_rows,
99
  'grid_columns': ecwid_pb_defaults.grid_columns,
languages/ecwid-shopping-cart-ru_RU.mo CHANGED
Binary file
languages/ecwid-shopping-cart-ru_RU.po CHANGED
@@ -1681,6 +1681,19 @@ msgstr "Товары и категории магазина %s"
1681
  msgid "Bulk import products and categories to your %s store"
1682
  msgstr "Загрузка товаров и категорий в магазин из внешних источников или других e-commerce решений"
1683
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1684
  #. #-#-#-#-# ecwid-shopping-cart.pot (Ecwid Shopping Cart 5.2) #-#-#-#-#
1685
  #. Plugin URI of the plugin/theme
1686
  #. #-#-#-#-# ecwid-shopping-cart.pot (Ecwid Shopping Cart 5.2) #-#-#-#-#
1681
  msgid "Bulk import products and categories to your %s store"
1682
  msgstr "Загрузка товаров и категорий в магазин из внешних источников или других e-commerce решений"
1683
 
1684
+ msgctxt "vc-tab"
1685
+ msgid "Online store"
1686
+ msgstr "Магазин"
1687
+
1688
+ msgctxt "vc-block"
1689
+ msgid "Online store"
1690
+ msgstr "Витрина магазина"
1691
+
1692
+ msgid "Displays storefront: product listing and checkout"
1693
+ msgstr "Показывает витрину магазина, корзину и оформление заказа"
1694
+
1695
+
1696
+
1697
  #. #-#-#-#-# ecwid-shopping-cart.pot (Ecwid Shopping Cart 5.2) #-#-#-#-#
1698
  #. Plugin URI of the plugin/theme
1699
  #. #-#-#-#-# ecwid-shopping-cart.pot (Ecwid Shopping Cart 5.2) #-#-#-#-#
lib/ecwid_api_v3.php CHANGED
@@ -297,11 +297,12 @@ class Ecwid_Api_V3
297
  if (empty($db_value)) return false;
298
 
299
  if (strlen($db_value) == 64) {
 
300
  $encrypted = base64_decode($db_value);
301
  if (empty($encrypted)) return false;
302
 
303
  $token = EcwidPlatform::decrypt($encrypted);
304
-
305
  if ($token == $db_value) {
306
  return false;
307
  }
297
  if (empty($db_value)) return false;
298
 
299
  if (strlen($db_value) == 64) {
300
+
301
  $encrypted = base64_decode($db_value);
302
  if (empty($encrypted)) return false;
303
 
304
  $token = EcwidPlatform::decrypt($encrypted);
305
+
306
  if ($token == $db_value) {
307
  return false;
308
  }
lib/ecwid_catalog_entry.php CHANGED
@@ -74,12 +74,14 @@ abstract class Ecwid_Catalog_Entry {
74
 
75
  public function get_seo_link( $baseUrl = '' )
76
  {
77
- if ( isset( $this->_data->seo_link ) ) {
78
- return $this->_data->seo_link;
79
- } else if ( $this->_data->id && isset($this->_data->name) ) {
80
 
81
  if ( !$baseUrl ) {
82
- $baseUrl = Ecwid_Store_Page::get_store_url();
 
 
 
 
83
  }
84
  $url = $baseUrl;
85
 
@@ -90,6 +92,8 @@ abstract class Ecwid_Catalog_Entry {
90
  $url .= $this->_linkify( $this->_data->name ) . '-' . $this->_link_prefix . $this->_data->id;
91
 
92
  return $url;
 
 
93
  }
94
 
95
  return false;
74
 
75
  public function get_seo_link( $baseUrl = '' )
76
  {
77
+ if ( $this->_data->id && isset($this->_data->name) ) {
 
 
78
 
79
  if ( !$baseUrl ) {
80
+ if ( Ecwid_Store_Page::is_store_page() ) {
81
+ $baseUrl = get_permalink();
82
+ } else {
83
+ $baseUrl = Ecwid_Store_Page::get_store_url();
84
+ }
85
  }
86
  $url = $baseUrl;
87
 
92
  $url .= $this->_linkify( $this->_data->name ) . '-' . $this->_link_prefix . $this->_data->id;
93
 
94
  return $url;
95
+ } else if ( isset( $this->_data->seo_link ) ) {
96
+ return $this->_data->seo_link;
97
  }
98
 
99
  return false;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Ecwid
3
  Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
4
  Requires at least: 3.5
5
  Tested up to: 4.9
6
- Stable tag: 6.0.4
7
 
8
  Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
9
 
@@ -35,7 +35,7 @@ So you don't need to worry about software updates, security patches and server m
35
 
36
  = PCI DSS validated Level 1 Service Provider =
37
 
38
- Ecwid Shopping Cart is PCI DSS Level 1 certified, which is the gold standard for e-commerce solutions worldwide. This means that when selling online with the Ecwid plugin, you won’t have any problems with the bank you do business with. With 40+ payment options and secure HTTPS checkout, your Ecwid shopping cart is PCI DSS compliant from the beginning.
39
 
40
  = Free Support =
41
 
@@ -102,12 +102,14 @@ http://codex.wordpress.org/Managing_Plugins#Installing_Plugins
102
  3.
103
  4.
104
  5.
 
 
105
 
106
  == Frequently Asked Questions ==
107
 
108
  = How secure is this plugin? Is my store PCI DSS compliant? =
109
 
110
- Ecwid is PCI DSS Level 1 certified shopping cart plugin – the gold standard for e-commerce solutions worldwide. This means you won’t have any banking compliance issues when selling online with Ecwid. [More details](https://help.ecwid.com/customer/portal/articles/1085017-wordpress-downloadable#secureplugin).
111
 
112
  = How much does Ecwid cost? =
113
 
@@ -149,6 +151,16 @@ You can use Ecwid’s built-in import tools to copy your store products from any
149
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
150
 
151
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
152
  = 6.0.3 - Apr 19, 2018 =
153
  - Fixed incorrect sorting in the store categories menu widgets. If you use display store categories inn your site menu or in a sidebar using the Ecwid categories sidebar widget, you might notice that the categories list order differs from that in your store control panel. We fixed that — now the sorting matches.
154
  - Fixed unclickable products/categories in storefront. This issue appeared in very rare occasions, when a site is running on https (like https://example.com) but someone opens it using an http link (http://example.com). If there was no redirect (it happens sometimes), you might notice that your store product listing doesn’t react on clicks in the http version of your site. We fixed that — now it works well in all cases. We recommend redirecting http to https version though anyway.
3
  Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
4
  Requires at least: 3.5
5
  Tested up to: 4.9
6
+ Stable tag: 6.1
7
 
8
  Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
9
 
35
 
36
  = PCI DSS validated Level 1 Service Provider =
37
 
38
+ Ecwid Shopping Cart is PCI DSS Level 1 certified, which is the gold standard for e-commerce solutions worldwide. This means that Ecwid helps your online store meet the security requirements of the bank you do business with.
39
 
40
  = Free Support =
41
 
102
  3.
103
  4.
104
  5.
105
+ 6.
106
+ 7.
107
 
108
  == Frequently Asked Questions ==
109
 
110
  = How secure is this plugin? Is my store PCI DSS compliant? =
111
 
112
+ Ecwid is PCI DSS Level 1 certified shopping cart plugin – the gold standard for e-commerce solutions worldwide. This helps your online store meet the security requirements of the bank you do business with. [More details](https://help.ecwid.com/customer/portal/articles/1085017-wordpress-downloadable#secureplugin)
113
 
114
  = How much does Ecwid cost? =
115
 
151
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
152
 
153
  == Changelog ==
154
+ = 6.1 - May 30, 2018 =
155
+ - **Compatibility with Gutenberg: buy now buttons in the page editor.** Gutenberg editor is getting more and more popular and will soon be the default WordPress editor. To make sure Ecwid users are ready for it, we are adding Gutenberg support to our plugin. In the previous update, we added a “Store” block to the Gutenberg editor toolbar. This update brings another button to the editor toolbar — “Ecwid product”. Use this one to add product widgets and buy now buttons to the pages and posts of your site.
156
+ - **Revamped cart widget for sidebar.** We added a new sidebar widget that allows to display a cart icon along with items count and subtotal in the sidebar. The new shopping cart icon widget looks better and provides a lot of layout customization options — don’t forget to play with its settings when adding it to your sidebar. You can find the new widget under Appearance → Widgets in your Wordpress admin backend.
157
+ - **New design/appearance settings: new customization options for your storefront.** We added a lot of new design settings to your store dashboard. Read this detailed post to learn how to tweak your store appearance: [https://www.ecwid.com/blog/new-ecwid-design-settings-dozens-of-customization-options-no-coding.html](https://www.ecwid.com/blog/new-ecwid-design-settings-dozens-of-customization-options-no-coding.html)
158
+ - **Compatibility with WP Bakery page builder.** We fixed a few issues and made Ecwid widgets work fine in the “WP Bakery” page builder. Now you can use that sitebuilder with the Ecwid plugin — everything should work fine.
159
+ - **Fixed a pre-renderering issue in IE browser.** The Ecwid e-commerce plugin adds prerender/preload tags to your site code — those are special html codes aimed to make the store page loads faster for your customers. This pre-rendering technology didn’t work well in old IE browsers (IE 11 and older) so we disabled it for IE visitors on your site. It works automatically, so no actions required from your side.
160
+ - **Compatibility with Polylang plugin.** We got a report from one of our customers stating that Ecwid didn’t work well with Polylang plugin. We fixed an issue, now everything should work fine.
161
+ - Improvements and fixes for the plugin navigation in the WP admin menu.
162
+ - Improvements and fixes for store pages SEO friendly urls.
163
+
164
  = 6.0.3 - Apr 19, 2018 =
165
  - Fixed incorrect sorting in the store categories menu widgets. If you use display store categories inn your site menu or in a sidebar using the Ecwid categories sidebar widget, you might notice that the categories list order differs from that in your store control panel. We fixed that — now the sorting matches.
166
  - Fixed unclickable products/categories in storefront. This issue appeared in very rare occasions, when a site is running on https (like https://example.com) but someone opens it using an http link (http://example.com). If there was no redirect (it happens sometimes), you might notice that your store product listing doesn’t react on clicks in the http version of your site. We fixed that — now it works well in all cases. We recommend redirecting http to https version though anyway.
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png CHANGED
Binary file
screenshot-5.png CHANGED
Binary file
screenshot-6.png ADDED
Binary file
screenshot-7.png ADDED
Binary file
templates/admin-head.php CHANGED
@@ -1,4 +1,4 @@
1
- <div class="head"><?php ecwid_embed_svg('ecwid_logo_symbol_RGB');?>
2
  <h3>
3
  <?php printf( __( '%s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
4
  </h3>
1
+ <div class="head"><?php ecwid_embed_svg('ecwid-logo-blue');?>
2
  <h3>
3
  <?php printf( __( '%s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
4
  </h3>
templates/dashboard.php CHANGED
@@ -1,7 +1,7 @@
1
  <div class="wrap ecwid-admin ecwid-dashboard">
2
  <div class="box">
3
  <div class="head">
4
- <?php ecwid_embed_svg('ecwid_logo_symbol_RGB');?>
5
  <h3>
6
  <?php printf( __( '%s Shopping Cart', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
7
  </h3>
1
  <div class="wrap ecwid-admin ecwid-dashboard">
2
  <div class="box">
3
  <div class="head">
4
+ <?php ecwid_embed_svg( 'ecwid-logo-blue' );?>
5
  <h3>
6
  <?php printf( __( '%s Shopping Cart', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
7
  </h3>
templates/importer/landing.tpl.php CHANGED
@@ -1,7 +1,7 @@
1
- <div class="wrap"><h1><?php _e( 'Import products to your Ecwid store', 'ecwid-shopping-cart' ); ?></h1>
2
 
3
  <p>
4
- <?php _e( 'Here, we will help you uploading your product catalog to Ecwid from another shopping cart or other sources.', 'ecwid-shopping-cart' ); ?>
5
  </p>
6
 
7
  <?php if ( $this->_need_to_show_woo() ): ?>
@@ -10,20 +10,21 @@
10
 
11
  <p>
12
  <?php printf(__(
13
- 'We found you have a WooCommerce installed. Your WooCommerce store has %1$s&nbsp;products and %2$s&nbsp;categories. Would you like to import them to Ecwid?',
14
  'ecwid-shopping-cart'
15
  ),
16
- Ecwid_Importer::count_woo_products(), Ecwid_Importer::count_woo_categories()
17
  ); ?>
18
  </p>
19
  <a href="admin.php?page=<?php echo self::PAGE_SLUG_WOO; ?>">
20
- <?php _e( 'Import your WooCommerce products to Ecwid', 'ecwid-shopping-cart' ); ?>
21
  </a>
22
 
23
  <p><?php _e('(You will be able to confirm the changes before the actual import)', 'ecwid-shopping-cart' ); ?></p>
24
  </div>
25
  <?php endif; ?>
26
-
 
27
  <div class="card">
28
  <h2><?php _e( 'Import product catalog from other sources', 'ecwid-shopping-cart' ); ?></h2>
29
 
@@ -32,5 +33,6 @@
32
  <a href="<?php _e( 'https://support.ecwid.com/hc/en-us/articles/208079105-Importing-products', 'ecwid-shopping-cart' ); ?>"><?php _e( 'Learn more', 'ecwid-shopping-cart' ); ?></a>
33
  </p>
34
  </div>
 
35
 
36
  </div>
1
+ <div class="wrap"><h1><?php printf( __( 'Import products to your %s store', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></h1>
2
 
3
  <p>
4
+ <?php printf( __( 'Here, we will help you uploading your product catalog to %s from another shopping cart or other sources.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
5
  </p>
6
 
7
  <?php if ( $this->_need_to_show_woo() ): ?>
10
 
11
  <p>
12
  <?php printf(__(
13
+ 'We found you have a WooCommerce installed. Your WooCommerce store has %1$s&nbsp;products and %2$s&nbsp;categories. Would you like to import it to %3$s?',
14
  'ecwid-shopping-cart'
15
  ),
16
+ Ecwid_Importer::count_woo_products(), Ecwid_Importer::count_woo_categories(), Ecwid_Config::get_brand()
17
  ); ?>
18
  </p>
19
  <a href="admin.php?page=<?php echo self::PAGE_SLUG_WOO; ?>">
20
+ <?php printf( __( 'Import your WooCommerce catalog to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
21
  </a>
22
 
23
  <p><?php _e('(You will be able to confirm the changes before the actual import)', 'ecwid-shopping-cart' ); ?></p>
24
  </div>
25
  <?php endif; ?>
26
+
27
+ <?php if ( !Ecwid_Config::is_wl() ): ?>
28
  <div class="card">
29
  <h2><?php _e( 'Import product catalog from other sources', 'ecwid-shopping-cart' ); ?></h2>
30
 
33
  <a href="<?php _e( 'https://support.ecwid.com/hc/en-us/articles/208079105-Importing-products', 'ecwid-shopping-cart' ); ?>"><?php _e( 'Learn more', 'ecwid-shopping-cart' ); ?></a>
34
  </p>
35
  </div>
36
+ <?php endif; ?>
37
 
38
  </div>
templates/importer/woo-main.tpl.php CHANGED
@@ -3,8 +3,10 @@
3
 
4
  <p><?php echo sprintf( __( 'This import will copy your WooCommerce products and categories to your %s store.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></p>
5
 
 
6
  <p><?php echo sprintf( __( '<b>Important note:</b> import creates new products. please mind the maximum number of products and categories you can add to your store. This import tool will automatically stop when you reach the limit. To learn the current store limit or increase it, please see the "<a %s>Billing & Plans</a>" page in your store control panel. ', 'ecwid-shopping-cart' ), 'href="admin.php?page=ec-store-admin-billing"' ); ?></p>
7
-
 
8
  <h2><?php _e( 'Import summary.', 'ecwid-shopping-cart' ); ?></h2>
9
  <p>
10
  <?php
3
 
4
  <p><?php echo sprintf( __( 'This import will copy your WooCommerce products and categories to your %s store.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></p>
5
 
6
+ <?php if ( !Ecwid_Config::is_wl() ): ?>
7
  <p><?php echo sprintf( __( '<b>Important note:</b> import creates new products. please mind the maximum number of products and categories you can add to your store. This import tool will automatically stop when you reach the limit. To learn the current store limit or increase it, please see the "<a %s>Billing & Plans</a>" page in your store control panel. ', 'ecwid-shopping-cart' ), 'href="admin.php?page=ec-store-admin-billing"' ); ?></p>
8
+ <?php endif; ?>
9
+
10
  <h2><?php _e( 'Import summary.', 'ecwid-shopping-cart' ); ?></h2>
11
  <p>
12
  <?php
templates/product-popup.php CHANGED
@@ -112,6 +112,21 @@
112
  </label>
113
  </script>
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  <div id="ecwid-product-popup-content">
116
  <div class="media-modal wp-core-ui">
117
  <div class="media-modal-content" data-mode="add-product" data-active-dialog="add-product">
@@ -120,9 +135,14 @@
120
  <div class="media-frame-menu">
121
  <div class="media-menu">
122
  <a href="#" class="media-menu-item active" data-content="add-product"><?php _e( 'Choose Product', 'ecwid-shopping-cart' ); ?></a>
 
123
  <a href="#" class="media-menu-item" data-content="customize"><?php _e( 'Customize widget', 'ecwid-shopping-cart' ); ?></a>
124
  </div>
125
  </div>
 
 
 
 
126
  <div class="media-frame-title add-product active">
127
  <h1><?php _e( 'Choose Product', 'ecwid-shopping-cart' ); ?><span class="dashicons dashicons-arrow-down"></span></h1>
128
  </div>
@@ -131,6 +151,9 @@
131
  <h1><?php _e( 'Customize widget', 'ecwid-shopping-cart' ); ?><span class="dashicons dashicons-arrow-down"></span></h1>
132
  </div>
133
 
 
 
 
134
  <div class="media-frame-content ecwid-add-product add-product">
135
  </div>
136
 
@@ -219,6 +242,11 @@
219
  <a target="_blank" class="toolbar-link add-product" data-content="add-product" style="display: none" href="#"><?php _e( 'select product', 'ecwid-shopping-cart' ); ?></a>
220
  <a href="#" class="button media-button button-primary button-large media-button-select"><?php _e( 'Insert', 'ecwid-shopping-cart' ); ?></a>
221
  </div>
 
 
 
 
 
222
  </div>
223
  </div>
224
  </div>
112
  </label>
113
  </script>
114
 
115
+ <script type="text/template" id="tmpl-selected-product">
116
+ <div class="ecwid-selected-product">
117
+ <div class="ecwid-selected-product-image">
118
+ <img src="{{ data.thumb }}">
119
+ </div>
120
+ <div class="ecwid-selected-product-details">
121
+ <div class="ecwid-selected-product-name">{{ data.name }}</div>
122
+ <div class="ecwid-selected-product-sku">{{ data.sku }}</div>
123
+ <div class="ecwid-selected-product-button">
124
+ <button class="button button-secondary" id="choose-another-product"><?php _e(' Choose another product', 'ecwid-shopping-cart' ); ?></button>
125
+ </div>
126
+ </div>
127
+ </div>
128
+ </script>
129
+
130
  <div id="ecwid-product-popup-content">
131
  <div class="media-modal wp-core-ui">
132
  <div class="media-modal-content" data-mode="add-product" data-active-dialog="add-product">
135
  <div class="media-frame-menu">
136
  <div class="media-menu">
137
  <a href="#" class="media-menu-item active" data-content="add-product"><?php _e( 'Choose Product', 'ecwid-shopping-cart' ); ?></a>
138
+ <a href="#" class="media-menu-item" data-content="selected-product"><?php _e( 'Selected Product', 'ecwid-shopping-cart' ); ?></a>
139
  <a href="#" class="media-menu-item" data-content="customize"><?php _e( 'Customize widget', 'ecwid-shopping-cart' ); ?></a>
140
  </div>
141
  </div>
142
+ <div class="media-frame-title selected-product">
143
+ <h1><?php _e( 'Selected Product', 'ecwid-shopping-cart' ); ?><span class="dashicons dashicons-arrow-down"></span></h1>
144
+ </div>
145
+
146
  <div class="media-frame-title add-product active">
147
  <h1><?php _e( 'Choose Product', 'ecwid-shopping-cart' ); ?><span class="dashicons dashicons-arrow-down"></span></h1>
148
  </div>
151
  <h1><?php _e( 'Customize widget', 'ecwid-shopping-cart' ); ?><span class="dashicons dashicons-arrow-down"></span></h1>
152
  </div>
153
 
154
+ <div class="media-frame-content ecwid-selected-product selected-product">
155
+ </div>
156
+
157
  <div class="media-frame-content ecwid-add-product add-product">
158
  </div>
159
 
242
  <a target="_blank" class="toolbar-link add-product" data-content="add-product" style="display: none" href="#"><?php _e( 'select product', 'ecwid-shopping-cart' ); ?></a>
243
  <a href="#" class="button media-button button-primary button-large media-button-select"><?php _e( 'Insert', 'ecwid-shopping-cart' ); ?></a>
244
  </div>
245
+ <div class="media-toolbar-primary selected-product">
246
+ <a target="_blank" class="toolbar-link customize-appearance" data-content="customize" href="#"><?php _e( 'customize appearance', 'ecwid-shopping-cart' ); ?></a>
247
+ <a target="_blank" class="toolbar-link add-product" data-content="selected-product" style="display: none" href="#"><?php _e( 'selected product', 'ecwid-shopping-cart' ); ?></a>
248
+ <a href="#" class="button media-button button-primary button-large media-button-update"><?php _e( 'Update', 'ecwid-shopping-cart' ); ?></a>
249
+ </div>
250
  </div>
251
  </div>
252
  </div>