Ecwid Ecommerce Shopping Cart - Version 6.10.28

Version Description

  • Sep 01, 2022 =
  • Improvements in the plugin code to comply with the WordPress plugin marketplace recommendations.
  • Improvements for compatibility with Divi builder.
  • Minor fixes and improvements.
Download this release

Release Info

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

Code changes from version 6.10.27 to 6.10.28

Files changed (77) hide show
  1. css/popup.css +14 -3
  2. ecwid-shopping-cart.php +15 -20
  3. includes/class-ecwid-admin-main-page.php +99 -119
  4. includes/class-ecwid-admin-storefront-page.php +1 -1
  5. includes/class-ecwid-floating-minicart.php +7 -7
  6. includes/class-ecwid-html-meta.php +10 -11
  7. includes/class-ecwid-nav-menus.php +3 -3
  8. includes/class-ecwid-popup-deactivate.php +90 -90
  9. includes/class-ecwid-seo-links.php +2 -0
  10. includes/class-ecwid-well-known.php +32 -33
  11. includes/gutenberg/class-ecwid-gutenberg-block-minicart.php +45 -45
  12. includes/importer/class-ecwid-import-page.php +3 -3
  13. includes/integrations/class-ecwid-integration-divibuilder.php +1 -1
  14. includes/integrations/class-ecwid-integration-polylang.php +25 -30
  15. includes/integrations/class-ecwid-integration-wpseo.php +4 -4
  16. includes/kliken.php +17 -16
  17. includes/oembed.php +57 -60
  18. includes/shortcodes/class-ecwid-shortcode-product.php +81 -69
  19. includes/themes/class-ecwid-theme-divi.php +1 -1
  20. includes/widgets/class-ecwid-widget-base.php +21 -22
  21. includes/widgets/class-ecwid-widget-minicart-miniview.php +12 -9
  22. includes/widgets/class-ecwid-widget-minicart.php +12 -9
  23. includes/widgets/class-ecwid-widget-nsf-minicart.php +49 -37
  24. includes/widgets/class-ecwid-widget-products-base.php +23 -27
  25. includes/widgets/class-ecwid-widget-search.php +17 -14
  26. includes/widgets/class-ecwid-widget-store-link.php +14 -11
  27. includes/widgets/class-ecwid-widget-vcategories.php +14 -11
  28. includes/widgets/class-ecwid-widget-vertical-categories-list.php +25 -20
  29. includes/widgets/nsf-minicart-editor.tpl.php +55 -47
  30. includes/widgets/nsf-minicart.tpl.php +7 -7
  31. js/admin-storefront.js +154 -154
  32. lib/html-catalog-templates/category.php +7 -7
  33. lib/html-catalog-templates/product.php +4 -4
  34. lib/phpseclib/Base.php +4 -4
  35. readme.txt +7 -2
  36. templates/admin-footer.php +20 -21
  37. templates/admin-head.php +3 -3
  38. templates/admin-params.php +23 -23
  39. templates/admin-timeout.php +3 -3
  40. templates/admin/developers.php +58 -58
  41. templates/admin/legacy-connect.tpl.php +79 -74
  42. templates/admin/simple-dashboard.php +20 -22
  43. templates/admin/storefront/area-additional.php +58 -50
  44. templates/admin/storefront/area-design.php +12 -12
  45. templates/admin/storefront/area-navigation.php +63 -40
  46. templates/admin/storefront/area-promo.php +14 -12
  47. templates/admin/storefront/area-status.php +39 -32
  48. templates/admin/storefront/draft-message.php +2 -2
  49. templates/admin/storefront/main.php +8 -9
  50. templates/admin/welcome-connect.php +6 -5
  51. templates/admin/welcome-connection-message.php +11 -14
  52. templates/admin/welcome-create.php +8 -8
  53. templates/admin/welcome-no_oauth.php +11 -7
  54. templates/admin/welcome-page.php +46 -30
  55. templates/admin/welcome-terms-privacy.php +9 -6
  56. templates/advanced-settings.php +45 -45
  57. templates/dashboard-blog-posts.tpl.php +16 -16
  58. templates/ecwid-admin.php +3 -3
  59. templates/help.php +42 -49
  60. templates/importer/import-no-token.tpl.php +3 -3
  61. templates/importer/landing.tpl.php +32 -26
  62. templates/importer/woo-complete-alert.tpl.php +19 -17
  63. templates/importer/woo-main.tpl.php +43 -30
  64. templates/importer/woo-summary.tpl.php +33 -23
  65. templates/popup/deactivate.php +17 -11
  66. templates/popup/footer.php +2 -2
  67. templates/popup/header.php +1 -1
  68. templates/product-popup.php +209 -209
  69. templates/product.php +1 -1
  70. templates/reconnect-sso.php +6 -6
  71. templates/shortcode-stub-store.tpl.php +36 -36
  72. templates/shortcode-stub.tpl.php +16 -16
  73. templates/store-popup.php +259 -222
  74. templates/store-svg.php +8 -9
  75. templates/sync.php +50 -41
  76. templates/widget-stub.tpl.php +17 -17
  77. templates/wp-toolbox.tpl.php +5 -5
css/popup.css CHANGED
@@ -3,7 +3,7 @@ body.ecwid-popup-open {
3
  }
4
 
5
  .ecwid-popup {
6
- background: rgba(0,0,0,.7);
7
  position: fixed;
8
  overflow: auto;
9
  height: 100%;
@@ -22,7 +22,9 @@ body.ecwid-popup-open {
22
  position: absolute;
23
  }
24
 
25
- .ecwid-popup-header, .ecwid-popup-footer, .ecwid-popup-body {
 
 
26
  padding: 15px;
27
  box-sizing: border-box;
28
  }
@@ -44,6 +46,15 @@ body.ecwid-popup-open {
44
  text-align: right;
45
  }
46
 
 
 
 
 
 
 
 
 
 
47
  .ecwid-popup-body {
48
  padding: 20px;
49
  font-size: 14px;
@@ -53,4 +64,4 @@ body.ecwid-popup-open {
53
  margin: 0px;
54
  font-size: 16px;
55
  font-weight: 500;
56
- }
3
  }
4
 
5
  .ecwid-popup {
6
+ background: rgba(0, 0, 0, .7);
7
  position: fixed;
8
  overflow: auto;
9
  height: 100%;
22
  position: absolute;
23
  }
24
 
25
+ .ecwid-popup-header,
26
+ .ecwid-popup-footer,
27
+ .ecwid-popup-body {
28
  padding: 15px;
29
  box-sizing: border-box;
30
  }
46
  text-align: right;
47
  }
48
 
49
+ .ecwid-popup-footer .float-left {
50
+ float: left;
51
+ margin-left: 5px;
52
+ }
53
+
54
+ .ecwid-popup-footer .float-left:nth-child(1) {
55
+ margin-left: 0;
56
+ }
57
+
58
  .ecwid-popup-body {
59
  padding: 20px;
60
  font-size: 14px;
64
  margin: 0px;
65
  font-size: 16px;
66
  font-weight: 500;
67
+ }
ecwid-shopping-cart.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.ecwid.com?partner=wporg
5
  Description: Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
6
  Text Domain: ecwid-shopping-cart
7
  Author: Ecwid Ecommerce
8
- Version: 6.10.27
9
  Author URI: https://ecwid.to/ecwid-site
10
  License: GPLv2 or later
11
  */
@@ -484,21 +484,21 @@ function ecwid_print_inline_js_config() {
484
  $js .= 'window.ec.config = window.ec.config || Object();' . PHP_EOL;
485
  $js .= 'window.ec.config.enable_canonical_urls = true;' . PHP_EOL;
486
 
487
- $plugins_disabling_interactive = array(
488
  'shiftnav-pro/shiftnav.php',
489
- 'easymega/easymega.php'
490
  );
491
 
492
  foreach ( $plugins_disabling_interactive as $plugin ) {
493
  if ( is_plugin_active( $plugin ) ) {
494
- $js .= "window.ec.config.interactive = false;" . PHP_EOL;
495
  break;
496
  }
497
  }
498
 
499
  $js = apply_filters( 'ecwid_inline_js_config', $js ) . PHP_EOL;
500
-
501
- echo sprintf( '<script data-cfasync="false" data-no-optimize="1" type="text/javascript">%s</script>' . PHP_EOL , $js );
502
  }
503
 
504
  add_action( 'ecwid_inline_js_config', 'ecwid_add_chameleon' );
@@ -1201,7 +1201,7 @@ function ecwid_get_current_user_locale()
1201
  }
1202
 
1203
  function ecwid_product_browser_url_in_head() {
1204
- echo ecwid_get_product_browser_url_script();
1205
  }
1206
 
1207
  function ecwid_is_applicable_escaped_fragment() {
@@ -1742,7 +1742,8 @@ function ecwid_plugin_activation_redirect( $plugin ) {
1742
  $is_newbie = ecwid_is_demo_store();
1743
 
1744
  if( !$is_cli_running && !$is_bulk_activation && $is_newbie && $plugin == plugin_basename( __FILE__ ) ) {
1745
- exit( wp_safe_redirect( Ecwid_Admin::get_dashboard_url() ) );
 
1746
  }
1747
  }
1748
 
@@ -1785,12 +1786,6 @@ function ecwid_show_admin_messages() {
1785
  }
1786
  }
1787
 
1788
- function ecwid_show_admin_message($message) {
1789
-
1790
- $class = version_compare(get_bloginfo('version'), '3.0') < 0 ? "updated fade" : "update-nag";
1791
- echo sprintf('<div class="%s" style="margin-top: 5px">%s</div>', $class, $message);
1792
- }
1793
-
1794
  function ecwid_store_deactivate() {
1795
  $ecwid_page_id = get_option("ecwid_store_page_id");
1796
  $_tmp_page = null;
@@ -1970,15 +1965,15 @@ add_action('admin_post_' . ecwid_get_update_params_action(), 'ecwid_update_plugi
1970
  function ecwid_update_plugin_params()
1971
  {
1972
  if ( !current_user_can('manage_options') ) {
1973
- wp_die( __( 'Sorry, you are not allowed to access this page.' ) );
1974
  }
1975
 
1976
  if ( ! isset( $_POST['_wpnonce'] ) ) {
1977
- wp_die( __( 'Sorry, you are not allowed to access this page.' ) );
1978
  }
1979
 
1980
  if ( ! wp_verify_nonce( wp_unslash( $_POST['_wpnonce'] ), ecwid_get_update_params_action() ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
1981
- wp_die( __( 'Sorry, you are not allowed to access this page.' ) );
1982
  }
1983
 
1984
  $options = ecwid_get_update_params_options();
@@ -2670,7 +2665,7 @@ function ecwid_sync_progress_callback($status) {
2670
  $status['event'] = 'progress';
2671
  }
2672
 
2673
- echo 'event: ' . $status['event'] . "\n";
2674
 
2675
  echo 'data: ' . json_encode($status) . "\n\n";
2676
  flush();
@@ -2786,7 +2781,7 @@ function ecwid_tick() {
2786
  error_log('tick');
2787
  header("Content-Type: text/event-stream\n\n");
2788
  for ($i = 0; $i < 30; $i++) {
2789
- echo "data: $i \n\n";
2790
  flush();
2791
  sleep(2);
2792
  //usleep(2000);
@@ -3075,7 +3070,7 @@ function ecwid_embed_svg($name) {
3075
 
3076
  if( file_exists( $path ) ) {
3077
  $code = file_get_contents( $path );
3078
- echo $code;
3079
  }
3080
  }
3081
 
5
  Description: Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
6
  Text Domain: ecwid-shopping-cart
7
  Author: Ecwid Ecommerce
8
+ Version: 6.10.28
9
  Author URI: https://ecwid.to/ecwid-site
10
  License: GPLv2 or later
11
  */
484
  $js .= 'window.ec.config = window.ec.config || Object();' . PHP_EOL;
485
  $js .= 'window.ec.config.enable_canonical_urls = true;' . PHP_EOL;
486
 
487
+ $plugins_disabling_interactive = array(
488
  'shiftnav-pro/shiftnav.php',
489
+ 'easymega/easymega.php',
490
  );
491
 
492
  foreach ( $plugins_disabling_interactive as $plugin ) {
493
  if ( is_plugin_active( $plugin ) ) {
494
+ $js .= 'window.ec.config.interactive = false;' . PHP_EOL;
495
  break;
496
  }
497
  }
498
 
499
  $js = apply_filters( 'ecwid_inline_js_config', $js ) . PHP_EOL;
500
+
501
+ echo sprintf( '<script data-cfasync="false" data-no-optimize="1" type="text/javascript">%s</script>' . PHP_EOL, $js ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
502
  }
503
 
504
  add_action( 'ecwid_inline_js_config', 'ecwid_add_chameleon' );
1201
  }
1202
 
1203
  function ecwid_product_browser_url_in_head() {
1204
+ echo ecwid_get_product_browser_url_script(); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1205
  }
1206
 
1207
  function ecwid_is_applicable_escaped_fragment() {
1742
  $is_newbie = ecwid_is_demo_store();
1743
 
1744
  if( !$is_cli_running && !$is_bulk_activation && $is_newbie && $plugin == plugin_basename( __FILE__ ) ) {
1745
+ wp_safe_redirect( Ecwid_Admin::get_dashboard_url() );
1746
+ exit();
1747
  }
1748
  }
1749
 
1786
  }
1787
  }
1788
 
 
 
 
 
 
 
1789
  function ecwid_store_deactivate() {
1790
  $ecwid_page_id = get_option("ecwid_store_page_id");
1791
  $_tmp_page = null;
1965
  function ecwid_update_plugin_params()
1966
  {
1967
  if ( !current_user_can('manage_options') ) {
1968
+ wp_die( esc_html__( 'Sorry, you are not allowed to access this page.' ) );
1969
  }
1970
 
1971
  if ( ! isset( $_POST['_wpnonce'] ) ) {
1972
+ wp_die( esc_html__( 'Sorry, you are not allowed to access this page.' ) );
1973
  }
1974
 
1975
  if ( ! wp_verify_nonce( wp_unslash( $_POST['_wpnonce'] ), ecwid_get_update_params_action() ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
1976
+ wp_die( esc_html__( 'Sorry, you are not allowed to access this page.' ) );
1977
  }
1978
 
1979
  $options = ecwid_get_update_params_options();
2665
  $status['event'] = 'progress';
2666
  }
2667
 
2668
+ echo 'event: ' . esc_html( $status['event'] ) . "\n";
2669
 
2670
  echo 'data: ' . json_encode($status) . "\n\n";
2671
  flush();
2781
  error_log('tick');
2782
  header("Content-Type: text/event-stream\n\n");
2783
  for ($i = 0; $i < 30; $i++) {
2784
+ echo "data: $i \n\n"; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2785
  flush();
2786
  sleep(2);
2787
  //usleep(2000);
3070
 
3071
  if( file_exists( $path ) ) {
3072
  $code = file_get_contents( $path );
3073
+ echo $code; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
3074
  }
3075
  }
3076
 
includes/class-ecwid-admin-main-page.php CHANGED
@@ -2,30 +2,29 @@
2
 
3
  define( 'ECWID_ADMIN_TEMPLATES_DIR', ECWID_PLUGIN_DIR . '/templates/admin' );
4
 
5
- class Ecwid_Admin_Main_Page
6
- {
7
- const PAGE_HASH_DASHBOARD = 'dashboard';
8
- const PAGE_HASH_PRODUCTS = 'products';
9
- const PAGE_HASH_ORDERS = 'orders';
10
- const PAGE_HASH_MOBILE = 'mobile';
11
- const PAGE_HASH_UPGRADE = 'billing:feature=sso&plan=ecwid_venture';
12
  const PAGE_HASH_COMPLETE_REGISTRATION = 'complete-registration';
13
-
14
- public function do_page()
15
- {
16
  if ( self::is_forced_reconnect() ) {
17
  ecwid_update_store_id( ecwid_get_demo_store_id() );
18
  }
19
 
20
- $is_demo = ecwid_is_demo_store();
21
- $is_api_connection_ok = !Ecwid_Api_V3::connection_fails();
22
-
23
  if ( $is_demo && $is_api_connection_ok ) {
24
 
25
  if (
26
- $this->_is_whitelabel_mode_with_no_registration()
27
- || $this->_is_oauth_error()
28
- || self::is_forced_reconnect()
29
  ) {
30
 
31
  $this->_do_simple_connect_page();
@@ -37,65 +36,59 @@ class Ecwid_Admin_Main_Page
37
  return;
38
  }
39
  }
40
-
41
-
42
- if ( $is_demo && !$is_api_connection_ok ) {
43
-
44
  $this->_do_legacy_connect_page();
45
  return;
46
  }
47
 
48
- if ( !$is_demo ) {
49
-
50
  if ( self::is_connection_error() ) {
51
 
52
  $this->_do_simple_reconnect_page();
53
  return;
54
 
55
- } else if (
56
- !$is_api_connection_ok
57
- || Ecwid_Admin::disable_dashboard()
58
  ) {
59
  $this->_do_simple_dashboard_page();
60
  return;
61
-
62
  } else {
63
-
64
  $this->_do_integrated_admin_page();
65
  return;
66
  }
67
  }
68
  }
69
-
70
- public static function uses_integrated_admin()
71
- {
72
  $page = new Ecwid_Admin_Main_Page();
73
-
74
- return
75
- !ecwid_is_demo_store()
76
- && !Ecwid_Admin_Main_Page::is_connection_error()
77
- && !Ecwid_Api_V3::connection_fails()
78
- && !Ecwid_Admin::disable_dashboard();
79
  }
80
-
81
- public static function do_integrated_admin_page( $page = self::PAGE_HASH_DASHBOARD )
82
- {
83
  $this_obj = new Ecwid_Admin_Main_Page();
84
  $this_obj->_do_integrated_admin_page( $page );
85
  }
86
-
87
- public function _do_integrated_admin_page( $page = self::PAGE_HASH_DASHBOARD )
88
- {
89
  global $ecwid_oauth;
90
 
91
- if (isset($_GET['show_timeout']) && $_GET['show_timeout'] == '1') {
92
  require_once ECWID_PLUGIN_DIR . 'templates/admin-timeout.php';
93
  die();
94
  }
95
 
96
  if ( Ecwid_Api_V3::get_token() == false ) {
97
 
98
- if( !$ecwid_oauth->has_scope( 'allow_sso' ) ) {
99
  require_once ECWID_PLUGIN_DIR . 'templates/reconnect-sso.php';
100
  } else {
101
  require_once ECWID_PLUGIN_DIR . 'templates/admin/simple-dashboard.php';
@@ -104,109 +97,105 @@ class Ecwid_Admin_Main_Page
104
  die();
105
  }
106
 
107
- if ( isset($_GET['ec-page']) ) {
108
- $page = sanitize_text_field(wp_unslash( $_GET['ec-page'] ));
109
  }
110
 
111
- if ( isset($_GET['ec-store-page']) ) {
112
- $page = sanitize_text_field(wp_unslash( $_GET['ec-store-page'] ));
113
  }
114
 
115
  if ( $page == self::PAGE_HASH_DASHBOARD || $page == self::PAGE_HASH_COMPLETE_REGISTRATION ) {
116
  $show_reconnect = true;
117
  }
118
 
119
- $time = time() - get_option('ecwid_time_correction', 0);
120
 
121
- $iframe_src = ecwid_get_iframe_src($time, $page);
122
 
123
- if( !$iframe_src ) {
124
  $this->_do_simple_connect_page();
125
  return;
126
  }
127
 
128
- $request = Ecwid_Http::create_get('embedded_admin_iframe', $iframe_src, array(Ecwid_Http::POLICY_RETURN_VERBOSE));
129
 
130
- if (!$request) {
131
- Ecwid_Message_Manager::show_message('no_oauth');
132
  return;
133
  }
134
 
135
  $result = $request->do_request();
136
 
137
  if ( @$result['code'] == 403 && (
138
- strpos($result['data'], 'Token too old') !== false
139
- || strpos($result['data'], 'window.top.location = \'https://my.ecwid.com/api/v3/' . get_ecwid_store_id() . '/sso?') !== false
140
- || strpos($result['data'], 'window.top.location = \'https://app.ecwid.com/api/v3/' . get_ecwid_store_id() . '/sso?') !== false
141
  )
142
  ) {
143
 
144
- if (isset($result['headers']['date'])) {
145
- $time = strtotime($result['headers']['date']);
146
 
147
- $iframe_src = ecwid_get_iframe_src($time, $page);
148
 
149
- $request = Ecwid_Http::create_get('embedded_admin_iframe', $iframe_src, array(Ecwid_Http::POLICY_RETURN_VERBOSE));
150
- if (!$request) {
151
- Ecwid_Message_Manager::show_message('no_oauth');
152
  return;
153
  }
154
  $result = $request->do_request();
155
 
156
- if ($result['code'] == 200) {
157
- update_option('ecwid_time_correction', time() - $time);
158
  }
159
  }
160
 
161
- $iframe_src = ecwid_get_iframe_src($time, $page);
 
 
 
 
162
 
163
- $request = Ecwid_Http::create_get('embedded_admin_iframe', $iframe_src, array(Ecwid_Http::POLICY_RETURN_VERBOSE));
164
- $result = $request->do_request();
165
- }
166
-
167
  if ( $result['code'] == 403 ) {
168
- Ecwid_Api_V3::save_token('');
169
  }
170
 
171
  if ( empty( $result['code'] ) && empty( $result['data'] ) || $result['code'] == 500 ) {
172
  require_once ECWID_PLUGIN_DIR . 'templates/admin-timeout.php';
173
- } else if ($result['code'] != 200) {
174
- if (ecwid_test_oauth(true)) {
175
  require_once ECWID_PLUGIN_DIR . 'templates/reconnect-sso.php';
176
  } else {
177
  require_once ECWID_PLUGIN_DIR . 'templates/admin/simple-dashboard.php';
178
  }
179
  } else {
180
  require_once ECWID_PLUGIN_DIR . 'templates/ecwid-admin.php';
181
- }
182
  }
183
 
184
- public static function is_forced_reconnect()
185
- {
186
  return isset( $_GET['reconnect'] );
187
  }
188
 
189
- protected static function _get_upgrade_page_hash()
190
- {
191
  return 'billing:feature=sso&plan=ecwid_venture';
192
  }
193
-
194
- protected function _do_welcome_page( $state )
195
- {
196
- global $ecwid_oauth;
197
 
198
- if( isset($_GET['oauth']) && $_GET['oauth'] == 'no' ) {
 
 
 
199
  $state = 'no_oauth';
200
  }
201
 
202
- $connection_error = self::is_connection_error();
203
- $connect_url = 'admin-post.php?action=ec_connect';
204
 
205
  require_once ECWID_ADMIN_TEMPLATES_DIR . '/welcome-page.php';
206
  }
207
 
208
- protected function _is_registration_blocked_locale()
209
- {
210
  $locale = ecwid_get_current_user_locale();
211
  if ( strpos( $locale, '_RU' ) != false ) {
212
  return true;
@@ -217,59 +206,50 @@ class Ecwid_Admin_Main_Page
217
  public function get_welcome_page_note( $text, $additional_classes = '' ) {
218
  return sprintf( '<div class="ec-note %s">%s</div>', $additional_classes, $text );
219
  }
220
-
221
- protected function _do_simple_connect_page()
222
- {
223
  $this->_do_welcome_page( 'connect' );
224
  }
225
 
226
- protected function _do_simple_reconnect_page()
227
- {
228
  $this->_do_welcome_page( 'connect' );
229
  }
230
 
231
- protected function _do_fancy_connect_page()
232
- {
233
  $this->_do_welcome_page( 'create' );
234
  }
235
 
236
- protected function _do_simple_dashboard_page()
237
- {
238
- require_once ECWID_ADMIN_TEMPLATES_DIR . '/simple-dashboard.php';
239
  }
240
 
241
- protected function _do_legacy_connect_page()
242
- {
243
- wp_enqueue_style('legacy-connect', ECWID_PLUGIN_URL . '/css/legacy-connect.css');
244
 
245
  require_once ECWID_ADMIN_TEMPLATES_DIR . '/legacy-connect.tpl.php';
246
  }
247
-
248
- protected function _is_whitelabel_mode_with_no_registration()
249
- {
250
- return Ecwid_Config::is_no_reg_wl();
251
  }
252
-
253
- protected function _is_oauth_error()
254
- {
255
  $connection_error = isset( $_GET['connection_error'] );
256
- $no_oauth = isset($_GET['oauth']) && $_GET['oauth'] == 'no';
257
-
258
- return isset( $connection_error ) && $no_oauth;
259
  }
260
-
261
- protected function _is_current_user_email_registered_at_ecwid()
262
- {
263
- $api = new Ecwid_Api_V3();
264
  $current_user = wp_get_current_user();
265
-
266
  return $api->does_store_exist( $current_user->user_email );
267
  }
268
-
269
- static public function is_connection_error()
270
- {
271
  return isset( $_GET['connection_error'] );
272
  }
273
  }
274
 
275
- $_ecwid_admin_main_page = new Ecwid_Admin_Main_Page();
2
 
3
  define( 'ECWID_ADMIN_TEMPLATES_DIR', ECWID_PLUGIN_DIR . '/templates/admin' );
4
 
5
+ class Ecwid_Admin_Main_Page {
6
+
7
+ const PAGE_HASH_DASHBOARD = 'dashboard';
8
+ const PAGE_HASH_PRODUCTS = 'products';
9
+ const PAGE_HASH_ORDERS = 'orders';
10
+ const PAGE_HASH_MOBILE = 'mobile';
11
+ const PAGE_HASH_UPGRADE = 'billing:feature=sso&plan=ecwid_venture';
12
  const PAGE_HASH_COMPLETE_REGISTRATION = 'complete-registration';
13
+
14
+ public function do_page() {
 
15
  if ( self::is_forced_reconnect() ) {
16
  ecwid_update_store_id( ecwid_get_demo_store_id() );
17
  }
18
 
19
+ $is_demo = ecwid_is_demo_store();
20
+ $is_api_connection_ok = ! Ecwid_Api_V3::connection_fails();
21
+
22
  if ( $is_demo && $is_api_connection_ok ) {
23
 
24
  if (
25
+ $this->_is_whitelabel_mode_with_no_registration()
26
+ || $this->_is_oauth_error()
27
+ || self::is_forced_reconnect()
28
  ) {
29
 
30
  $this->_do_simple_connect_page();
36
  return;
37
  }
38
  }
39
+
40
+ if ( $is_demo && ! $is_api_connection_ok ) {
41
+
 
42
  $this->_do_legacy_connect_page();
43
  return;
44
  }
45
 
46
+ if ( ! $is_demo ) {
47
+
48
  if ( self::is_connection_error() ) {
49
 
50
  $this->_do_simple_reconnect_page();
51
  return;
52
 
53
+ } elseif ( ! $is_api_connection_ok
54
+ || Ecwid_Admin::disable_dashboard()
 
55
  ) {
56
  $this->_do_simple_dashboard_page();
57
  return;
58
+
59
  } else {
60
+
61
  $this->_do_integrated_admin_page();
62
  return;
63
  }
64
  }
65
  }
66
+
67
+ public static function uses_integrated_admin() {
 
68
  $page = new Ecwid_Admin_Main_Page();
69
+
70
+ return ! ecwid_is_demo_store()
71
+ && ! self::is_connection_error()
72
+ && ! Ecwid_Api_V3::connection_fails()
73
+ && ! Ecwid_Admin::disable_dashboard();
 
74
  }
75
+
76
+ public static function do_integrated_admin_page( $page = self::PAGE_HASH_DASHBOARD ) {
 
77
  $this_obj = new Ecwid_Admin_Main_Page();
78
  $this_obj->_do_integrated_admin_page( $page );
79
  }
80
+
81
+ public function _do_integrated_admin_page( $page = self::PAGE_HASH_DASHBOARD ) {
 
82
  global $ecwid_oauth;
83
 
84
+ if ( isset( $_GET['show_timeout'] ) && $_GET['show_timeout'] == '1' ) {
85
  require_once ECWID_PLUGIN_DIR . 'templates/admin-timeout.php';
86
  die();
87
  }
88
 
89
  if ( Ecwid_Api_V3::get_token() == false ) {
90
 
91
+ if ( ! $ecwid_oauth->has_scope( 'allow_sso' ) ) {
92
  require_once ECWID_PLUGIN_DIR . 'templates/reconnect-sso.php';
93
  } else {
94
  require_once ECWID_PLUGIN_DIR . 'templates/admin/simple-dashboard.php';
97
  die();
98
  }
99
 
100
+ if ( isset( $_GET['ec-page'] ) ) {
101
+ $page = sanitize_text_field( wp_unslash( $_GET['ec-page'] ) );
102
  }
103
 
104
+ if ( isset( $_GET['ec-store-page'] ) ) {
105
+ $page = sanitize_text_field( wp_unslash( $_GET['ec-store-page'] ) );
106
  }
107
 
108
  if ( $page == self::PAGE_HASH_DASHBOARD || $page == self::PAGE_HASH_COMPLETE_REGISTRATION ) {
109
  $show_reconnect = true;
110
  }
111
 
112
+ $time = time() - get_option( 'ecwid_time_correction', 0 );
113
 
114
+ $iframe_src = ecwid_get_iframe_src( $time, $page );
115
 
116
+ if ( ! $iframe_src ) {
117
  $this->_do_simple_connect_page();
118
  return;
119
  }
120
 
121
+ $request = Ecwid_Http::create_get( 'embedded_admin_iframe', $iframe_src, array( Ecwid_Http::POLICY_RETURN_VERBOSE ) );
122
 
123
+ if ( ! $request ) {
124
+ Ecwid_Message_Manager::show_message( 'no_oauth' );
125
  return;
126
  }
127
 
128
  $result = $request->do_request();
129
 
130
  if ( @$result['code'] == 403 && (
131
+ strpos( $result['data'], 'Token too old' ) !== false
132
+ || strpos( $result['data'], 'window.top.location = \'https://my.ecwid.com/api/v3/' . get_ecwid_store_id() . '/sso?' ) !== false
133
+ || strpos( $result['data'], 'window.top.location = \'https://app.ecwid.com/api/v3/' . get_ecwid_store_id() . '/sso?' ) !== false
134
  )
135
  ) {
136
 
137
+ if ( isset( $result['headers']['date'] ) ) {
138
+ $time = strtotime( $result['headers']['date'] );
139
 
140
+ $iframe_src = ecwid_get_iframe_src( $time, $page );
141
 
142
+ $request = Ecwid_Http::create_get( 'embedded_admin_iframe', $iframe_src, array( Ecwid_Http::POLICY_RETURN_VERBOSE ) );
143
+ if ( ! $request ) {
144
+ Ecwid_Message_Manager::show_message( 'no_oauth' );
145
  return;
146
  }
147
  $result = $request->do_request();
148
 
149
+ if ( $result['code'] == 200 ) {
150
+ update_option( 'ecwid_time_correction', time() - $time );
151
  }
152
  }
153
 
154
+ $iframe_src = ecwid_get_iframe_src( $time, $page );
155
+
156
+ $request = Ecwid_Http::create_get( 'embedded_admin_iframe', $iframe_src, array( Ecwid_Http::POLICY_RETURN_VERBOSE ) );
157
+ $result = $request->do_request();
158
+ }//end if
159
 
 
 
 
 
160
  if ( $result['code'] == 403 ) {
161
+ Ecwid_Api_V3::save_token( '' );
162
  }
163
 
164
  if ( empty( $result['code'] ) && empty( $result['data'] ) || $result['code'] == 500 ) {
165
  require_once ECWID_PLUGIN_DIR . 'templates/admin-timeout.php';
166
+ } elseif ( $result['code'] != 200 ) {
167
+ if ( ecwid_test_oauth( true ) ) {
168
  require_once ECWID_PLUGIN_DIR . 'templates/reconnect-sso.php';
169
  } else {
170
  require_once ECWID_PLUGIN_DIR . 'templates/admin/simple-dashboard.php';
171
  }
172
  } else {
173
  require_once ECWID_PLUGIN_DIR . 'templates/ecwid-admin.php';
174
+ }
175
  }
176
 
177
+ public static function is_forced_reconnect() {
 
178
  return isset( $_GET['reconnect'] );
179
  }
180
 
181
+ protected static function _get_upgrade_page_hash() {
 
182
  return 'billing:feature=sso&plan=ecwid_venture';
183
  }
 
 
 
 
184
 
185
+ protected function _do_welcome_page( $state ) {
186
+ global $ecwid_oauth;
187
+
188
+ if ( isset( $_GET['oauth'] ) && $_GET['oauth'] == 'no' ) {
189
  $state = 'no_oauth';
190
  }
191
 
192
+ $connection_error = self::is_connection_error();
193
+ $connect_url = 'admin-post.php?action=ec_connect';
194
 
195
  require_once ECWID_ADMIN_TEMPLATES_DIR . '/welcome-page.php';
196
  }
197
 
198
+ protected function _is_registration_blocked_locale() {
 
199
  $locale = ecwid_get_current_user_locale();
200
  if ( strpos( $locale, '_RU' ) != false ) {
201
  return true;
206
  public function get_welcome_page_note( $text, $additional_classes = '' ) {
207
  return sprintf( '<div class="ec-note %s">%s</div>', $additional_classes, $text );
208
  }
209
+
210
+ protected function _do_simple_connect_page() {
 
211
  $this->_do_welcome_page( 'connect' );
212
  }
213
 
214
+ protected function _do_simple_reconnect_page() {
 
215
  $this->_do_welcome_page( 'connect' );
216
  }
217
 
218
+ protected function _do_fancy_connect_page() {
 
219
  $this->_do_welcome_page( 'create' );
220
  }
221
 
222
+ protected function _do_simple_dashboard_page() {
223
+ require_once ECWID_ADMIN_TEMPLATES_DIR . '/simple-dashboard.php';
 
224
  }
225
 
226
+ protected function _do_legacy_connect_page() {
227
+ wp_enqueue_style( 'legacy-connect', ECWID_PLUGIN_URL . '/css/legacy-connect.css' );
 
228
 
229
  require_once ECWID_ADMIN_TEMPLATES_DIR . '/legacy-connect.tpl.php';
230
  }
231
+
232
+ protected function _is_whitelabel_mode_with_no_registration() {
233
+ return Ecwid_Config::is_no_reg_wl();
 
234
  }
235
+
236
+ protected function _is_oauth_error() {
 
237
  $connection_error = isset( $_GET['connection_error'] );
238
+ $no_oauth = isset( $_GET['oauth'] ) && $_GET['oauth'] == 'no';
239
+
240
+ return isset( $connection_error ) && $no_oauth;
241
  }
242
+
243
+ protected function _is_current_user_email_registered_at_ecwid() {
244
+ $api = new Ecwid_Api_V3();
 
245
  $current_user = wp_get_current_user();
246
+
247
  return $api->does_store_exist( $current_user->user_email );
248
  }
249
+
250
+ public static function is_connection_error() {
 
251
  return isset( $_GET['connection_error'] );
252
  }
253
  }
254
 
255
+ $_ecwid_admin_main_page = new Ecwid_Admin_Main_Page();
includes/class-ecwid-admin-storefront-page.php CHANGED
@@ -538,7 +538,7 @@ class Ecwid_Admin_Storefront_Page {
538
  $text = $item['text'];
539
  }
540
 
541
- echo sprintf( '<li><a%s>%s</a></li>', esc_attr( $attributes ), esc_html( $text ) );
542
  }//end foreach
543
  }
544
 
538
  $text = $item['text'];
539
  }
540
 
541
+ echo sprintf( '<li><a%s>%s</a></li>', wp_kses_post( $attributes ), esc_html( $text ) );
542
  }//end foreach
543
  }
544
 
includes/class-ecwid-floating-minicart.php CHANGED
@@ -21,7 +21,7 @@ if ( version_compare( get_bloginfo( 'version' ), '4.0' ) >= 0 ) {
21
  const CUSTOMIZE_ID = 'ec-customize-cart';
22
 
23
  public function __construct() {
24
- add_action( 'wp_footer', array( $this, 'display' ) );
25
  }
26
 
27
  public function display() {
@@ -47,7 +47,7 @@ if ( version_compare( get_bloginfo( 'version' ), '4.0' ) >= 0 ) {
47
  return;
48
  }
49
 
50
- echo ecwid_get_scriptjs_code();
51
 
52
  $position = esc_attr( get_option( self::OPTION_FIXED_POSITION ) );
53
  $shape = esc_attr( get_option( self::OPTION_FIXED_SHAPE ) );
@@ -136,11 +136,11 @@ if ( version_compare( get_bloginfo( 'version' ), '4.0' ) >= 0 ) {
136
  }
137
 
138
  public static function get_fixed_shapes() {
139
- return array(
140
- 'RECT' => __( 'Rectangle', 'ecwid-shopping-cart' ),
141
- 'PILL' => __( 'Pill', 'ecwid-shopping-cart' ),
142
- '' => __( 'No border', 'ecwid-shopping-cart' ),
143
- );
144
  }
145
 
146
  public static function get_fixed_positions() {
21
  const CUSTOMIZE_ID = 'ec-customize-cart';
22
 
23
  public function __construct() {
24
+ add_action( 'wp_footer', array( $this, 'display' ) );
25
  }
26
 
27
  public function display() {
47
  return;
48
  }
49
 
50
+ echo ecwid_get_scriptjs_code(); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
51
 
52
  $position = esc_attr( get_option( self::OPTION_FIXED_POSITION ) );
53
  $shape = esc_attr( get_option( self::OPTION_FIXED_SHAPE ) );
136
  }
137
 
138
  public static function get_fixed_shapes() {
139
+ return array(
140
+ 'RECT' => __( 'Rectangle', 'ecwid-shopping-cart' ),
141
+ 'PILL' => __( 'Pill', 'ecwid-shopping-cart' ),
142
+ '' => __( 'No border', 'ecwid-shopping-cart' ),
143
+ );
144
  }
145
 
146
  public static function get_fixed_positions() {
includes/class-ecwid-html-meta.php CHANGED
@@ -62,20 +62,19 @@ abstract class Ecwid_HTML_Meta {
62
  return;
63
  }
64
 
65
- echo $this->_get_html_prefetch_control_tags();
66
 
67
  $store_id = get_ecwid_store_id();
68
  $params = ecwid_get_scriptjs_params();
69
 
70
- echo '<link rel="preload" href="https://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?'
71
- . $store_id . $params . '" as="script">' . PHP_EOL;
72
 
73
  if ( Ecwid_Static_Page::is_enabled_static_home_page() && Ecwid_Static_Page::is_data_available() ) {
74
  $css_files = Ecwid_Static_Page::get_css_files();
75
 
76
  if ( $css_files && is_array( $css_files ) ) {
77
  foreach ( $css_files as $item ) {
78
- echo sprintf( '<link rel="preload" href="%s" as="style">', $item ) . PHP_EOL;
79
  }
80
  }
81
  }
@@ -152,7 +151,7 @@ class Ecwid_HTML_Meta_Catalog_Entry extends Ecwid_HTML_Meta {
152
  }//end if
153
 
154
  if ( $description_html ) {
155
- echo $description_html;
156
  }
157
 
158
  return;
@@ -169,7 +168,7 @@ class Ecwid_HTML_Meta_Catalog_Entry extends Ecwid_HTML_Meta {
169
  $og_tags_html
170
  );
171
 
172
- echo $og_tags_html;
173
  }
174
 
175
 
@@ -187,7 +186,7 @@ class Ecwid_HTML_Meta_Catalog_Entry extends Ecwid_HTML_Meta {
187
 
188
  protected function _print_json_ld() {
189
  $json_ld = Ecwid_Static_Page::get_json_ld_html();
190
- echo $json_ld;
191
  }
192
 
193
  protected function _print_ajax_crawling_fragment() {
@@ -234,14 +233,14 @@ class Ecwid_HTML_Meta_Other extends Ecwid_HTML_Meta {
234
  return;
235
  }
236
 
237
- echo $this->_get_html_prefetch_control_tags();
238
 
239
  if ( Ecwid_Static_Page::is_enabled_static_home_page() && Ecwid_Static_Page::is_data_available() ) {
240
  $css_files = Ecwid_Static_Page::get_css_files();
241
 
242
  if ( $css_files && is_array( $css_files ) ) {
243
  foreach ( $css_files as $item ) {
244
- echo sprintf( '<link rel="prefetch" href="%s">', $item ) . PHP_EOL;
245
  }
246
  }
247
  }
@@ -251,10 +250,10 @@ class Ecwid_HTML_Meta_Other extends Ecwid_HTML_Meta {
251
  $params = ecwid_get_scriptjs_params();
252
 
253
  $scriptjs_url = 'https://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?' . $store_id . $params;
254
- echo sprintf( '<link rel="prefetch" href="%s" />', $scriptjs_url ) . PHP_EOL;
255
 
256
  $page_url = Ecwid_Store_Page::get_store_url();
257
- echo sprintf( '<link rel="prerender" href="%s" />', $page_url ) . PHP_EOL;
258
  }
259
  }
260
 
62
  return;
63
  }
64
 
65
+ echo $this->_get_html_prefetch_control_tags(); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
66
 
67
  $store_id = get_ecwid_store_id();
68
  $params = ecwid_get_scriptjs_params();
69
 
70
+ echo '<link rel="preload" href="https://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?' . $store_id . $params . '" as="script">' . PHP_EOL; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
 
71
 
72
  if ( Ecwid_Static_Page::is_enabled_static_home_page() && Ecwid_Static_Page::is_data_available() ) {
73
  $css_files = Ecwid_Static_Page::get_css_files();
74
 
75
  if ( $css_files && is_array( $css_files ) ) {
76
  foreach ( $css_files as $item ) {
77
+ echo sprintf( '<link rel="preload" href="%s" as="style">', $item ) . PHP_EOL; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
78
  }
79
  }
80
  }
151
  }//end if
152
 
153
  if ( $description_html ) {
154
+ echo $description_html; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
155
  }
156
 
157
  return;
168
  $og_tags_html
169
  );
170
 
171
+ echo $og_tags_html; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
172
  }
173
 
174
 
186
 
187
  protected function _print_json_ld() {
188
  $json_ld = Ecwid_Static_Page::get_json_ld_html();
189
+ echo $json_ld; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
190
  }
191
 
192
  protected function _print_ajax_crawling_fragment() {
233
  return;
234
  }
235
 
236
+ echo $this->_get_html_prefetch_control_tags(); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
237
 
238
  if ( Ecwid_Static_Page::is_enabled_static_home_page() && Ecwid_Static_Page::is_data_available() ) {
239
  $css_files = Ecwid_Static_Page::get_css_files();
240
 
241
  if ( $css_files && is_array( $css_files ) ) {
242
  foreach ( $css_files as $item ) {
243
+ echo sprintf( '<link rel="prefetch" href="%s">', $item ) . PHP_EOL; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
244
  }
245
  }
246
  }
250
  $params = ecwid_get_scriptjs_params();
251
 
252
  $scriptjs_url = 'https://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?' . $store_id . $params;
253
+ echo sprintf( '<link rel="prefetch" href="%s" />', $scriptjs_url ) . PHP_EOL; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
254
 
255
  $page_url = Ecwid_Store_Page::get_store_url();
256
+ echo sprintf( '<link rel="prerender" href="%s" />', $page_url ) . PHP_EOL; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
257
  }
258
  }
259
 
includes/class-ecwid-nav-menus.php CHANGED
@@ -337,9 +337,9 @@ class Ecwid_Nav_Menus {
337
  ?>
338
  <li>
339
  <label class="menu-item-title">
340
- <input type="checkbox" class="menu-item-checkbox" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-object-id]" value="<?php echo esc_attr( $i ); ?>" /> <?php echo $value['list-name']; ?>
341
  </label>
342
- <input type="hidden" class="menu-item-object" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-object]" value="<?php echo $value['classes']; ?>" />
343
  <input type="hidden" class="menu-item-type" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-type]" value="ecwid_menu_item" />
344
  <input type="hidden" class="menu-item-title" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-title]" value="<?php echo esc_html( $value['label'] ); ?>" />
345
  <input type="hidden" class="menu-item-url" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-url]" value="<?php echo esc_url( Ecwid_Store_Page::get_store_url() . '#!/~/' . $value['url'] ); ?>" />
@@ -352,7 +352,7 @@ class Ecwid_Nav_Menus {
352
  </div>
353
  <p class="button-controls">
354
  <span class="list-controls">
355
- <a href="<?php echo admin_url( 'nav-menus.php?page-tab=all&selectall=1#posttype-ecwid-links' ); ?>" class="select-all"><?php _e( 'Select All' ); ?></a>
356
  </span>
357
  <span class="add-to-menu">
358
  <input type="submit" class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-post-type-menu-item" id="submit-posttype-ecwid-links">
337
  ?>
338
  <li>
339
  <label class="menu-item-title">
340
+ <input type="checkbox" class="menu-item-checkbox" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-object-id]" value="<?php echo esc_attr( $i ); ?>" /> <?php echo esc_html( $value['list-name'] ); ?>
341
  </label>
342
+ <input type="hidden" class="menu-item-object" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-object]" value="<?php echo esc_attr( $value['classes'] ); ?>" />
343
  <input type="hidden" class="menu-item-type" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-type]" value="ecwid_menu_item" />
344
  <input type="hidden" class="menu-item-title" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-title]" value="<?php echo esc_html( $value['label'] ); ?>" />
345
  <input type="hidden" class="menu-item-url" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-url]" value="<?php echo esc_url( Ecwid_Store_Page::get_store_url() . '#!/~/' . $value['url'] ); ?>" />
352
  </div>
353
  <p class="button-controls">
354
  <span class="list-controls">
355
+ <a href="<?php echo esc_url( admin_url( 'nav-menus.php?page-tab=all&selectall=1#posttype-ecwid-links' ) ); ?>" class="select-all"><?php esc_html_e( 'Select All' ); ?></a>
356
  </span>
357
  <span class="add-to-menu">
358
  <input type="submit" class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-post-type-menu-item" id="submit-posttype-ecwid-links">
includes/class-ecwid-popup-deactivate.php CHANGED
@@ -1,28 +1,26 @@
1
  <?php
2
 
3
- require_once( ECWID_PLUGIN_DIR . 'includes/class-ecwid-popup.php' );
4
 
5
  class Ecwid_Popup_Deactivate extends Ecwid_Popup {
6
 
7
  protected $_class = 'ecwid-popup-deactivate';
8
-
9
  const OPTION_DISABLE_POPUP = 'ecwid_disable_deactivate_popup';
10
-
11
- public function __construct()
12
- {
13
- add_action( 'wp_ajax_ecwid_deactivate_feedback', array( $this, 'ajax_deactivate_feedback') );
14
  }
15
-
16
- public function enqueue_scripts()
17
- {
18
  parent::enqueue_scripts();
19
- wp_enqueue_script( 'ecwid-popup-deactivate', ECWID_PLUGIN_URL . '/js/popup-deactivate.js', array( 'jquery' ), get_option('ecwid_plugin_version') );
20
- wp_enqueue_style( 'ecwid-popup-deactivate', ECWID_PLUGIN_URL . '/css/popup-deactivate.css', array( ), get_option('ecwid_plugin_version') );
21
  }
22
-
23
  public function ajax_deactivate_feedback() {
24
- if ( !current_user_can('manage_options') ) {
25
- header('403 Access Denied');
26
 
27
  die();
28
  }
@@ -30,29 +28,29 @@ class Ecwid_Popup_Deactivate extends Ecwid_Popup {
30
  $to = 'plugins-feedback@ecwid.com';
31
 
32
  $body_lines = array();
33
- if ( !ecwid_is_demo_store() ) {
34
  $body_lines[] = 'Store ID: ' . get_ecwid_store_id();
35
  }
36
-
37
  $reasons = $this->_get_reasons();
38
 
39
- if( isset($_GET['reason']) ) {
40
- $reason = $reasons[ sanitize_text_field(wp_unslash($_GET['reason'])) ];
41
  } else {
42
- $reason = end($reasons);
43
  }
44
 
45
  if ( isset( $reason['is_disable_message'] ) ) {
46
  update_option( self::OPTION_DISABLE_POPUP, true );
47
  }
48
-
49
  $body_lines[] = 'Store URL: ' . Ecwid_Store_Page::get_store_url();
50
- $body_lines[] = 'Plugin installed: ' . strftime( '%d %b %Y', get_option( 'ecwid_installation_date' ) );
51
- $body_lines[] = 'Plugin version: ' . get_option('ecwid_plugin_version');
52
- $body_lines[] = 'Reason:' . $reason['text'] . "\n" . ( !empty( $_GET['message'] ) ? sanitize_text_field(wp_unslash($_GET['message'])) : '[no message]' );
53
-
54
  $api = new Ecwid_Api_V3();
55
-
56
  $profile = $api->get_store_profile();
57
  if ( $profile && @$profile->account && @$profile->account->accountEmail ) {
58
  $reply_to = $profile->account->accountEmail;
@@ -60,16 +58,16 @@ class Ecwid_Popup_Deactivate extends Ecwid_Popup {
60
  global $current_user;
61
  $reply_to = $current_user->user_email;
62
  }
63
-
64
- $subject_template = __( '[%s] WordPress plugin deactivation feedback (store ID: %s)', 'ecwid-shopping-cart' );
65
-
66
  $prefix = $reason['code'];
67
- if ( !empty( $_GET['message'] ) ) {
68
  $prefix .= ', commented';
69
  }
70
-
71
  $subject = sprintf( $subject_template, $prefix, get_ecwid_store_id() );
72
-
73
  $result = wp_mail(
74
  $to,
75
  $subject,
@@ -77,105 +75,107 @@ class Ecwid_Popup_Deactivate extends Ecwid_Popup {
77
  'Reply-To:' . $reply_to
78
  );
79
 
80
- if ($result) {
81
- header('HTTP/1.1 200 OK');
82
  die();
83
  } else {
84
- header('500 Send mail failed');
85
  die();
86
  }
87
  }
88
-
89
  public function is_disabled() {
90
  $disabled = get_option( self::OPTION_DISABLE_POPUP, false );
91
-
92
- if ( $disabled ) return true;
93
-
94
- if ( Ecwid_Config::is_wl() ) return true;
95
-
96
- if (strpos(ecwid_get_current_user_locale(), 'en') !== 0) return true;
97
-
 
 
 
 
 
 
98
  return false;
99
  }
100
-
101
- protected function _get_footer_buttons()
102
- {
103
  return array(
104
  (object) array(
105
- 'class' => 'button-secondary deactivate',
106
- 'title' => __( 'Submit & Deactivate', 'ecwid-shopping-cart' )
107
  ),
108
  (object) array(
109
- 'class' => 'button-primary btn-close',
110
- 'title' => __( 'Cancel', 'ecwid-shopping-cart' )
111
- )
112
  );
113
  }
114
 
115
- protected function _get_header()
116
- {
117
  return __( 'Before You Go', 'ecwid-shopping-cart' );
118
  }
119
 
120
- protected function _render_body()
121
- {
122
- if( ecwid_is_paid_account() ) {
123
  $support_link = Ecwid_Config::get_contact_us_url();
124
  } else {
125
  $support_link = 'https://wordpress.org/support/plugin/ecwid-shopping-cart/#new-topic-0';
126
  }
127
-
128
  $reasons = $this->_get_reasons();
129
- require ( ECWID_POPUP_TEMPLATES_DIR . 'deactivate.php' );
130
  }
131
-
132
- protected function _get_reasons()
133
- {
134
  $options = array(
135
  array(
136
- 'text' => __( 'I have a problem using this plugin', 'ecwid-shopping-cart' ),
137
- 'has_message' => true,
138
- 'code' => 'problem',
139
  'message_hint' => __( 'What was wrong?', 'ecwid-shopping-cart' ),
140
  ),
141
  array(
142
- 'text' => sprintf(
143
  __( 'I couldn’t find a WordPress theme that goes well with %s', 'ecwid-shopping-cart' ),
144
  Ecwid_Config::get_brand()
145
  ),
146
- 'has_message' => true,
147
- 'code' => 'theme',
148
- 'message_hint' => sprintf(
149
- __( 'I use this WordPress theme: %s', 'ecwid-shopping-cart' ),
150
- wp_get_theme()->get('Name')
151
- )
152
  ),
153
  array(
154
- 'text' => __( 'The plugin doesn\'t support the feature I want', 'ecwid-shopping-cart' ),
155
- 'has_message' => true,
156
- 'code' => 'no feature',
157
- 'message_hint' => __( 'What feature do you need?', 'ecwid-shopping-cart' )
158
  ),
159
  array(
160
- 'text' => __( 'I found a better plugin', 'ecwid-shopping-cart' ),
161
- 'has_message' => true,
162
- 'code' => 'found better',
163
- 'message_hint' => __( 'Can you share the name of the plugin you chose?', 'ecwid-shopping-cart' )
164
  ),
165
  array(
166
- 'text' => __( 'It\'s a temporary deactivation. Please do not ask me again.', 'ecwid-shopping-cart' ),
167
- 'has_message' => false,
168
- 'code' => 'temporary',
169
- 'is_disable_message' => true
170
  ),
171
  array(
172
- 'text' => __( 'Other', 'ecwid-shopping-cart' ),
173
- 'has_message' => true,
174
- 'code' => 'other',
175
- 'message_hint' => __( 'Can you share your feedback? What was wrong?', 'ecwid-shopping-cart' )
176
- )
177
- );
178
-
179
  return $options;
180
  }
181
- }
1
  <?php
2
 
3
+ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-popup.php';
4
 
5
  class Ecwid_Popup_Deactivate extends Ecwid_Popup {
6
 
7
  protected $_class = 'ecwid-popup-deactivate';
8
+
9
  const OPTION_DISABLE_POPUP = 'ecwid_disable_deactivate_popup';
10
+
11
+ public function __construct() {
12
+ add_action( 'wp_ajax_ecwid_deactivate_feedback', array( $this, 'ajax_deactivate_feedback' ) );
 
13
  }
14
+
15
+ public function enqueue_scripts() {
 
16
  parent::enqueue_scripts();
17
+ wp_enqueue_script( 'ecwid-popup-deactivate', ECWID_PLUGIN_URL . '/js/popup-deactivate.js', array( 'jquery' ), get_option( 'ecwid_plugin_version' ) );
18
+ wp_enqueue_style( 'ecwid-popup-deactivate', ECWID_PLUGIN_URL . '/css/popup-deactivate.css', array(), get_option( 'ecwid_plugin_version' ) );
19
  }
20
+
21
  public function ajax_deactivate_feedback() {
22
+ if ( ! current_user_can( 'manage_options' ) ) {
23
+ header( '403 Access Denied' );
24
 
25
  die();
26
  }
28
  $to = 'plugins-feedback@ecwid.com';
29
 
30
  $body_lines = array();
31
+ if ( ! ecwid_is_demo_store() ) {
32
  $body_lines[] = 'Store ID: ' . get_ecwid_store_id();
33
  }
34
+
35
  $reasons = $this->_get_reasons();
36
 
37
+ if ( isset( $_GET['reason'] ) ) {
38
+ $reason = $reasons[ sanitize_text_field( wp_unslash( $_GET['reason'] ) ) ];
39
  } else {
40
+ $reason = end( $reasons );
41
  }
42
 
43
  if ( isset( $reason['is_disable_message'] ) ) {
44
  update_option( self::OPTION_DISABLE_POPUP, true );
45
  }
46
+
47
  $body_lines[] = 'Store URL: ' . Ecwid_Store_Page::get_store_url();
48
+ $body_lines[] = 'Plugin installed: ' . strftime( '%d %b %Y', get_option( 'ecwid_installation_date' ) );
49
+ $body_lines[] = 'Plugin version: ' . get_option( 'ecwid_plugin_version' );
50
+ $body_lines[] = 'Reason:' . $reason['text'] . "\n" . ( ! empty( $_GET['message'] ) ? sanitize_text_field( wp_unslash( $_GET['message'] ) ) : '[no message]' );
51
+
52
  $api = new Ecwid_Api_V3();
53
+
54
  $profile = $api->get_store_profile();
55
  if ( $profile && @$profile->account && @$profile->account->accountEmail ) {
56
  $reply_to = $profile->account->accountEmail;
58
  global $current_user;
59
  $reply_to = $current_user->user_email;
60
  }
61
+
62
+ $subject_template = __( '[%1$s] WordPress plugin deactivation feedback (store ID: %2$s)', 'ecwid-shopping-cart' );
63
+
64
  $prefix = $reason['code'];
65
+ if ( ! empty( $_GET['message'] ) ) {
66
  $prefix .= ', commented';
67
  }
68
+
69
  $subject = sprintf( $subject_template, $prefix, get_ecwid_store_id() );
70
+
71
  $result = wp_mail(
72
  $to,
73
  $subject,
75
  'Reply-To:' . $reply_to
76
  );
77
 
78
+ if ( $result ) {
79
+ header( 'HTTP/1.1 200 OK' );
80
  die();
81
  } else {
82
+ header( '500 Send mail failed' );
83
  die();
84
  }
85
  }
86
+
87
  public function is_disabled() {
88
  $disabled = get_option( self::OPTION_DISABLE_POPUP, false );
89
+
90
+ if ( $disabled ) {
91
+ return true;
92
+ }
93
+
94
+ if ( Ecwid_Config::is_wl() ) {
95
+ return true;
96
+ }
97
+
98
+ if ( strpos( ecwid_get_current_user_locale(), 'en' ) !== 0 ) {
99
+ return true;
100
+ }
101
+
102
  return false;
103
  }
104
+
105
+ protected function _get_footer_buttons() {
 
106
  return array(
107
  (object) array(
108
+ 'class' => 'button-primary float-left deactivate',
109
+ 'title' => __( 'Submit & Deactivate', 'ecwid-shopping-cart' ),
110
  ),
111
  (object) array(
112
+ 'class' => 'button-link deactivate',
113
+ 'title' => __( 'Skip & Deactivate', 'ecwid-shopping-cart' ),
114
+ ),
115
  );
116
  }
117
 
118
+ protected function _get_header() {
 
119
  return __( 'Before You Go', 'ecwid-shopping-cart' );
120
  }
121
 
122
+ protected function _render_body() {
123
+ if ( ecwid_is_paid_account() ) {
 
124
  $support_link = Ecwid_Config::get_contact_us_url();
125
  } else {
126
  $support_link = 'https://wordpress.org/support/plugin/ecwid-shopping-cart/#new-topic-0';
127
  }
128
+
129
  $reasons = $this->_get_reasons();
130
+ require ECWID_POPUP_TEMPLATES_DIR . 'deactivate.php';
131
  }
132
+
133
+ protected function _get_reasons() {
 
134
  $options = array(
135
  array(
136
+ 'text' => __( 'I have a problem using this plugin', 'ecwid-shopping-cart' ),
137
+ 'has_message' => true,
138
+ 'code' => 'problem',
139
  'message_hint' => __( 'What was wrong?', 'ecwid-shopping-cart' ),
140
  ),
141
  array(
142
+ 'text' => sprintf(
143
  __( 'I couldn’t find a WordPress theme that goes well with %s', 'ecwid-shopping-cart' ),
144
  Ecwid_Config::get_brand()
145
  ),
146
+ 'has_message' => true,
147
+ 'code' => 'theme',
148
+ 'message_hint' => sprintf(
149
+ __( 'I use this WordPress theme: %s', 'ecwid-shopping-cart' ),
150
+ wp_get_theme()->get( 'Name' )
151
+ ),
152
  ),
153
  array(
154
+ 'text' => __( 'The plugin doesn\'t support the feature I want', 'ecwid-shopping-cart' ),
155
+ 'has_message' => true,
156
+ 'code' => 'no feature',
157
+ 'message_hint' => __( 'What feature do you need?', 'ecwid-shopping-cart' ),
158
  ),
159
  array(
160
+ 'text' => __( 'I found a better plugin', 'ecwid-shopping-cart' ),
161
+ 'has_message' => true,
162
+ 'code' => 'found better',
163
+ 'message_hint' => __( 'Can you share the name of the plugin you chose?', 'ecwid-shopping-cart' ),
164
  ),
165
  array(
166
+ 'text' => __( 'It\'s a temporary deactivation. Please do not ask me again.', 'ecwid-shopping-cart' ),
167
+ 'has_message' => false,
168
+ 'code' => 'temporary',
169
+ 'is_disable_message' => true,
170
  ),
171
  array(
172
+ 'text' => __( 'Other', 'ecwid-shopping-cart' ),
173
+ 'has_message' => true,
174
+ 'code' => 'other',
175
+ 'message_hint' => __( 'Can you share your feedback? What was wrong?', 'ecwid-shopping-cart' ),
176
+ ),
177
+ );
178
+
179
  return $options;
180
  }
181
+ }
includes/class-ecwid-seo-links.php CHANGED
@@ -160,6 +160,8 @@ class Ecwid_Seo_Links {
160
  'account\/orders',
161
  'account\/address-book',
162
  'account\/favorites',
 
 
163
  'search',
164
  'search\?.*',
165
  'signin',
160
  'account\/orders',
161
  'account\/address-book',
162
  'account\/favorites',
163
+ 'account\/registration',
164
+ 'account\/resetPassword',
165
  'search',
166
  'search\?.*',
167
  'signin',
includes/class-ecwid-well-known.php CHANGED
@@ -2,8 +2,8 @@
2
 
3
  class Ecwid_Well_Known {
4
 
5
- public function __construct()
6
- {
7
  // rule for .well-known/* path
8
  add_filter( 'query_vars', array( $this, 'query_vars' ) );
9
  add_action( 'parse_request', array( $this, 'delegate_request' ), 1000 );
@@ -11,88 +11,88 @@ class Ecwid_Well_Known {
11
 
12
  add_action( 'permalink_structure_changed', array( $this, 'save_mod_rewrite_rules' ) );
13
 
14
- if( !Ecwid_Seo_Links::is_feature_available() ) {
15
  add_action( 'init', array( $this, 'check_add_rewrite_rules' ) );
16
  }
17
 
18
  // Well-Known URIs
19
- add_action( "ec_well_known_apple-developer-merchantid-domain-association", array($this, "apple_pay_verification" ) );
20
  }
21
 
22
- public function query_vars($vars) {
23
  $vars[] = 'ec-well-known';
24
  return $vars;
25
  }
26
 
27
- public function rewrite_rules($wp_rewrite) {
28
- $well_known_rules = array(
29
- '.well-known/(.+)' => 'index.php?ec-well-known='.$wp_rewrite->preg_index(1)
30
  );
31
  $wp_rewrite->rules = $well_known_rules + $wp_rewrite->rules;
32
  }
33
 
34
- public function delegate_request($wp) {
35
- if( array_key_exists('ec-well-known', $wp->query_vars) ) {
36
  $uri_suffix = str_replace( '/', '', $wp->query_vars['ec-well-known'] );
37
 
38
- do_action( "ec_well_known", $wp->query_vars );
39
  do_action( "ec_well_known_{$uri_suffix}", $wp->query_vars );
40
  }
41
  }
42
 
43
  public function save_mod_rewrite_rules() {
44
 
45
- if( !function_exists('get_home_path') ) {
46
- require_once ( ABSPATH . 'wp-admin/includes/file.php' );
47
  }
48
 
49
- if( !function_exists('insert_with_markers') ) {
50
- require_once ( ABSPATH . 'wp-admin/includes/misc.php' );
51
  }
52
 
53
- $brand = Ecwid_Config::get_brand();
54
- $rules = array();
55
- $home_path = get_home_path();
56
  $htaccess_file = $home_path . '.htaccess';
57
 
58
- if( !Ecwid_Seo_Links::is_feature_available() ) {
59
  $rules[] = '<IfModule mod_rewrite.c>';
60
  $rules[] = 'RewriteEngine On';
61
  $rules[] = 'RewriteRule ^\.well-known/(.+)$ index.php?ec-well-known=$1 [L]';
62
  $rules[] = '</IfModule>';
63
  } else {
64
- EcwidPlatform::cache_reset('need_add_rewrite');
65
  }
66
 
67
  insert_with_markers( $htaccess_file, $brand, $rules );
68
  }
69
 
70
- public function check_add_rewrite_rules(){
71
  $need_add_rewrite = EcwidPlatform::cache_get( 'need_add_rewrite', null );
72
 
73
- if ( is_null($need_add_rewrite) ) {
74
  $this->save_mod_rewrite_rules();
75
- EcwidPlatform::cache_set('need_add_rewrite', '1', WEEK_IN_SECONDS);
76
  }
77
  }
78
 
79
  public function apple_pay_verification( $query_vars ) {
80
- $api = new Ecwid_Api_V3();
81
- $profile = $api->get_store_profile(true);
 
 
82
 
83
- if( $profile && !empty($profile->payment->applePay->verificationFileUrl) ) {
84
-
85
  $response = wp_remote_get(
86
  $profile->payment->applePay->verificationFileUrl,
87
  array(
88
- 'timeout' => 60
89
  )
90
  );
91
 
92
  $body = wp_remote_retrieve_body( $response );
93
 
94
- if( !empty( $body ) ) {
95
- echo $body;
96
  } else {
97
  $this->show_404();
98
  }
@@ -100,7 +100,7 @@ class Ecwid_Well_Known {
100
  exit();
101
  } else {
102
  $this->show_404();
103
- }
104
  }
105
 
106
  public function show_404() {
@@ -108,10 +108,9 @@ class Ecwid_Well_Known {
108
 
109
  $wp_query->set_404();
110
  status_header( 404 );
111
-
112
  exit();
113
  }
114
 
115
  }
116
  $ecwid_well_know = new Ecwid_Well_Known();
117
-
2
 
3
  class Ecwid_Well_Known {
4
 
5
+ public function __construct() {
6
+
7
  // rule for .well-known/* path
8
  add_filter( 'query_vars', array( $this, 'query_vars' ) );
9
  add_action( 'parse_request', array( $this, 'delegate_request' ), 1000 );
11
 
12
  add_action( 'permalink_structure_changed', array( $this, 'save_mod_rewrite_rules' ) );
13
 
14
+ if ( ! Ecwid_Seo_Links::is_feature_available() ) {
15
  add_action( 'init', array( $this, 'check_add_rewrite_rules' ) );
16
  }
17
 
18
  // Well-Known URIs
19
+ add_action( 'ec_well_known_apple-developer-merchantid-domain-association', array( $this, 'apple_pay_verification' ) );
20
  }
21
 
22
+ public function query_vars( $vars ) {
23
  $vars[] = 'ec-well-known';
24
  return $vars;
25
  }
26
 
27
+ public function rewrite_rules( $wp_rewrite ) {
28
+ $well_known_rules = array(
29
+ '.well-known/(.+)' => 'index.php?ec-well-known=' . $wp_rewrite->preg_index( 1 ),
30
  );
31
  $wp_rewrite->rules = $well_known_rules + $wp_rewrite->rules;
32
  }
33
 
34
+ public function delegate_request( $wp ) {
35
+ if ( array_key_exists( 'ec-well-known', $wp->query_vars ) ) {
36
  $uri_suffix = str_replace( '/', '', $wp->query_vars['ec-well-known'] );
37
 
38
+ do_action( 'ec_well_known', $wp->query_vars );
39
  do_action( "ec_well_known_{$uri_suffix}", $wp->query_vars );
40
  }
41
  }
42
 
43
  public function save_mod_rewrite_rules() {
44
 
45
+ if ( ! function_exists( 'get_home_path' ) ) {
46
+ require_once ABSPATH . 'wp-admin/includes/file.php';
47
  }
48
 
49
+ if ( ! function_exists( 'insert_with_markers' ) ) {
50
+ require_once ABSPATH . 'wp-admin/includes/misc.php';
51
  }
52
 
53
+ $brand = Ecwid_Config::get_brand();
54
+ $rules = array();
55
+ $home_path = get_home_path();
56
  $htaccess_file = $home_path . '.htaccess';
57
 
58
+ if ( ! Ecwid_Seo_Links::is_feature_available() ) {
59
  $rules[] = '<IfModule mod_rewrite.c>';
60
  $rules[] = 'RewriteEngine On';
61
  $rules[] = 'RewriteRule ^\.well-known/(.+)$ index.php?ec-well-known=$1 [L]';
62
  $rules[] = '</IfModule>';
63
  } else {
64
+ EcwidPlatform::cache_reset( 'need_add_rewrite' );
65
  }
66
 
67
  insert_with_markers( $htaccess_file, $brand, $rules );
68
  }
69
 
70
+ public function check_add_rewrite_rules() {
71
  $need_add_rewrite = EcwidPlatform::cache_get( 'need_add_rewrite', null );
72
 
73
+ if ( is_null( $need_add_rewrite ) ) {
74
  $this->save_mod_rewrite_rules();
75
+ EcwidPlatform::cache_set( 'need_add_rewrite', '1', WEEK_IN_SECONDS );
76
  }
77
  }
78
 
79
  public function apple_pay_verification( $query_vars ) {
80
+ $api = new Ecwid_Api_V3();
81
+ $profile = $api->get_store_profile( true );
82
+
83
+ if ( $profile && ! empty( $profile->payment->applePay->verificationFileUrl ) ) {
84
 
 
 
85
  $response = wp_remote_get(
86
  $profile->payment->applePay->verificationFileUrl,
87
  array(
88
+ 'timeout' => 60,
89
  )
90
  );
91
 
92
  $body = wp_remote_retrieve_body( $response );
93
 
94
+ if ( ! empty( $body ) ) {
95
+ echo esc_html( $body );
96
  } else {
97
  $this->show_404();
98
  }
100
  exit();
101
  } else {
102
  $this->show_404();
103
+ }//end if
104
  }
105
 
106
  public function show_404() {
108
 
109
  $wp_query->set_404();
110
  status_header( 404 );
111
+
112
  exit();
113
  }
114
 
115
  }
116
  $ecwid_well_know = new Ecwid_Well_Known();
 
includes/gutenberg/class-ecwid-gutenberg-block-minicart.php CHANGED
@@ -5,13 +5,13 @@ require_once dirname( __FILE__ ) . '/class-ecwid-gutenberg-block-base.php';
5
  class Ecwid_Gutenberg_Block_Minicart extends Ecwid_Gutenberg_Block_Base {
6
 
7
  protected $_name = 'minicart';
8
-
9
  public function render_callback( $params ) {
10
-
11
  $params = wp_parse_args(
12
  $params,
13
  array(
14
- 'is_ecwid_shortcode' => true
15
  )
16
  );
17
 
@@ -20,29 +20,29 @@ class Ecwid_Gutenberg_Block_Minicart extends Ecwid_Gutenberg_Block_Base {
20
  <!-- noptimize -->
21
  <?php
22
 
23
- echo ecwid_get_scriptjs_code();
24
- echo ecwid_get_product_browser_url_script();
25
 
26
  $attributes = $this->get_attributes_for_editor();
27
-
28
  foreach ( array( 'fixed_shape', 'layout', 'icon' ) as $param ) {
29
- if ( !@$params[$param] ) {
30
- $params[$param] = $attributes[$param]['default'];
31
- }
32
- }
33
-
34
  ?>
35
-
36
- <div class='ec-cart-widget'
37
- data-fixed='false'
38
- data-fixed-shape='<?php echo @$params['fixed_shape']; ?>'
39
- data-layout='<?php echo @$params['layout']; ?>'
40
- data-icon='<?php echo @$params['icon']; ?>'
41
  ></div>
42
-
43
  <script>
44
  if (typeof Ecwid != 'undefined'){
45
- Ecwid.init();
46
  }
47
  </script>
48
  <!-- /noptimize -->
@@ -52,9 +52,9 @@ class Ecwid_Gutenberg_Block_Minicart extends Ecwid_Gutenberg_Block_Base {
52
  ob_end_clean();
53
 
54
  $align = @$params['align'];
55
- if ( $align == 'right' || $align == "left" ) {
56
- $contents = '<div class="align' . $align . '">' . $contents . '</div>';
57
- }
58
 
59
  return $contents;
60
  }
@@ -62,45 +62,45 @@ class Ecwid_Gutenberg_Block_Minicart extends Ecwid_Gutenberg_Block_Base {
62
  public function get_attributes_for_editor() {
63
 
64
  $minicart_attributes = array(
65
- 'layout' => array(
66
- 'name' => 'layout',
67
- 'title' => __( 'Layout', 'ecwid-shopping-cart' ),
68
- 'values' => Ecwid_Floating_Minicart::get_layouts(),
69
- 'default' => 'BIG_ICON_TITLE_SUBTOTAL'
70
  ),
71
- 'icon' => array(
72
- 'name' => 'icon',
73
- 'title' => __( 'Cart icon', 'ecwid-shopping-cart' ),
74
- 'values' => Ecwid_Floating_Minicart::get_icons(),
75
- 'default' => 'BAG'
76
  ),
77
  'fixed_shape' => array(
78
- 'name' => 'fixed_shape',
79
- 'title' => __( 'Border', 'ecwid-shopping-cart' ),
80
- 'values' => Ecwid_Floating_Minicart::get_fixed_shapes(),
81
- 'default' => 'RECT'
82
- )
83
  );
84
 
85
  $attributes = array();
86
-
87
  foreach ( $minicart_attributes as $name => $attr ) {
88
- $result = array();
89
- $result['name'] = $attr['name'];
90
- $result['title'] = $attr['title'];
91
  $result['default'] = $attr['default'];
92
- $result['values'] = array();
93
 
94
  foreach ( $attr['values'] as $value => $title ) {
95
  $result['values'][] = array(
96
  'value' => $value,
97
- 'title' => $title
98
  );
99
  }
100
 
101
- $attributes[$name] = $result;
102
  }
103
 
104
  return $attributes;
105
  }
106
- }
5
  class Ecwid_Gutenberg_Block_Minicart extends Ecwid_Gutenberg_Block_Base {
6
 
7
  protected $_name = 'minicart';
8
+
9
  public function render_callback( $params ) {
10
+
11
  $params = wp_parse_args(
12
  $params,
13
  array(
14
+ 'is_ecwid_shortcode' => true,
15
  )
16
  );
17
 
20
  <!-- noptimize -->
21
  <?php
22
 
23
+ echo ecwid_get_scriptjs_code(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
24
+ echo ecwid_get_product_browser_url_script(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
25
 
26
  $attributes = $this->get_attributes_for_editor();
27
+
28
  foreach ( array( 'fixed_shape', 'layout', 'icon' ) as $param ) {
29
+ if ( ! @$params[ $param ] ) {
30
+ $params[ $param ] = $attributes[ $param ]['default'];
31
+ }
32
+ }
33
+
34
  ?>
35
+
36
+ <div class='ec-cart-widget'
37
+ data-fixed='false'
38
+ data-fixed-shape='<?php echo esc_attr( @$params['fixed_shape'] ); ?>'
39
+ data-layout='<?php echo esc_attr( @$params['layout'] ); ?>'
40
+ data-icon='<?php echo esc_attr( @$params['icon'] ); ?>'
41
  ></div>
42
+
43
  <script>
44
  if (typeof Ecwid != 'undefined'){
45
+ Ecwid.init();
46
  }
47
  </script>
48
  <!-- /noptimize -->
52
  ob_end_clean();
53
 
54
  $align = @$params['align'];
55
+ if ( $align == 'right' || $align == 'left' ) {
56
+ $contents = '<div class="align' . $align . '">' . $contents . '</div>';
57
+ }
58
 
59
  return $contents;
60
  }
62
  public function get_attributes_for_editor() {
63
 
64
  $minicart_attributes = array(
65
+ 'layout' => array(
66
+ 'name' => 'layout',
67
+ 'title' => __( 'Layout', 'ecwid-shopping-cart' ),
68
+ 'values' => Ecwid_Floating_Minicart::get_layouts(),
69
+ 'default' => 'BIG_ICON_TITLE_SUBTOTAL',
70
  ),
71
+ 'icon' => array(
72
+ 'name' => 'icon',
73
+ 'title' => __( 'Cart icon', 'ecwid-shopping-cart' ),
74
+ 'values' => Ecwid_Floating_Minicart::get_icons(),
75
+ 'default' => 'BAG',
76
  ),
77
  'fixed_shape' => array(
78
+ 'name' => 'fixed_shape',
79
+ 'title' => __( 'Border', 'ecwid-shopping-cart' ),
80
+ 'values' => Ecwid_Floating_Minicart::get_fixed_shapes(),
81
+ 'default' => 'RECT',
82
+ ),
83
  );
84
 
85
  $attributes = array();
86
+
87
  foreach ( $minicart_attributes as $name => $attr ) {
88
+ $result = array();
89
+ $result['name'] = $attr['name'];
90
+ $result['title'] = $attr['title'];
91
  $result['default'] = $attr['default'];
92
+ $result['values'] = array();
93
 
94
  foreach ( $attr['values'] as $value => $title ) {
95
  $result['values'][] = array(
96
  'value' => $value,
97
+ 'title' => $title,
98
  );
99
  }
100
 
101
+ $attributes[ $name ] = $result;
102
  }
103
 
104
  return $attributes;
105
  }
106
+ }
includes/importer/class-ecwid-import-page.php CHANGED
@@ -198,12 +198,12 @@ class Ecwid_Import_Page {
198
  }
199
 
200
  foreach ( $error_log as $type => $messages ) {
201
- echo sprintf( "ERROR TYPE: %s\r\n", $type );
202
 
203
  foreach ( $messages as $message => $data ) {
204
  echo "*** \r\n";
205
- echo $message . "\r\n";
206
- echo 'Data: ' . var_export( $data, true ) . "\r\n";
207
  }
208
 
209
  echo "\r\n";
198
  }
199
 
200
  foreach ( $error_log as $type => $messages ) {
201
+ echo esc_html( sprintf( "ERROR TYPE: %s\r\n", $type ) );
202
 
203
  foreach ( $messages as $message => $data ) {
204
  echo "*** \r\n";
205
+ echo esc_html( $message ) . "\r\n";
206
+ echo 'Data: ' . var_export( $data, true ) . "\r\n"; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
207
  }
208
 
209
  echo "\r\n";
includes/integrations/class-ecwid-integration-divibuilder.php CHANGED
@@ -19,7 +19,7 @@ new Ecwid_Integration_Divibuilder();
19
 
20
  function ecwid_create_divi_module() {
21
 
22
- if ( class_exists( 'ET_Builder_Module' ) && ! class_exists( 'ET_Builder_Module_Ecwid' ) ) {
23
  class ET_Builder_Module_Ecwid extends ET_Builder_Module {
24
  public function init() {
25
  // translators: %s: brand
19
 
20
  function ecwid_create_divi_module() {
21
 
22
+ if ( class_exists( 'ET_Builder_Module' ) && class_exists( 'ET_Builder_Settings' ) && ! class_exists( 'ET_Builder_Module_Ecwid' ) ) {
23
  class ET_Builder_Module_Ecwid extends ET_Builder_Module {
24
  public function init() {
25
  // translators: %s: brand
includes/integrations/class-ecwid-integration-polylang.php CHANGED
@@ -1,18 +1,18 @@
1
  <?php
2
 
3
- class Ecwid_Integration_Polylang
4
- {
5
  public $hreflang_items;
6
 
7
  public function __construct() {
8
  add_filter( 'ecwid_lang', array( $this, 'force_scriptjs_lang' ) );
9
-
10
  add_filter( 'pll_rel_hreflang_attributes', array( $this, 'filter_hreflangs' ), 1, 1 );
11
  add_action( 'wp_head', array( $this, 'print_hreflang_js_config' ) );
12
  }
13
 
14
  public function force_scriptjs_lang( $lang ) {
15
- if( function_exists('pll_current_language') ) {
16
  $lang = pll_current_language();
17
  }
18
  return $lang;
@@ -21,25 +21,25 @@ class Ecwid_Integration_Polylang
21
  public function set_hreflangs( $hreflangs ) {
22
  $this->hreflang_items = $hreflangs;
23
  }
24
-
25
  public function get_hreflangs( $hreflangs ) {
26
  return $this->hreflang_items;
27
  }
28
 
29
  public function filter_hreflangs( $hreflangs ) {
30
-
31
  $this->set_hreflangs( $hreflangs );
32
 
33
  add_filter( 'ecwid_hreflangs', array( $this, 'get_hreflangs' ), 1000 );
34
 
35
- if( class_exists( 'Ecwid_Static_Page' ) && Ecwid_Static_Page::is_data_available() ) {
36
-
37
  $ecwid_hreflang_html = Ecwid_Static_Page::get_href_lang_html();
38
 
39
- if( $ecwid_hreflang_html ) {
40
  $ecwid_hreflangs = $this->parse_hreflang_html_to_array( $ecwid_hreflang_html );
41
-
42
- if( $ecwid_hreflangs ) {
43
  return $ecwid_hreflangs;
44
  }
45
  }
@@ -53,7 +53,7 @@ class Ecwid_Integration_Polylang
53
 
54
  preg_match_all( $pattern, $string, $matches );
55
 
56
- if( !empty( $matches[1] ) ) {
57
  return array_combine( $matches[1], $matches[2] );
58
  }
59
 
@@ -62,28 +62,23 @@ class Ecwid_Integration_Polylang
62
 
63
  public function print_hreflang_js_config() {
64
 
65
- if( !is_array( $this->hreflang_items ) ) {
66
  return;
67
  }
68
 
69
- $js = '<script data-cfasync="false" type="text/javascript">';
70
-
71
- $js .= 'window.ec = window.ec || Object();';
72
- $js .= 'window.ec.config = window.ec.config || Object();';
73
-
74
- $js .= 'window.ec.config.storefrontUrls.enableHreflangTags = true;';
75
- $js .= 'window.ec.config.storefrontUrls.internationalPages = {';
76
-
77
- foreach( $this->hreflang_items as $lang => $url ) {
78
- $js .= sprintf( '"%s": "%s",', $lang, $url );
79
  }
80
-
81
- $js .= '};';
82
-
83
- $js .= '</script>';
84
-
85
- echo $js;
 
 
86
  }
87
  }
88
 
89
- $ecwid_integration_polylang = new Ecwid_Integration_Polylang();
1
  <?php
2
 
3
+ class Ecwid_Integration_Polylang {
4
+
5
  public $hreflang_items;
6
 
7
  public function __construct() {
8
  add_filter( 'ecwid_lang', array( $this, 'force_scriptjs_lang' ) );
9
+
10
  add_filter( 'pll_rel_hreflang_attributes', array( $this, 'filter_hreflangs' ), 1, 1 );
11
  add_action( 'wp_head', array( $this, 'print_hreflang_js_config' ) );
12
  }
13
 
14
  public function force_scriptjs_lang( $lang ) {
15
+ if ( function_exists( 'pll_current_language' ) ) {
16
  $lang = pll_current_language();
17
  }
18
  return $lang;
21
  public function set_hreflangs( $hreflangs ) {
22
  $this->hreflang_items = $hreflangs;
23
  }
24
+
25
  public function get_hreflangs( $hreflangs ) {
26
  return $this->hreflang_items;
27
  }
28
 
29
  public function filter_hreflangs( $hreflangs ) {
30
+
31
  $this->set_hreflangs( $hreflangs );
32
 
33
  add_filter( 'ecwid_hreflangs', array( $this, 'get_hreflangs' ), 1000 );
34
 
35
+ if ( class_exists( 'Ecwid_Static_Page' ) && Ecwid_Static_Page::is_data_available() ) {
36
+
37
  $ecwid_hreflang_html = Ecwid_Static_Page::get_href_lang_html();
38
 
39
+ if ( $ecwid_hreflang_html ) {
40
  $ecwid_hreflangs = $this->parse_hreflang_html_to_array( $ecwid_hreflang_html );
41
+
42
+ if ( $ecwid_hreflangs ) {
43
  return $ecwid_hreflangs;
44
  }
45
  }
53
 
54
  preg_match_all( $pattern, $string, $matches );
55
 
56
+ if ( ! empty( $matches[1] ) ) {
57
  return array_combine( $matches[1], $matches[2] );
58
  }
59
 
62
 
63
  public function print_hreflang_js_config() {
64
 
65
+ if ( ! is_array( $this->hreflang_items ) ) {
66
  return;
67
  }
68
 
69
+ $pages = array();
70
+ foreach ( $this->hreflang_items as $lang => $url ) {
71
+ $pages[ $lang ] = $url;
 
 
 
 
 
 
 
72
  }
73
+ ?>
74
+ <script data-cfasync="false" type="text/javascript">
75
+ window.ec = window.ec || Object();
76
+ window.ec.config = window.ec.config || Object();
77
+ window.ec.config.storefrontUrls.enableHreflangTags = true;
78
+ window.ec.config.storefrontUrls.internationalPages = <?php echo wp_json_encode( $pages, JSON_UNESCAPED_SLASHES ); ?>;
79
+ </script>
80
+ <?php
81
  }
82
  }
83
 
84
+ $ecwid_integration_polylang = new Ecwid_Integration_Polylang();
includes/integrations/class-ecwid-integration-wpseo.php CHANGED
@@ -119,7 +119,7 @@ class Ecwid_Integration_WordPress_SEO_By_Yoast {
119
  $output = ob_get_contents();
120
  ob_end_clean();
121
 
122
- if ( substr_count( $output, '"og:image"' ) > 1 ) {
123
 
124
  $og_tags = array( '', ':width', ':height', ':type' );
125
  foreach ( $og_tags as $og_tag ) {
@@ -132,7 +132,7 @@ class Ecwid_Integration_WordPress_SEO_By_Yoast {
132
  }
133
  }
134
 
135
- echo $output;
136
  }
137
 
138
  public function clear_ecwid_sitemap_index() {
@@ -160,9 +160,9 @@ class Ecwid_Integration_WordPress_SEO_By_Yoast {
160
  }
161
  }
162
 
163
- echo $xml->asXML();
164
  } else {
165
- echo $output;
166
  }
167
  }
168
 
119
  $output = ob_get_contents();
120
  ob_end_clean();
121
 
122
+ if ( substr_count( $output, '"og:image"' ) >= 1 ) {
123
 
124
  $og_tags = array( '', ':width', ':height', ':type' );
125
  foreach ( $og_tags as $og_tag ) {
132
  }
133
  }
134
 
135
+ echo $output; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
136
  }
137
 
138
  public function clear_ecwid_sitemap_index() {
160
  }
161
  }
162
 
163
+ echo $xml->asXML(); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
164
  } else {
165
+ echo $output; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
166
  }
167
  }
168
 
includes/kliken.php CHANGED
@@ -1,27 +1,28 @@
1
  <?php
2
 
3
- $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT'])) : '';
4
 
5
  if ( strpos( $user_agent, 'Google-Site-Verification' ) ) {
6
-
7
  add_action( 'wp_head', 'ecwid_add_kliken_code' );
8
-
9
  function ecwid_add_kliken_code() {
10
  $api = new Ecwid_Api_V3();
11
-
12
  $info = $api->get_starter_site_info();
13
-
14
- if ( !$info || !isset( $info->customHeaderHtmlCode ) ) return;
15
-
16
- $pattern = "%" .
17
- "(<!--Kliken Google Site Verification Token Tag-->\s*" .
18
- "<meta name='google-site-verification' content='(.*)' />\s*" .
19
- "<!--Kliken Google Site Verification Token Tag-->)%s";
20
-
21
-
 
22
  $matches = array();
23
- if ( preg_match( $pattern, $info->customHeaderHtmlCode, $matches ) ) {
24
- echo $matches[1];
25
  }
26
  }
27
- }
1
  <?php
2
 
3
+ $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : '';
4
 
5
  if ( strpos( $user_agent, 'Google-Site-Verification' ) ) {
6
+
7
  add_action( 'wp_head', 'ecwid_add_kliken_code' );
8
+
9
  function ecwid_add_kliken_code() {
10
  $api = new Ecwid_Api_V3();
11
+
12
  $info = $api->get_starter_site_info();
13
+
14
+ if ( ! $info || ! isset( $info->customHeaderHtmlCode ) ) {//phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
15
+ return;
16
+ }
17
+
18
+ $pattern = '%' .
19
+ '(<!--Kliken Google Site Verification Token Tag-->\s*' .
20
+ "<meta name='google-site-verification' content='(.*)' />\s*" .
21
+ '<!--Kliken Google Site Verification Token Tag-->)%s';
22
+
23
  $matches = array();
24
+ if ( preg_match( $pattern, $info->customHeaderHtmlCode, $matches ) ) {//phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
25
+ echo $matches[1]; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
26
  }
27
  }
28
+ }//end if
includes/oembed.php CHANGED
@@ -1,126 +1,123 @@
1
  <?php
2
 
3
- add_filter('embed_content', 'ecwid_oembed_content', 10, 1);
4
 
5
- function ecwid_oembed_content($data)
6
- {
7
- echo ecwid_get_embed_content();
8
  }
9
 
10
- function ecwid_get_embed_content()
11
- {
12
- $html = '';
13
  $root_category_id = 0;
14
 
15
- $post_content = get_post(get_the_ID())->post_content;
16
- $shortcodes = array();
17
-
18
- foreach (Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name) {
19
- $shortcodes = ecwid_find_shortcodes($post_content, $shortcode_name);
20
- if ($shortcodes) {
21
  break;
22
  }
23
  }
24
-
25
- if (!$shortcodes || !isset($shortcodes[0]) || !isset($shortcodes[0][3])) {
26
  return;
27
  }
28
 
29
  $attributes = $shortcodes[0][3];
30
- if (!preg_match('/default_category_id=.([\\d]*)./', $attributes, $matches)) {
31
  return;
32
  }
33
-
34
- $root_category_id = 0;
35
- if (!is_numeric($matches[1])) {
36
  return;
37
- } else if (isset($matches[1])) {
38
- $root_category_id = $matches[1];
39
  }
40
 
41
  $api = new Ecwid_Api_V3();
42
-
43
- $categories = $api->get_categories(array('parent' => $root_category_id));
44
-
45
  $max_items = 5;
46
 
47
  $items = array();
48
 
49
  $see_more = false;
50
- $result = '';
51
- if (!empty($categories->items)) {
52
- foreach ($categories->items as $category) {
53
- $category = Ecwid_Category::get_by_id( $category->id );
54
- $items[$category->link] = $category->name;
55
- if (count($items) >= $max_items) {
56
  $see_more = true;
57
  break;
58
  }
59
  }
60
  }
61
 
62
- if (ecwid_is_paid_account()) {
63
  $api = new Ecwid_Api_V3();
64
 
65
- $category = $api->get_category($root_category_id);
66
 
67
- if ($category) {
68
- $trimmed = ecwid_trim_description($category->description);
69
- $result .= '<div>' . ecwid_trim_description($category->description);
70
 
71
- $descr_length = function_exists( 'mb_strlen' ) ? mb_strlen( $category->description ) : strlen( $category->description );
72
  $trimmed_length = function_exists( 'mb_strlen' ) ? mb_strlen( $trimmed ) : strlen( $trimmed );
73
-
74
  if ( $trimmed_length < $descr_length && $trimmed_length == ECWID_TRIMMED_DESCRIPTION_LENGTH ) {
75
- $result .= '... <a class="wp-embed-more" href="' . get_permalink() . '">' . __('See more', 'ecwid-shopping-cart') . '</a>';
76
  }
77
  $result .= '</div>';
78
  }
79
 
80
- if (!$see_more) {
81
- $products = $api->search_products(array( 'category' => $root_category_id ));
82
-
83
- if ($products->items) {
84
- foreach ($products->items as $product) {
85
- $product = Ecwid_Product::get_by_id( $product->id );
86
- $items[$product->link] = $product->name;
87
- if (count($items) >= $max_items) {
88
- $see_more = TRUE;
89
  break;
90
  }
91
  }
92
  }
93
  }
94
- }
95
 
96
  $result .= '<ul>';
97
- if ($items) {
98
- foreach ($items as $url => $title) {
99
- $result .= '<li><a href="' . esc_attr($url) . '">' . esc_html($title) . '</a></li>';
100
  }
101
  }
102
 
103
- if ($see_more) {
104
- $result .= '<li><a class="wp-embed-more" href="' . get_permalink() . '">' . __('See more', 'ecwid-shopping-cart') . '</a></li>';
105
  }
106
 
107
  $result .= '</ul>';
108
  return $result;
109
  }
110
 
111
- function _ecwid_find_category_in_horizontal_categories_tree($categories, $root_id) {
112
- foreach($categories as $category) {
113
- if ($category->id == $root_id) {
114
  return $category->sub;
115
  }
116
 
117
- if (!is_null($category->sub)) {
118
- $result = _ecwid_find_category_in_horizontal_categories_tree($category->sub, $root_id);
119
- if ($result !== false) {
120
  return $result;
121
  }
122
  }
123
  }
124
  return false;
125
  }
126
-
1
  <?php
2
 
3
+ add_filter( 'embed_content', 'ecwid_oembed_content', 10, 1 );
4
 
5
+ function ecwid_oembed_content( $data ) {
6
+ echo ecwid_get_embed_content(); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
 
7
  }
8
 
9
+ function ecwid_get_embed_content() {
10
+ $html = '';
 
11
  $root_category_id = 0;
12
 
13
+ $post_content = get_post( get_the_ID() )->post_content;
14
+ $shortcodes = array();
15
+
16
+ foreach ( Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name ) {
17
+ $shortcodes = ecwid_find_shortcodes( $post_content, $shortcode_name );
18
+ if ( $shortcodes ) {
19
  break;
20
  }
21
  }
22
+
23
+ if ( ! $shortcodes || ! isset( $shortcodes[0] ) || ! isset( $shortcodes[0][3] ) ) {
24
  return;
25
  }
26
 
27
  $attributes = $shortcodes[0][3];
28
+ if ( ! preg_match( '/default_category_id=.([\\d]*)./', $attributes, $matches ) ) {
29
  return;
30
  }
31
+
32
+ $root_category_id = 0;
33
+ if ( ! is_numeric( $matches[1] ) ) {
34
  return;
35
+ } elseif ( isset( $matches[1] ) ) {
36
+ $root_category_id = $matches[1];
37
  }
38
 
39
  $api = new Ecwid_Api_V3();
40
+
41
+ $categories = $api->get_categories( array( 'parent' => $root_category_id ) );
42
+
43
  $max_items = 5;
44
 
45
  $items = array();
46
 
47
  $see_more = false;
48
+ $result = '';
49
+ if ( ! empty( $categories->items ) ) {
50
+ foreach ( $categories->items as $category ) {
51
+ $category = Ecwid_Category::get_by_id( $category->id );
52
+ $items[ $category->link ] = $category->name;
53
+ if ( count( $items ) >= $max_items ) {
54
  $see_more = true;
55
  break;
56
  }
57
  }
58
  }
59
 
60
+ if ( ecwid_is_paid_account() ) {
61
  $api = new Ecwid_Api_V3();
62
 
63
+ $category = $api->get_category( $root_category_id );
64
 
65
+ if ( $category ) {
66
+ $trimmed = ecwid_trim_description( $category->description );
67
+ $result .= '<div>' . ecwid_trim_description( $category->description );
68
 
69
+ $descr_length = function_exists( 'mb_strlen' ) ? mb_strlen( $category->description ) : strlen( $category->description );
70
  $trimmed_length = function_exists( 'mb_strlen' ) ? mb_strlen( $trimmed ) : strlen( $trimmed );
71
+
72
  if ( $trimmed_length < $descr_length && $trimmed_length == ECWID_TRIMMED_DESCRIPTION_LENGTH ) {
73
+ $result .= '... <a class="wp-embed-more" href="' . get_permalink() . '">' . __( 'See more', 'ecwid-shopping-cart' ) . '</a>';
74
  }
75
  $result .= '</div>';
76
  }
77
 
78
+ if ( ! $see_more ) {
79
+ $products = $api->search_products( array( 'category' => $root_category_id ) );
80
+
81
+ if ( $products->items ) {
82
+ foreach ( $products->items as $product ) {
83
+ $product = Ecwid_Product::get_by_id( $product->id );
84
+ $items[ $product->link ] = $product->name;
85
+ if ( count( $items ) >= $max_items ) {
86
+ $see_more = true;
87
  break;
88
  }
89
  }
90
  }
91
  }
92
+ }//end if
93
 
94
  $result .= '<ul>';
95
+ if ( $items ) {
96
+ foreach ( $items as $url => $title ) {
97
+ $result .= '<li><a href="' . esc_attr( $url ) . '">' . esc_html( $title ) . '</a></li>';
98
  }
99
  }
100
 
101
+ if ( $see_more ) {
102
+ $result .= '<li><a class="wp-embed-more" href="' . get_permalink() . '">' . __( 'See more', 'ecwid-shopping-cart' ) . '</a></li>';
103
  }
104
 
105
  $result .= '</ul>';
106
  return $result;
107
  }
108
 
109
+ function _ecwid_find_category_in_horizontal_categories_tree( $categories, $root_id ) {
110
+ foreach ( $categories as $category ) {
111
+ if ( $category->id == $root_id ) {
112
  return $category->sub;
113
  }
114
 
115
+ if ( ! is_null( $category->sub ) ) {
116
+ $result = _ecwid_find_category_in_horizontal_categories_tree( $category->sub, $root_id );
117
+ if ( $result !== false ) {
118
  return $result;
119
  }
120
  }
121
  }
122
  return false;
123
  }
 
includes/shortcodes/class-ecwid-shortcode-product.php CHANGED
@@ -16,42 +16,42 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
16
  protected function _process_params( $shortcode_params = array() ) {
17
  $attributes = shortcode_atts(
18
  array(
19
- 'id' => null,
20
- 'display' => 'picture title price options addtobag',
21
- 'link' => 'yes',
22
- 'version' => '1',
23
- 'show_border' => '1',
24
  'show_price_on_button' => '1',
25
- 'center_align' => '1'
26
  ),
27
  $shortcode_params
28
  );
29
 
30
  $id = $attributes['id'];
31
 
32
- if (is_null($id) || !is_numeric($id) || $id <= 0) {
33
  $this->_should_render = false;
34
  return;
35
  }
36
 
37
- if ($attributes['link'] == 'yes' && !ecwid_is_store_page_available()) {
38
  $attributes['link'] = 'no';
39
  }
40
 
41
  $version = $attributes['version'];
42
- if (!in_array($version, array('1', '2'))) {
43
  $attributes['version'] = 1;
44
  }
45
-
46
  $this->_params = $attributes;
47
  }
48
 
49
  public function render_placeholder() {
50
  $widget_parts = array();
51
-
52
- if ($this->_params['version'] == 1) {
53
  $widget_parts = $this->_get_widget_parts_v1();
54
- } else if ($this->_params['version'] == 2) {
55
  $widget_parts = $this->_get_widget_parts_v2();
56
  }
57
 
@@ -59,35 +59,38 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
59
 
60
  $result = $widget_parts['opening_div'];
61
 
62
- $items = preg_split('![^0-9^a-z^A-Z^\-^_]!', $this->_params['display']);
63
 
64
- $product = Ecwid_Product::get_without_loading( $this->_params['id'], (object)array('name' => '') );
65
 
66
- if (is_array($items) && count($items) > 0) foreach ($items as $item) {
67
- if (array_key_exists($item, $display_items)) {
 
68
 
69
- if( $item == 'title' ) {
70
- $display_items[$item] = str_replace('$name', $product->name, $display_items[$item]);
71
- }
72
 
73
- if( $item == 'price' ) {
74
- $display_items[$item] = str_replace('$price', $product->price, $display_items[$item]);
75
- }
76
 
77
- if ($this->_params['link'] == 'yes' && in_array($item, array('title', 'picture'))) {
78
- $product_link = $product->link;
79
- $result .= '<a href="' . esc_url($product_link) . '">' . $display_items[$item] . '</a>';
80
- } else {
81
- $result .= $display_items[$item];
 
82
  }
83
  }
84
- }
85
 
86
  $result .= '</div>';
87
 
88
- $result .= ' '; // APPS-892, otherwise there is no space between consecutive widgets
 
89
 
90
- update_option('ecwid_single_product_used', time());
91
 
92
  return $result;
93
  }
@@ -100,17 +103,22 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
100
  return array(
101
  'display_items' => array(
102
  'picture' => '<div itemprop="picture"></div>',
103
- 'title' => '<div class="ecwid-title" 222 itemprop="title"></div>',
104
  'price' => '<div itemtype="http://schema.org/Offer" itemscope itemprop="offers">'
105
- . '<div class="ecwid-productBrowser-price ecwid-price" itemprop="price"></div>'
106
- . '</div>',
107
  'options' => '<div itemprop="options"></div>',
108
- 'qty' => '<div itemprop="qty"></div>',
109
- 'addtobag' => '<div itemprop="addtobag"></div>'
 
 
 
 
 
 
 
 
110
  ),
111
- 'opening_div' => sprintf('<div class="ecwid ecwid-SingleProduct ecwid-Product ecwid-Product-%d" '
112
- . 'itemscope itemtype="http://schema.org/Product" '
113
- . 'data-single-product-id="%d" id="%s">', $this->_params['id'], $this->_params['id'], $this->get_html_id())
114
  );
115
  }
116
 
@@ -118,24 +126,27 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
118
  $price_location_attributes = ' data-spw-price-location="button"';
119
 
120
  $main_div_classes = array(
121
- 'ecwid',
122
- 'ecwid-SingleProduct-v2',
123
- 'ecwid-Product',
124
- 'ecwid-Product-' . $this->_params['id']
125
- );
126
-
127
- if ($this->_params['show_border'] != 0) { // defaults to 1
128
- $bordered_class = '';
 
129
  $main_div_classes[] = 'ecwid-SingleProduct-v2-bordered';
130
  }
131
 
132
- if ($this->_params['center_align'] == 1) { // defaults to 0
133
- $main_div_classes[] = 'ecwid-SingleProduct-v2-centered';
134
- }
 
135
 
136
- $main_div_class = implode( ' ', $main_div_classes );
137
 
138
- if ($this->_params['show_price_on_button'] == 0) { // defaults to 1
 
139
  $price_location_attributes = '';
140
  }
141
 
@@ -144,28 +155,29 @@ class Ecwid_Shortcode_Product extends Ecwid_Shortcode_Base {
144
  'picture' => '<div itemprop="picture"></div>',
145
  'title' => '<div class="ecwid-title" itemprop="name" content="$name"></div>',
146
  'price' => '<div itemtype="http://schema.org/Offer" itemscope itemprop="offers">'
147
- . '<div class="ecwid-productBrowser-price ecwid-price" itemprop="price"' . $price_location_attributes . ' content="$price">'
148
- . '<div itemprop="priceCurrency"></div>'
149
- . '</div>'
150
- . '</div>',
151
  'options' => '<div customprop="options"></div>',
152
- 'qty' => '<div customprop="qty"></div>',
153
- 'addtobag' => '<div customprop="addtobag"></div>'
 
 
 
 
 
 
154
  ),
155
- 'opening_div' => sprintf('<div class="' . $main_div_class . '" '
156
- . 'itemscope itemtype="http://schema.org/Product" data-single-product-id="%d" id="%s">',
157
- $this->_params['id'],
158
- $this->get_html_id()
159
- )
160
  );
161
  }
162
 
163
 
164
- public function build_params_string($params = null) {
165
- if ( !is_null( $params ) && array_key_exists( 'id', $params ) ) {
166
- unset( $params['id'] );
167
- }
168
 
169
- return parent::build_params_string( $params );
170
- }
171
  }
16
  protected function _process_params( $shortcode_params = array() ) {
17
  $attributes = shortcode_atts(
18
  array(
19
+ 'id' => null,
20
+ 'display' => 'picture title price options addtobag',
21
+ 'link' => 'yes',
22
+ 'version' => '1',
23
+ 'show_border' => '1',
24
  'show_price_on_button' => '1',
25
+ 'center_align' => '1',
26
  ),
27
  $shortcode_params
28
  );
29
 
30
  $id = $attributes['id'];
31
 
32
+ if ( is_null( $id ) || ! is_numeric( $id ) || $id <= 0 ) {
33
  $this->_should_render = false;
34
  return;
35
  }
36
 
37
+ if ( $attributes['link'] == 'yes' && ! ecwid_is_store_page_available() ) {
38
  $attributes['link'] = 'no';
39
  }
40
 
41
  $version = $attributes['version'];
42
+ if ( ! in_array( $version, array( '1', '2' ) ) ) {
43
  $attributes['version'] = 1;
44
  }
45
+
46
  $this->_params = $attributes;
47
  }
48
 
49
  public function render_placeholder() {
50
  $widget_parts = array();
51
+
52
+ if ( $this->_params['version'] == 1 ) {
53
  $widget_parts = $this->_get_widget_parts_v1();
54
+ } elseif ( $this->_params['version'] == 2 ) {
55
  $widget_parts = $this->_get_widget_parts_v2();
56
  }
57
 
59
 
60
  $result = $widget_parts['opening_div'];
61
 
62
+ $items = preg_split( '![^0-9^a-z^A-Z^\-^_]!', $this->_params['display'] );
63
 
64
+ $product = Ecwid_Product::get_without_loading( $this->_params['id'], (object) array( 'name' => '' ) );
65
 
66
+ if ( is_array( $items ) && count( $items ) > 0 ) {
67
+ foreach ( $items as $item ) {
68
+ if ( array_key_exists( $item, $display_items ) ) {
69
 
70
+ if ( $item == 'title' ) {
71
+ $display_items[ $item ] = str_replace( '$name', $product->name, $display_items[ $item ] );
72
+ }
73
 
74
+ if ( $item == 'price' ) {
75
+ $display_items[ $item ] = str_replace( '$price', $product->price, $display_items[ $item ] );
76
+ }
77
 
78
+ if ( $this->_params['link'] == 'yes' && in_array( $item, array( 'title', 'picture' ) ) ) {
79
+ $product_link = $product->link;
80
+ $result .= '<a href="' . esc_url( $product_link ) . '">' . $display_items[ $item ] . '</a>';
81
+ } else {
82
+ $result .= $display_items[ $item ];
83
+ }
84
  }
85
  }
86
+ }//end if
87
 
88
  $result .= '</div>';
89
 
90
+ $result .= ' ';
91
+ // APPS-892, otherwise there is no space between consecutive widgets
92
 
93
+ update_option( 'ecwid_single_product_used', time() );
94
 
95
  return $result;
96
  }
103
  return array(
104
  'display_items' => array(
105
  'picture' => '<div itemprop="picture"></div>',
106
+ 'title' => '<div class="ecwid-title" itemprop="title"></div>',
107
  'price' => '<div itemtype="http://schema.org/Offer" itemscope itemprop="offers">'
108
+ . '<div class="ecwid-productBrowser-price ecwid-price" itemprop="price"></div>'
109
+ . '</div>',
110
  'options' => '<div itemprop="options"></div>',
111
+ 'qty' => '<div itemprop="qty"></div>',
112
+ 'addtobag' => '<div itemprop="addtobag"></div>',
113
+ ),
114
+ 'opening_div' => sprintf(
115
+ '<div class="ecwid ecwid-SingleProduct ecwid-Product ecwid-Product-%d" '
116
+ . 'itemscope itemtype="http://schema.org/Product" '
117
+ . 'data-single-product-id="%d" id="%s">',
118
+ $this->_params['id'],
119
+ $this->_params['id'],
120
+ $this->get_html_id()
121
  ),
 
 
 
122
  );
123
  }
124
 
126
  $price_location_attributes = ' data-spw-price-location="button"';
127
 
128
  $main_div_classes = array(
129
+ 'ecwid',
130
+ 'ecwid-SingleProduct-v2',
131
+ 'ecwid-Product',
132
+ 'ecwid-Product-' . $this->_params['id'],
133
+ );
134
+
135
+ if ( $this->_params['show_border'] != 0 ) {
136
+ // defaults to 1
137
+ $bordered_class = '';
138
  $main_div_classes[] = 'ecwid-SingleProduct-v2-bordered';
139
  }
140
 
141
+ if ( $this->_params['center_align'] == 1 ) {
142
+ // defaults to 0
143
+ $main_div_classes[] = 'ecwid-SingleProduct-v2-centered';
144
+ }
145
 
146
+ $main_div_class = implode( ' ', $main_div_classes );
147
 
148
+ if ( $this->_params['show_price_on_button'] == 0 ) {
149
+ // defaults to 1
150
  $price_location_attributes = '';
151
  }
152
 
155
  'picture' => '<div itemprop="picture"></div>',
156
  'title' => '<div class="ecwid-title" itemprop="name" content="$name"></div>',
157
  'price' => '<div itemtype="http://schema.org/Offer" itemscope itemprop="offers">'
158
+ . '<div class="ecwid-productBrowser-price ecwid-price" itemprop="price"' . $price_location_attributes . ' content="$price">'
159
+ . '<div itemprop="priceCurrency"></div>'
160
+ . '</div>'
161
+ . '</div>',
162
  'options' => '<div customprop="options"></div>',
163
+ 'qty' => '<div customprop="qty"></div>',
164
+ 'addtobag' => '<div customprop="addtobag"></div>',
165
+ ),
166
+ 'opening_div' => sprintf(
167
+ '<div class="' . $main_div_class . '" '
168
+ . 'itemscope itemtype="http://schema.org/Product" data-single-product-id="%d" id="%s">',
169
+ $this->_params['id'],
170
+ $this->get_html_id()
171
  ),
 
 
 
 
 
172
  );
173
  }
174
 
175
 
176
+ public function build_params_string( $params = null ) {
177
+ if ( ! is_null( $params ) && array_key_exists( 'id', $params ) ) {
178
+ unset( $params['id'] );
179
+ }
180
 
181
+ return parent::build_params_string( $params );
182
+ }
183
  }
includes/themes/class-ecwid-theme-divi.php CHANGED
@@ -41,7 +41,7 @@ class Ecwid_Divi extends Ecwid_Theme_Base {
41
  }
42
 
43
  public function add_scriptjs_code() {
44
- echo ecwid_get_scriptjs_code();
45
  }
46
 
47
  public function single_post_title( $post_title, $post ) {
41
  }
42
 
43
  public function add_scriptjs_code() {
44
+ echo ecwid_get_scriptjs_code(); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
45
  }
46
 
47
  public function single_post_title( $post_title, $post ) {
includes/widgets/class-ecwid-widget-base.php CHANGED
@@ -3,44 +3,43 @@
3
  abstract class Ecwid_Widget_Base extends WP_Widget {
4
 
5
  protected $_hide_title = false;
6
-
7
  abstract protected function _render_widget_content( $args, $instance );
8
 
9
  public function widget( $args, $instance ) {
10
-
11
  $before_widget = $before_title = $after_title = $after_widget = '';
12
- extract($args);
13
-
14
  $renderer = apply_filters( 'ecwid_get_custom_widget_renderer', null );
15
-
16
- if ( !is_null( $renderer ) ) {
17
  $content = call_user_func_array( $renderer, array( $this, $args, $instance ) );
18
  } else {
19
  $content = $this->_render_widget_content( $args, $instance );
20
  }
21
-
22
- if ( empty($content ) ) {
23
  return;
24
  }
25
 
26
- echo $before_widget;
27
- if ( !$this->_hide_title ) {
28
-
29
  $title = '&nbsp;';
30
- if ( isset( $instance['title'] ) && !empty( $instance['title'] ) ) {
31
  $title = $instance['title'];
32
- }
33
-
34
  $title = apply_filters( 'widget_title', $title );
35
-
36
-
37
  if ( $title ) {
38
- echo $before_title . $title . $after_title;
39
  }
40
  }
41
-
42
- echo $content;
43
-
44
- echo $after_widget;
45
  }
46
- }
3
  abstract class Ecwid_Widget_Base extends WP_Widget {
4
 
5
  protected $_hide_title = false;
6
+
7
  abstract protected function _render_widget_content( $args, $instance );
8
 
9
  public function widget( $args, $instance ) {
10
+
11
  $before_widget = $before_title = $after_title = $after_widget = '';
12
+ extract( $args );
13
+
14
  $renderer = apply_filters( 'ecwid_get_custom_widget_renderer', null );
15
+
16
+ if ( ! is_null( $renderer ) ) {
17
  $content = call_user_func_array( $renderer, array( $this, $args, $instance ) );
18
  } else {
19
  $content = $this->_render_widget_content( $args, $instance );
20
  }
21
+
22
+ if ( empty( $content ) ) {
23
  return;
24
  }
25
 
26
+ echo $before_widget; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
27
+ if ( ! $this->_hide_title ) {
28
+
29
  $title = '&nbsp;';
30
+ if ( isset( $instance['title'] ) && ! empty( $instance['title'] ) ) {
31
  $title = $instance['title'];
32
+ }
33
+
34
  $title = apply_filters( 'widget_title', $title );
35
+
 
36
  if ( $title ) {
37
+ echo $before_title . $title . $after_title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
38
  }
39
  }
40
+
41
+ echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
42
+
43
+ echo $after_widget; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
44
  }
45
+ }
includes/widgets/class-ecwid-widget-minicart-miniview.php CHANGED
@@ -5,8 +5,11 @@ require_once ECWID_PLUGIN_DIR . '/includes/widgets/class-ecwid-widget-base.php';
5
  class Ecwid_Widget_Minicart_Miniview extends Ecwid_Widget_Base {
6
 
7
  function __construct() {
8
- $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') );
9
- parent::__construct('ecwidminicart_miniview', __('Shopping Cart Mini (deprecated)', 'ecwid-shopping-cart'), $widget_ops);
 
 
 
10
  }
11
 
12
  function _render_widget_content( $args, $instance ) {
@@ -26,19 +29,19 @@ class Ecwid_Widget_Minicart_Miniview extends Ecwid_Widget_Base {
26
  return $html;
27
  }
28
 
29
- function update($new_instance, $old_instance){
30
- $instance = $old_instance;
31
- $instance['title'] = strip_tags(stripslashes($new_instance['title']));
32
 
33
  return $instance;
34
  }
35
 
36
- function form($instance){
37
- $instance = wp_parse_args( (array) $instance, array('title'=>'') );
38
 
39
- $title = htmlspecialchars($instance['title']);
40
 
41
- echo '<p><label for="' . $this->get_field_name('title') . '">' . __('Title:') . ' <input style="width:100%;" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . $title . '" /></label></p>';
42
  }
43
 
44
  }
5
  class Ecwid_Widget_Minicart_Miniview extends Ecwid_Widget_Base {
6
 
7
  function __construct() {
8
+ $widget_ops = array(
9
+ 'classname' => 'widget_ecwid_minicart_miniview',
10
+ 'description' => __( 'Adds a compact cart widget for customer to see the products they added to the cart.', 'ecwid-shopping-cart' ),
11
+ );
12
+ parent::__construct( 'ecwidminicart_miniview', __( 'Shopping Cart Mini (deprecated)', 'ecwid-shopping-cart' ), $widget_ops );
13
  }
14
 
15
  function _render_widget_content( $args, $instance ) {
29
  return $html;
30
  }
31
 
32
+ function update( $new_instance, $old_instance ) {
33
+ $instance = $old_instance;
34
+ $instance['title'] = strip_tags( stripslashes( $new_instance['title'] ) );
35
 
36
  return $instance;
37
  }
38
 
39
+ function form( $instance ) {
40
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
41
 
42
+ $title = htmlspecialchars( $instance['title'] );
43
 
44
+ echo '<p><label for="' . esc_attr( $this->get_field_name( 'title' ) ) . '">' . esc_attr__( 'Title:' ) . ' <input style="width:100%;" id="' . esc_attr( $this->get_field_id( 'title' ) ) . '" name="' . esc_attr( $this->get_field_name( 'title' ) ) . '" type="text" value="' . esc_attr( $title ) . '" /></label></p>';
45
  }
46
 
47
  }
includes/widgets/class-ecwid-widget-minicart.php CHANGED
@@ -5,8 +5,11 @@ require_once ECWID_PLUGIN_DIR . '/includes/widgets/class-ecwid-widget-base.php';
5
  class Ecwid_Widget_Minicart extends Ecwid_Widget_Base {
6
 
7
  function __construct() {
8
- $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') );
9
- parent::__construct('ecwidminicart', __('Shopping Cart (deprecated)', 'ecwid-shopping-cart'), $widget_ops);
 
 
 
10
 
11
  }
12
 
@@ -26,19 +29,19 @@ class Ecwid_Widget_Minicart extends Ecwid_Widget_Base {
26
  return $html;
27
  }
28
 
29
- function update($new_instance, $old_instance){
30
- $instance = $old_instance;
31
- $instance['title'] = strip_tags(stripslashes($new_instance['title']));
32
 
33
  return $instance;
34
  }
35
 
36
- function form($instance){
37
- $instance = wp_parse_args( (array) $instance, array('title'=>'') );
38
 
39
- $title = htmlspecialchars($instance['title']);
40
 
41
- echo '<p><label for="' . $this->get_field_name('title') . '">' . __('Title:') . ' <input style="width:100%;" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . $title . '" /></label></p>';
42
  }
43
 
44
  }
5
  class Ecwid_Widget_Minicart extends Ecwid_Widget_Base {
6
 
7
  function __construct() {
8
+ $widget_ops = array(
9
+ 'classname' => 'widget_ecwid_minicart',
10
+ 'description' => __( 'Adds a cart widget for customer to see the products they added to the cart.', 'ecwid-shopping-cart' ),
11
+ );
12
+ parent::__construct( 'ecwidminicart', __( 'Shopping Cart (deprecated)', 'ecwid-shopping-cart' ), $widget_ops );
13
 
14
  }
15
 
29
  return $html;
30
  }
31
 
32
+ function update( $new_instance, $old_instance ) {
33
+ $instance = $old_instance;
34
+ $instance['title'] = strip_tags( stripslashes( $new_instance['title'] ) );
35
 
36
  return $instance;
37
  }
38
 
39
+ function form( $instance ) {
40
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
41
 
42
+ $title = htmlspecialchars( $instance['title'] );
43
 
44
+ echo '<p><label for="' . esc_attr( $this->get_field_name( 'title' ) ) . '">' . esc_attr__( 'Title:' ) . ' <input style="width:100%;" id="' . esc_attr( $this->get_field_id( 'title' ) ) . '" name="' . esc_attr( $this->get_field_name( 'title' ) ) . '" type="text" value="' . esc_attr( $title ) . '" /></label></p>';
45
  }
46
 
47
  }
includes/widgets/class-ecwid-widget-nsf-minicart.php CHANGED
@@ -4,68 +4,80 @@ require_once ECWID_PLUGIN_DIR . '/includes/widgets/class-ecwid-widget-base.php';
4
 
5
  // nsf stands for new storefront I guess
6
  class Ecwid_Widget_NSF_Minicart extends Ecwid_Widget_Base {
7
-
8
  protected $__idbase;
9
 
10
- const FIELD_TITLE = 'title';
11
- const FIELD_LAYOUT = 'layout';
12
- const FIELD_ICON = 'icon';
13
  const FIELD_FIXED_SHAPE = 'fixed-shape';
14
-
15
  function __construct() {
16
-
17
  $this->__idbase = 'ecwidnsfminicart';
18
-
19
- $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') );
20
- parent::__construct($this->__idbase, __('Shopping Cart', 'ecwid-shopping-cart'), $widget_ops);
 
 
 
21
 
22
  }
23
 
24
  function _render_widget_content( $args, $instance ) {
25
- extract($args);
26
-
27
- $instance = wp_parse_args( (array) $instance, array(
28
- self::FIELD_TITLE => '',
29
- self::FIELD_LAYOUT => 'BIG_ICON_TITLE_SUBTOTAL',
30
- self::FIELD_ICON => 'BAG',
31
- self::FIELD_FIXED_SHAPE => 'RECT'
32
- ) );
33
-
34
- $html = '';
 
 
 
35
  $html .= '<div>';
36
 
37
  ob_start();
38
  require 'nsf-minicart.tpl.php';
39
  $html .= ob_get_contents();
40
  ob_end_clean();
41
-
42
  $html .= '</div>';
43
 
44
  return $html;
45
  }
46
 
47
- function update($new_instance, $old_instance) {
48
-
49
- $new_instance = wp_parse_args( (array) $new_instance, array(
50
- self::FIELD_TITLE => '',
51
- self::FIELD_LAYOUT => 'BIG_ICON_TITLE_SUBTOTAL',
52
- self::FIELD_ICON => 'BAG',
53
- self::FIELD_FIXED_SHAPE => 'RECT',
54
- ) );
55
-
 
 
 
56
  $new_instance['title'] = strip_tags( stripslashes( $new_instance['title'] ) );
57
-
58
  return $new_instance;
59
  }
60
 
61
  function form( $instance ) {
62
- $instance = wp_parse_args( (array) $instance, array(
63
- self::FIELD_TITLE => '',
64
- self::FIELD_LAYOUT => 'BIG_ICON_TITLE_SUBTOTAL',
65
- self::FIELD_ICON => 'BAG',
66
- self::FIELD_FIXED_SHAPE => 'RECT'
67
- ) );
68
-
 
 
 
69
  require 'nsf-minicart-editor.tpl.php';
70
  }
71
  }
4
 
5
  // nsf stands for new storefront I guess
6
  class Ecwid_Widget_NSF_Minicart extends Ecwid_Widget_Base {
7
+
8
  protected $__idbase;
9
 
10
+ const FIELD_TITLE = 'title';
11
+ const FIELD_LAYOUT = 'layout';
12
+ const FIELD_ICON = 'icon';
13
  const FIELD_FIXED_SHAPE = 'fixed-shape';
14
+
15
  function __construct() {
16
+
17
  $this->__idbase = 'ecwidnsfminicart';
18
+
19
+ $widget_ops = array(
20
+ 'classname' => 'widget_' . $this->__idbase,
21
+ 'description' => __( 'Adds a cart widget for customer to see the products they added to the cart.', 'ecwid-shopping-cart' ),
22
+ );
23
+ parent::__construct( $this->__idbase, __( 'Shopping Cart', 'ecwid-shopping-cart' ), $widget_ops );
24
 
25
  }
26
 
27
  function _render_widget_content( $args, $instance ) {
28
+ extract( $args );
29
+
30
+ $instance = wp_parse_args(
31
+ (array) $instance,
32
+ array(
33
+ self::FIELD_TITLE => '',
34
+ self::FIELD_LAYOUT => 'BIG_ICON_TITLE_SUBTOTAL',
35
+ self::FIELD_ICON => 'BAG',
36
+ self::FIELD_FIXED_SHAPE => 'RECT',
37
+ )
38
+ );
39
+
40
+ $html = '';
41
  $html .= '<div>';
42
 
43
  ob_start();
44
  require 'nsf-minicart.tpl.php';
45
  $html .= ob_get_contents();
46
  ob_end_clean();
47
+
48
  $html .= '</div>';
49
 
50
  return $html;
51
  }
52
 
53
+ function update( $new_instance, $old_instance ) {
54
+
55
+ $new_instance = wp_parse_args(
56
+ (array) $new_instance,
57
+ array(
58
+ self::FIELD_TITLE => '',
59
+ self::FIELD_LAYOUT => 'BIG_ICON_TITLE_SUBTOTAL',
60
+ self::FIELD_ICON => 'BAG',
61
+ self::FIELD_FIXED_SHAPE => 'RECT',
62
+ )
63
+ );
64
+
65
  $new_instance['title'] = strip_tags( stripslashes( $new_instance['title'] ) );
66
+
67
  return $new_instance;
68
  }
69
 
70
  function form( $instance ) {
71
+ $instance = wp_parse_args(
72
+ (array) $instance,
73
+ array(
74
+ self::FIELD_TITLE => '',
75
+ self::FIELD_LAYOUT => 'BIG_ICON_TITLE_SUBTOTAL',
76
+ self::FIELD_ICON => 'BAG',
77
+ self::FIELD_FIXED_SHAPE => 'RECT',
78
+ )
79
+ );
80
+
81
  require 'nsf-minicart-editor.tpl.php';
82
  }
83
  }
includes/widgets/class-ecwid-widget-products-base.php CHANGED
@@ -167,19 +167,15 @@ abstract class Ecwid_Widget_Products_List_Base extends Ecwid_Widget_Base {
167
  } else {
168
  $value = htmlspecialchars( $instance[ $field['name'] ] );
169
  }
170
-
171
- $template = '<p><label for="%s">%s:<input style="%s" id="%s" name="%s" type="text" value="%s" /></label></p>';
172
-
173
- printf(
174
- $template,
175
- esc_attr( $this->get_field_name( $field['name'] ) ),
176
- esc_html( $field['title'] ),
177
- 'width:100%',
178
- esc_attr( $this->get_field_id( $field['name'] ) ),
179
- esc_attr( $this->get_field_name( $field['name'] ) ),
180
- esc_attr( $value )
181
- );
182
- }
183
  }
184
 
185
  protected function _get_valid_number_of_products( $num ) {
@@ -193,20 +189,20 @@ abstract class Ecwid_Widget_Products_List_Base extends Ecwid_Widget_Base {
193
  }
194
 
195
  protected function _get_form_fields() {
196
- return array(
197
- array(
198
- 'name' => 'title',
199
- 'title' => __( 'Title' ),
200
- 'type' => 'text',
201
- 'default' => $this->_title,
202
- ),
203
- array(
204
- 'name' => 'number_of_products',
205
- 'title' => __( 'Number of products to show', 'ecwid-shopping-cart' ),
206
- 'type' => 'int',
207
- 'default' => 3,
208
- ),
209
- );
210
  }
211
 
212
  }
167
  } else {
168
  $value = htmlspecialchars( $instance[ $field['name'] ] );
169
  }
170
+ ?>
171
+ <p>
172
+ <label for="<?php echo esc_attr( $this->get_field_name( $field['name'] ) ); ?>">
173
+ <?php echo esc_html( $field['title'] ); ?>:
174
+ <input style="width:100%" id="<?php echo esc_attr( $this->get_field_name( $field['name'] ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( $field['name'] ) ); ?>" type="text" value="<?php echo esc_attr( $value ); ?>" />
175
+ </label>
176
+ </p>
177
+ <?php
178
+ }//end foreach
 
 
 
 
179
  }
180
 
181
  protected function _get_valid_number_of_products( $num ) {
189
  }
190
 
191
  protected function _get_form_fields() {
192
+ return array(
193
+ array(
194
+ 'name' => 'title',
195
+ 'title' => __( 'Title' ),
196
+ 'type' => 'text',
197
+ 'default' => $this->_title,
198
+ ),
199
+ array(
200
+ 'name' => 'number_of_products',
201
+ 'title' => __( 'Number of products to show', 'ecwid-shopping-cart' ),
202
+ 'type' => 'int',
203
+ 'default' => 3,
204
+ ),
205
+ );
206
  }
207
 
208
  }
includes/widgets/class-ecwid-widget-search.php CHANGED
@@ -4,25 +4,28 @@ require_once ECWID_PLUGIN_DIR . '/includes/widgets/class-ecwid-widget-base.php';
4
 
5
  class Ecwid_Widget_Search extends Ecwid_Widget_Base {
6
 
7
- static public function is_active_widget() {
8
- return is_active_widget(false, false, 'ecwidsearch');
9
  }
10
 
11
  function __construct() {
12
- $widget_ops = array('classname' => 'widget_ecwid_search', 'description' => __("Displays a simple search box for your customers to find a product in your store", 'ecwid-shopping-cart'));
13
- parent::__construct('ecwidsearch', __('Product Search', 'ecwid-shopping-cart'), $widget_ops);
 
 
 
14
  }
15
 
16
  function _render_widget_content( $args, $instance ) {
17
-
18
- $html = '';
19
  $html .= '<div>';
20
  $html .= '<!-- noptimize -->';
21
 
22
  $html .= ecwid_get_scriptjs_code();
23
  $html .= ecwid_get_product_browser_url_script();
24
 
25
- $code = ecwid_get_search_js_code();
26
  $html .= '<script data-cfasync="false" type="text/javascript"> ' . $code . ' </script>';
27
 
28
  $html .= '<!-- /noptimize -->';
@@ -31,19 +34,19 @@ class Ecwid_Widget_Search extends Ecwid_Widget_Base {
31
  return $html;
32
  }
33
 
34
- function update($new_instance, $old_instance){
35
- $instance = $old_instance;
36
- $instance['title'] = strip_tags(stripslashes($new_instance['title']));
37
 
38
  return $instance;
39
  }
40
 
41
- function form($instance){
42
- $instance = wp_parse_args( (array) $instance, array('title'=>'') );
43
 
44
- $title = htmlspecialchars($instance['title']);
45
 
46
- echo '<p><label for="' . $this->get_field_name('title') . '">' . __('Title:') . ' <input style="width:100%;" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . $title . '" /></label></p>';
47
  }
48
 
49
  }
4
 
5
  class Ecwid_Widget_Search extends Ecwid_Widget_Base {
6
 
7
+ public static function is_active_widget() {
8
+ return is_active_widget( false, false, 'ecwidsearch' );
9
  }
10
 
11
  function __construct() {
12
+ $widget_ops = array(
13
+ 'classname' => 'widget_ecwid_search',
14
+ 'description' => __( 'Displays a simple search box for your customers to find a product in your store', 'ecwid-shopping-cart' ),
15
+ );
16
+ parent::__construct( 'ecwidsearch', __( 'Product Search', 'ecwid-shopping-cart' ), $widget_ops );
17
  }
18
 
19
  function _render_widget_content( $args, $instance ) {
20
+
21
+ $html = '';
22
  $html .= '<div>';
23
  $html .= '<!-- noptimize -->';
24
 
25
  $html .= ecwid_get_scriptjs_code();
26
  $html .= ecwid_get_product_browser_url_script();
27
 
28
+ $code = ecwid_get_search_js_code();
29
  $html .= '<script data-cfasync="false" type="text/javascript"> ' . $code . ' </script>';
30
 
31
  $html .= '<!-- /noptimize -->';
34
  return $html;
35
  }
36
 
37
+ function update( $new_instance, $old_instance ) {
38
+ $instance = $old_instance;
39
+ $instance['title'] = strip_tags( stripslashes( $new_instance['title'] ) );
40
 
41
  return $instance;
42
  }
43
 
44
+ function form( $instance ) {
45
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
46
 
47
+ $title = htmlspecialchars( $instance['title'] );
48
 
49
+ echo '<p><label for="' . esc_attr( $this->get_field_name( 'title' ) ) . '">' . esc_attr__( 'Title:' ) . ' <input style="width:100%;" id="' . esc_attr( $this->get_field_id( 'title' ) ) . '" name="' . esc_attr( $this->get_field_name( 'title' ) ) . '" type="text" value="' . esc_attr( $title ) . '" /></label></p>';
50
  }
51
 
52
  }
includes/widgets/class-ecwid-widget-store-link.php CHANGED
@@ -6,12 +6,15 @@ class Ecwid_Widget_Store_Link extends Ecwid_Widget_Base {
6
 
7
  function __construct() {
8
  $this->_hide_title = true;
9
- $widget_ops = array('classname' => 'widget_ecwid_store_link', 'description' => __('Displays a link to the store page in sidebar for customer to quickly access your store from any page on the site.', 'ecwid-shopping-cart'));
10
- parent::__construct('ecwidstorelink', __('Store Page Link', 'ecwid-shopping-cart'), $widget_ops);
 
 
 
11
  }
12
 
13
  function _render_widget_content( $args, $instance ) {
14
-
15
  $html = '<div>';
16
 
17
  $html .= '<a href="' . Ecwid_Store_Page::get_store_url() . '" data-ecwid-page="/">' . $instance['label'] . '</a>';
@@ -20,19 +23,19 @@ class Ecwid_Widget_Store_Link extends Ecwid_Widget_Base {
20
  return $html;
21
  }
22
 
23
- function update($new_instance, $old_instance){
24
- $instance = $old_instance;
25
- $instance['label'] = strip_tags(stripslashes($new_instance['label']));
26
 
27
  return $instance;
28
  }
29
 
30
- function form($instance){
31
- $instance = wp_parse_args( (array) $instance, array( 'label' => __('Shop', 'ecwid-shopping-cart') ) );
32
 
33
- $label = htmlspecialchars($instance['label']);
34
 
35
- echo '<p><label for="' . $this->get_field_name('label') . '">' . __('Text') . ': <input style="width:100%;" id="' . $this->get_field_id('label') . '" name="' . $this->get_field_name('label') . '" type="text" value="' . $label . '" /></label></p>';
36
  }
37
 
38
- }
6
 
7
  function __construct() {
8
  $this->_hide_title = true;
9
+ $widget_ops = array(
10
+ 'classname' => 'widget_ecwid_store_link',
11
+ 'description' => __( 'Displays a link to the store page in sidebar for customer to quickly access your store from any page on the site.', 'ecwid-shopping-cart' ),
12
+ );
13
+ parent::__construct( 'ecwidstorelink', __( 'Store Page Link', 'ecwid-shopping-cart' ), $widget_ops );
14
  }
15
 
16
  function _render_widget_content( $args, $instance ) {
17
+
18
  $html = '<div>';
19
 
20
  $html .= '<a href="' . Ecwid_Store_Page::get_store_url() . '" data-ecwid-page="/">' . $instance['label'] . '</a>';
23
  return $html;
24
  }
25
 
26
+ function update( $new_instance, $old_instance ) {
27
+ $instance = $old_instance;
28
+ $instance['label'] = strip_tags( stripslashes( $new_instance['label'] ) );
29
 
30
  return $instance;
31
  }
32
 
33
+ function form( $instance ) {
34
+ $instance = wp_parse_args( (array) $instance, array( 'label' => __( 'Shop', 'ecwid-shopping-cart' ) ) );
35
 
36
+ $label = htmlspecialchars( $instance['label'] );
37
 
38
+ echo '<p><label for="' . esc_attr( $this->get_field_name( 'label' ) ) . '">' . esc_attr__( 'Text' ) . ': <input style="width:100%;" id="' . esc_attr( $this->get_field_id( 'label' ) ) . '" name="' . esc_attr( $this->get_field_name( 'label' ) ) . '" type="text" value="' . esc_attr( $label ) . '" /></label></p>';
39
  }
40
 
41
+ }
includes/widgets/class-ecwid-widget-vcategories.php CHANGED
@@ -5,13 +5,16 @@ require_once ECWID_PLUGIN_DIR . '/includes/widgets/class-ecwid-widget-base.php';
5
  class Ecwid_Widget_VCategories extends Ecwid_Widget_Base {
6
 
7
  function __construct() {
8
- $widget_ops = array('classname' => 'widget_ecwid_vcategories', 'description' => __('Adds vertical categories block to let the customer navigate your store.', 'ecwid-shopping-cart'));
9
- parent::__construct('ecwidvcategories', __('Store Categories', 'ecwid-shopping-cart'), $widget_ops);
 
 
 
10
  }
11
 
12
  function _render_widget_content( $args, $instance ) {
13
-
14
- $html = '<div>';
15
  $html .= '<!-- noptimize -->';
16
 
17
  $html .= ecwid_get_scriptjs_code();
@@ -24,19 +27,19 @@ class Ecwid_Widget_VCategories extends Ecwid_Widget_Base {
24
  return $html;
25
  }
26
 
27
- function update($new_instance, $old_instance){
28
- $instance = $old_instance;
29
- $instance['title'] = strip_tags(stripslashes($new_instance['title']));
30
 
31
  return $instance;
32
  }
33
 
34
- function form($instance){
35
- $instance = wp_parse_args( (array) $instance, array('title'=>'') );
36
 
37
- $title = htmlspecialchars($instance['title']);
38
 
39
- echo '<p><label for="' . $this->get_field_name('title') . '">' . __('Title:') . ' <input style="width:100%;" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . $title . '" /></label></p>';
40
  }
41
 
42
  }
5
  class Ecwid_Widget_VCategories extends Ecwid_Widget_Base {
6
 
7
  function __construct() {
8
+ $widget_ops = array(
9
+ 'classname' => 'widget_ecwid_vcategories',
10
+ 'description' => __( 'Adds vertical categories block to let the customer navigate your store.', 'ecwid-shopping-cart' ),
11
+ );
12
+ parent::__construct( 'ecwidvcategories', __( 'Store Categories', 'ecwid-shopping-cart' ), $widget_ops );
13
  }
14
 
15
  function _render_widget_content( $args, $instance ) {
16
+
17
+ $html = '<div>';
18
  $html .= '<!-- noptimize -->';
19
 
20
  $html .= ecwid_get_scriptjs_code();
27
  return $html;
28
  }
29
 
30
+ function update( $new_instance, $old_instance ) {
31
+ $instance = $old_instance;
32
+ $instance['title'] = strip_tags( stripslashes( $new_instance['title'] ) );
33
 
34
  return $instance;
35
  }
36
 
37
+ function form( $instance ) {
38
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
39
 
40
+ $title = htmlspecialchars( $instance['title'] );
41
 
42
+ echo '<p><label for="' . esc_attr( $this->get_field_name( 'title' ) ) . '">' . esc_attr__( 'Title:' ) . ' <input style="width:100%;" id="' . esc_attr( $this->get_field_id( 'title' ) ) . '" name="' . esc_attr( $this->get_field_name( 'title' ) ) . '" type="text" value="' . esc_attr( $title ) . '" /></label></p>';
43
  }
44
 
45
  }
includes/widgets/class-ecwid-widget-vertical-categories-list.php CHANGED
@@ -11,35 +11,40 @@ class Ecwid_Widget_Vertical_Categories_List extends Ecwid_Widget_Base {
11
  * @access public
12
  */
13
  public function __construct() {
14
- $widget_ops = array('classname' => 'widget_ecwid_vcategories_list', 'description' => __( 'Adds root categories list to the sidebar to let your customers navigate the store.', 'ecwid-shopping-cart' ) );
15
- parent::__construct( 'ecwidvcategorieslist', __('Store Root Categories', 'ecwid-shopping-cart' ), $widget_ops);
 
 
 
16
  }
17
 
18
  public function _render_widget_content( $args, $instance ) {
19
 
20
- $api = new Ecwid_Api_V3();
21
-
22
- $result = $api->get_categories(array( 'parent' => 0 ) );
23
 
24
- if ( !$result || empty( $result->items ) ) return "";
 
 
 
 
25
 
26
  $categories = $result->items;
27
  usort( $categories, Ecwid_Category::usort_callback() );
28
-
29
  $html = '<ul>';
30
-
31
- foreach ($categories as $category) {
32
- $category = Ecwid_Category::get_by_id( $category->id );
33
- $html .= '<li>';
34
- $html .= '<a href="' . $category->link
35
- . '" data-ecwid-page="category" data-ecwid-category-id="' . $category->id . '">'
36
- . $category->name
37
- . '</a>';
38
- $html .= '</li>';
39
  }
40
 
41
  $html .= '</ul>';
42
-
43
  return $html;
44
  }
45
 
@@ -55,7 +60,7 @@ class Ecwid_Widget_Vertical_Categories_List extends Ecwid_Widget_Base {
55
  * @return array Updated settings to save.
56
  */
57
  public function update( $new_instance, $old_instance ) {
58
- $instance = $old_instance;
59
  $instance['title'] = sanitize_text_field( $new_instance['title'] );
60
 
61
  return $instance;
@@ -71,9 +76,9 @@ class Ecwid_Widget_Vertical_Categories_List extends Ecwid_Widget_Base {
71
  */
72
  public function form( $instance ) {
73
  $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Browse by Category', 'ecwid-shopping-cart' ) ) );
74
- $title = sanitize_text_field( $instance['title'] );
75
  ?>
76
- <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
77
  <div class="ecwid-reset-categories-cache-block"></div>
78
  <?php
79
  }
11
  * @access public
12
  */
13
  public function __construct() {
14
+ $widget_ops = array(
15
+ 'classname' => 'widget_ecwid_vcategories_list',
16
+ 'description' => __( 'Adds root categories list to the sidebar to let your customers navigate the store.', 'ecwid-shopping-cart' ),
17
+ );
18
+ parent::__construct( 'ecwidvcategorieslist', __( 'Store Root Categories', 'ecwid-shopping-cart' ), $widget_ops );
19
  }
20
 
21
  public function _render_widget_content( $args, $instance ) {
22
 
23
+ $api = new Ecwid_Api_V3();
 
 
24
 
25
+ $result = $api->get_categories( array( 'parent' => 0 ) );
26
+
27
+ if ( ! $result || empty( $result->items ) ) {
28
+ return '';
29
+ }
30
 
31
  $categories = $result->items;
32
  usort( $categories, Ecwid_Category::usort_callback() );
33
+
34
  $html = '<ul>';
35
+
36
+ foreach ( $categories as $category ) {
37
+ $category = Ecwid_Category::get_by_id( $category->id );
38
+ $html .= '<li>';
39
+ $html .= '<a href="' . $category->link
40
+ . '" data-ecwid-page="category" data-ecwid-category-id="' . $category->id . '">'
41
+ . $category->name
42
+ . '</a>';
43
+ $html .= '</li>';
44
  }
45
 
46
  $html .= '</ul>';
47
+
48
  return $html;
49
  }
50
 
60
  * @return array Updated settings to save.
61
  */
62
  public function update( $new_instance, $old_instance ) {
63
+ $instance = $old_instance;
64
  $instance['title'] = sanitize_text_field( $new_instance['title'] );
65
 
66
  return $instance;
76
  */
77
  public function form( $instance ) {
78
  $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Browse by Category', 'ecwid-shopping-cart' ) ) );
79
+ $title = sanitize_text_field( $instance['title'] );
80
  ?>
81
+ <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:' ); ?></label> <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
82
  <div class="ecwid-reset-categories-cache-block"></div>
83
  <?php
84
  }
includes/widgets/nsf-minicart-editor.tpl.php CHANGED
@@ -1,57 +1,65 @@
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( Ecwid_Floating_Minicart::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( Ecwid_Floating_Minicart::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( Ecwid_Floating_Minicart::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>
1
  <p>
2
+ <label>
3
+ <?php esc_html_e( 'Layout:', 'ecwid-shopping-cart' ); ?>
4
+ <select class="widefat"
5
+ name="<?php echo esc_attr( $this->get_field_name( self::FIELD_LAYOUT ) ); ?>"
6
+ id="<?php echo esc_attr( $this->get_field_id( self::FIELD_LAYOUT ) ); ?>"
7
+ >
8
+ <?php foreach ( Ecwid_Floating_Minicart::get_layouts() as $value => $label ) : ?>
9
+ <option value="<?php echo esc_attr( $value ); ?>"
10
+ <?php if ( $instance[ self::FIELD_LAYOUT ] == $value ) : ?>
11
+ selected="selected"
12
+ <?php endif; ?>
13
+ >
14
+ <?php echo esc_html( $label ); ?>
15
+ </option>
16
+ <?php endforeach; ?>
17
+ </select>
18
+ </label>
19
  </p>
20
 
21
  <p>
22
+ <label>
23
+ <?php esc_html_e( 'Cart icon:', 'ecwid-shopping-cart' ); ?>
24
+ <select class="widefat"
25
+ name="<?php echo esc_attr( $this->get_field_name( self::FIELD_ICON ) ); ?>"
26
+ id="<?php echo esc_attr( $this->get_field_id( self::FIELD_ICON ) ); ?>"
27
+ >
28
+ <?php foreach ( Ecwid_Floating_Minicart::get_icons() as $value => $label ) : ?>
29
+ <option value="<?php echo esc_attr( $value ); ?>"
30
+ <?php if ( $instance[ self::FIELD_ICON ] == $value ) : ?>
31
+ selected="selected"<?php endif; ?>>
32
+ <?php echo esc_html( $label ); ?>
33
+ </option>
34
+ <?php endforeach; ?>
35
+ </select>
36
+ </label>
37
  </p>
38
 
39
  <p>
40
+ <label>
41
+ <?php esc_html_e( 'Border:', 'ecwid-shopping-cart' ); ?>
42
+ <select class="widefat"
43
+ name="<?php echo esc_attr( $this->get_field_name( self::FIELD_FIXED_SHAPE ) ); ?>"
44
+ id="<?php echo esc_attr( $this->get_field_id( self::FIELD_FIXED_SHAPE ) ); ?>"
45
+ >
46
+ <?php foreach ( Ecwid_Floating_Minicart::get_fixed_shapes() as $value => $label ) : ?>
47
+ <option value="<?php echo esc_attr( $value ); ?>"
48
+ <?php if ( $instance[ self::FIELD_FIXED_SHAPE ] == $value ) : ?>
49
+ selected="selected"<?php endif; ?>>
50
+ <?php echo esc_html( $label ); ?>
51
+ </option>
52
+ <?php endforeach; ?>
53
+ </select>
54
+ </label>
55
  </p>
56
 
57
  <p>
58
+ <label for="<?php echo esc_attr( $this->get_field_name( self::FIELD_TITLE ) ); ?>"><?php esc_html_e( 'Title:' ); ?>
59
+ <input class="widefat"
60
+ id="<?php echo esc_attr( $this->get_field_id( self::FIELD_TITLE ) ); ?>"
61
+ name="<?php echo esc_attr( $this->get_field_name( self::FIELD_TITLE ) ); ?>"
62
+ type="text" value="<?php esc_html( $instance['title'] ); ?>"
63
+ />
64
+ </label>
65
+ </p>
includes/widgets/nsf-minicart.tpl.php CHANGED
@@ -1,15 +1,15 @@
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>
@@ -17,4 +17,4 @@ if (typeof Ecwid != 'undefined') {
17
  Ecwid.init();
18
  }
19
  </script>
20
- <!-- /noptimize -->
1
  <!-- noptimize -->
2
  <?php
3
 
4
+ echo ecwid_get_scriptjs_code(); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
5
+ echo ecwid_get_product_browser_url_script(); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
6
  ?>
7
 
8
  <div class='ec-cart-widget'
9
+ data-fixed='false'
10
+ data-fixed-shape='<?php echo esc_attr( $instance[ self::FIELD_FIXED_SHAPE ] ); ?>'
11
+ data-layout='<?php echo esc_attr( $instance[ self::FIELD_LAYOUT ] ); ?>'
12
+ data-icon='<?php echo esc_attr( $instance[ self::FIELD_ICON ] ); ?>'
13
  ></div>
14
 
15
  <script>
17
  Ecwid.init();
18
  }
19
  </script>
20
+ <!-- /noptimize -->
js/admin-storefront.js CHANGED
@@ -1,166 +1,166 @@
1
- jQuery(document).ready(function(){
2
-
3
- jQuery(document).on( 'click', '[data-storefront-status]', function(){
4
- var el = jQuery(this),
5
- new_status = el.data('storefrontStatus');
6
-
7
- ecwid_toggle_loading_status( el );
8
-
9
- var data = {
10
- action: 'ecwid_storefront_set_status',
11
- status: new_status
12
- };
13
-
14
- jQuery.getJSON(
15
- 'admin-ajax.php',
16
- data,
17
- function(data) {
18
- ecwid_update_storepage_link( data.storepage );
19
- ecwid_set_storefront_state( data.storepage.status );
20
- ecwid_toggle_loading_status( el, true );
21
- }
22
- );
23
-
24
- return false;
25
- });
26
-
27
- jQuery(document).on( 'change', '[data-storefront-save-main-page]', function(){
28
- var page = jQuery(this).val();
29
-
30
- var data = {
31
- action: 'ecwid_storefront_set_mainpage',
32
- page: page
33
- };
34
-
35
- jQuery.getJSON(
36
- 'admin-ajax.php',
37
- data,
38
- function(data) {
39
- ecwid_update_storepage_link( data.storepage );
40
- }
41
- );
42
- return false;
43
- });
44
-
45
- jQuery(document).on( 'change', '[data-storefront-checkbox]', function(){
46
- var setting = jQuery(this).data('storefrontCheckbox'),
47
- is_checked = jQuery(this).is(':checked'),
48
- status = (is_checked) ? 1 : 0;
49
-
50
- var data = {
51
- action: 'ecwid_storefront_set_' + setting,
52
- status: status
53
- };
54
-
55
- jQuery.getJSON(
56
- 'admin-ajax.php',
57
- data,
58
- function(data) {
59
- if( typeof data.storepage != 'undefined' ) {
60
- ecwid_update_storepage_link( data.storepage );
61
- }
62
- }
63
- );
64
- return false;
65
- });
66
-
67
- jQuery(document).on( 'click', '[data-storefront-save-slug]', function(){
68
- var slug = jQuery('[name=post_name]').val(),
69
- button = jQuery(this),
70
- card = jQuery(this).closest('.a-card'),
71
  fieldset = jQuery('[name=post_name]').closest('.fieldset');
72
 
73
- button.addClass('btn-loading');
74
 
75
  fieldset.removeClass('has-error');
76
  fieldset.find('.field__error').text('');
77
 
78
- var data = {
79
- action: 'ecwid_storefront_set_page_slug',
80
- slug: slug
81
- };
82
-
83
- jQuery.getJSON(
84
- 'admin-ajax.php',
85
- data,
86
- function(data) {
87
- if( data.status == 'success' ) {
88
- ecwid_update_storepage_link( data.storepage );
89
  card.find('[data-storefront-show-card]').trigger('click');
90
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
- if( data.status == 'error' ) {
93
- fieldset.addClass('has-error');
94
- fieldset.find('.field__error').text(data.message);
95
- }
 
96
 
 
 
 
 
97
  button.removeClass('btn-loading');
98
- }
99
- );
100
- return false;
101
- });
102
-
103
- jQuery(document).on( 'click', '[data-storefront-create-page]', function(){
104
- var button = jQuery(this),
105
- type = button.data('storefrontCreatePage'),
106
- item_id = false;
107
-
108
- if( typeof button.data('storefrontItemId') != 'undefined' ) {
109
- item_id = button.data('storefrontItemId');
110
- }
111
-
112
- if( !button.hasClass('btn') ) {
113
- button = button.closest('.btn-group').find('.btn');
114
- }
115
-
116
- button.addClass('btn-loading');
117
-
118
- var data = {
119
- action: 'ecwid_storefront_create_page',
120
- type: type,
121
- item_id: item_id
122
- };
123
-
124
- jQuery.getJSON(
125
- 'admin-ajax.php',
126
- data,
127
- function(data) {
128
- button.removeClass('btn-loading');
129
-
130
- if( data.status == 'success' && data.open_page ) {
131
- var win = window.open(data.url, '_blank');
132
- win.focus();
133
- }
134
-
135
- ecwid_set_storefront_state( data.storepage.status );
136
- }
137
- );
138
- return false;
139
- });
140
-
141
- jQuery(document).on( 'click', '[data-storefront-show-card]', function(){
142
- var card = jQuery(this).data('storefrontShowCard');
143
- ecwid_show_storefront_card( jQuery(this), card );
144
- return false;
145
- });
146
-
147
- ecwid_disable_cards( jQuery('.settings-page').data('ecStorefrontStatus') );
148
  });
149
 
150
- function ecwid_set_storefront_state( state ) {
151
  jQuery('[data-ec-storefront-status]').attr('data-ec-storefront-status', state);
152
- ecwid_disable_cards( state );
153
  }
154
 
155
- function ecwid_show_storefront_card( el, need_show_card ) {
156
  el.closest('.a-card').hide();
157
  jQuery('[data-storefront-card="' + need_show_card + '"]').show();
158
  }
159
 
160
- function ecwid_toggle_loading_status( el, close_dropdown ){
161
- if( el.hasClass('btn') ) {
162
- if( typeof close_dropdown != 'undefined' ) {
163
- el.removeClass('btn-loading');
164
  } else {
165
  el.addClass('btn-loading');
166
  }
@@ -168,17 +168,17 @@ function ecwid_toggle_loading_status( el, close_dropdown ){
168
  el.closest('.feature-element__status').find('.dropdown-menu').toggle();
169
  el.closest('.feature-element__status').find('.iconable-link').toggle();
170
 
171
- if( typeof close_dropdown != 'undefined' ) {
172
  el.closest('.feature-element__status').find('.list-dropdown').hide();
173
  }
174
  }
175
  }
176
 
177
- function ecwid_disable_cards( status ) {
178
- jQuery('[data-ec-storefront-disabled-card]').each(function(){
179
  var card = jQuery(this);
180
 
181
- if( card.data('ecStorefrontDisabledCard') == status ) {
182
  card.find('.iconable-block').addClass('iconable-block--disabled');
183
  card.find('.status-block').addClass('status-block--disabled');
184
  card.find('.cta-block').addClass('cta-block--disabled');
@@ -194,20 +194,20 @@ function ecwid_disable_cards( status ) {
194
  });
195
  }
196
 
197
- function ecwid_update_storepage_link( storepage ) {
198
  var old_link = jQuery('[data-ec-store-link]').eq(0).attr('href');
199
 
200
  jQuery('[data-ec-store-slug]').html(storepage.slug);
201
  jQuery('[data-ec-store-slug-input]').val(storepage.slug);
202
 
203
- jQuery('a').each(function(){
204
- if( typeof jQuery(this).attr('href') != 'undefined' ) {
205
- if( jQuery(this).attr('href') == old_link ) {
206
  jQuery(this).attr('href', storepage.link);
207
  }
208
 
209
- if( jQuery(this).html() == decodeURI(old_link) ) {
210
- jQuery(this).html( decodeURI(storepage.link) );
211
  }
212
  }
213
  });
1
+ jQuery(document).ready(function () {
2
+
3
+ jQuery(document).on('click', '[data-storefront-status]', function () {
4
+ var el = jQuery(this),
5
+ new_status = el.data('storefrontStatus');
6
+
7
+ ecwid_toggle_loading_status(el);
8
+
9
+ var data = {
10
+ action: 'ecwid_storefront_set_status',
11
+ status: new_status
12
+ };
13
+
14
+ jQuery.getJSON(
15
+ 'admin-ajax.php',
16
+ data,
17
+ function (data) {
18
+ ecwid_update_storepage_link(data.storepage);
19
+ ecwid_set_storefront_state(data.storepage.status);
20
+ ecwid_toggle_loading_status(el, true);
21
+ }
22
+ );
23
+
24
+ return false;
25
+ });
26
+
27
+ jQuery(document).on('change', '[data-storefront-save-main-page]', function () {
28
+ var page = jQuery(this).val();
29
+
30
+ var data = {
31
+ action: 'ecwid_storefront_set_mainpage',
32
+ page: page
33
+ };
34
+
35
+ jQuery.getJSON(
36
+ 'admin-ajax.php',
37
+ data,
38
+ function (data) {
39
+ ecwid_update_storepage_link(data.storepage);
40
+ }
41
+ );
42
+ return false;
43
+ });
44
+
45
+ jQuery(document).on('change', '[data-storefront-checkbox]', function () {
46
+ var setting = jQuery(this).data('storefrontCheckbox'),
47
+ is_checked = jQuery(this).is(':checked'),
48
+ status = (is_checked) ? 1 : 0;
49
+
50
+ var data = {
51
+ action: 'ecwid_storefront_set_' + setting,
52
+ status: status
53
+ };
54
+
55
+ jQuery.getJSON(
56
+ 'admin-ajax.php',
57
+ data,
58
+ function (data) {
59
+ if (typeof data.storepage != 'undefined') {
60
+ ecwid_update_storepage_link(data.storepage);
61
+ }
62
+ }
63
+ );
64
+ return false;
65
+ });
66
+
67
+ jQuery(document).on('click', '[data-storefront-save-slug]', function () {
68
+ var slug = jQuery('[name=post_name]').val(),
69
+ button = jQuery(this),
70
+ card = jQuery(this).closest('.a-card'),
71
  fieldset = jQuery('[name=post_name]').closest('.fieldset');
72
 
73
+ button.addClass('btn-loading');
74
 
75
  fieldset.removeClass('has-error');
76
  fieldset.find('.field__error').text('');
77
 
78
+ var data = {
79
+ action: 'ecwid_storefront_set_page_slug',
80
+ slug: slug
81
+ };
82
+
83
+ jQuery.getJSON(
84
+ 'admin-ajax.php',
85
+ data,
86
+ function (data) {
87
+ if (data.status == 'success') {
88
+ ecwid_update_storepage_link(data.storepage);
89
  card.find('[data-storefront-show-card]').trigger('click');
90
+ }
91
+
92
+ if (data.status == 'error') {
93
+ fieldset.addClass('has-error');
94
+ fieldset.find('.field__error').text(data.message);
95
+ }
96
+
97
+ button.removeClass('btn-loading');
98
+ }
99
+ );
100
+ return false;
101
+ });
102
+
103
+ jQuery(document).on('click', '[data-storefront-create-page]', function () {
104
+ var button = jQuery(this),
105
+ type = button.data('storefrontCreatePage'),
106
+ item_id = false;
107
+
108
+ if (typeof button.data('storefrontItemId') != 'undefined') {
109
+ item_id = button.data('storefrontItemId');
110
+ }
111
+
112
+ if (!button.hasClass('btn')) {
113
+ button = button.closest('.btn-group').find('.btn');
114
+ }
115
+
116
+ button.addClass('btn-loading');
117
 
118
+ var data = {
119
+ action: 'ecwid_storefront_create_page',
120
+ type: type,
121
+ item_id: item_id
122
+ };
123
 
124
+ jQuery.getJSON(
125
+ 'admin-ajax.php',
126
+ data,
127
+ function (data) {
128
  button.removeClass('btn-loading');
129
+
130
+ if (data.status == 'success' && data.open_page) {
131
+ var win = window.open(data.url, '_blank');
132
+ win.focus();
133
+ }
134
+
135
+ ecwid_set_storefront_state(data.storepage.status);
136
+ }
137
+ );
138
+ return false;
139
+ });
140
+
141
+ jQuery(document).on('click', '[data-storefront-show-card]', function () {
142
+ var card = jQuery(this).data('storefrontShowCard');
143
+ ecwid_show_storefront_card(jQuery(this), card);
144
+ return false;
145
+ });
146
+
147
+ ecwid_disable_cards(jQuery('.settings-page').data('ecStorefrontStatus'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  });
149
 
150
+ function ecwid_set_storefront_state(state) {
151
  jQuery('[data-ec-storefront-status]').attr('data-ec-storefront-status', state);
152
+ ecwid_disable_cards(state);
153
  }
154
 
155
+ function ecwid_show_storefront_card(el, need_show_card) {
156
  el.closest('.a-card').hide();
157
  jQuery('[data-storefront-card="' + need_show_card + '"]').show();
158
  }
159
 
160
+ function ecwid_toggle_loading_status(el, close_dropdown) {
161
+ if (el.hasClass('btn')) {
162
+ if (typeof close_dropdown != 'undefined') {
163
+ el.removeClass('btn-loading');
164
  } else {
165
  el.addClass('btn-loading');
166
  }
168
  el.closest('.feature-element__status').find('.dropdown-menu').toggle();
169
  el.closest('.feature-element__status').find('.iconable-link').toggle();
170
 
171
+ if (typeof close_dropdown != 'undefined') {
172
  el.closest('.feature-element__status').find('.list-dropdown').hide();
173
  }
174
  }
175
  }
176
 
177
+ function ecwid_disable_cards(status) {
178
+ jQuery('[data-ec-storefront-disabled-card]').each(function () {
179
  var card = jQuery(this);
180
 
181
+ if (card.data('ecStorefrontDisabledCard') == status) {
182
  card.find('.iconable-block').addClass('iconable-block--disabled');
183
  card.find('.status-block').addClass('status-block--disabled');
184
  card.find('.cta-block').addClass('cta-block--disabled');
194
  });
195
  }
196
 
197
+ function ecwid_update_storepage_link(storepage) {
198
  var old_link = jQuery('[data-ec-store-link]').eq(0).attr('href');
199
 
200
  jQuery('[data-ec-store-slug]').html(storepage.slug);
201
  jQuery('[data-ec-store-slug-input]').val(storepage.slug);
202
 
203
+ jQuery('a').each(function () {
204
+ if (typeof jQuery(this).attr('href') != 'undefined') {
205
+ if (jQuery(this).attr('href') == old_link) {
206
  jQuery(this).attr('href', storepage.link);
207
  }
208
 
209
+ if (jQuery(this).html() == decodeURI(old_link)) {
210
+ jQuery(this).html(decodeURI(storepage.link));
211
  }
212
  }
213
  });
lib/html-catalog-templates/category.php CHANGED
@@ -1,16 +1,16 @@
1
 
2
  <?php if ( $main_category ): ?>
3
 
4
- <h1 class="category-name"><?php echo $main_category->name; ?></h1>
5
  <?php if ( $main_category->description ): ?>
6
- <div class="category-description"><?php echo $main_category->description; ?></div>
7
  <?php endif; ?>
8
 
9
  <?php endif; ?>
10
 
11
  <?php if ( $categories ): foreach ( $categories as $category ): ?>
12
- <div class="category-<?php echo $category->id; ?>">
13
- <a href="<?php $cat = Ecwid_Category::get_by_id( $category->id ); echo $cat->get_link( $this->store_base_url ); ?>">
14
  <?php echo esc_html( $category->name ); ?>
15
  </a>
16
  </div>
@@ -19,14 +19,14 @@
19
  <?php if ( $products ): foreach ( $products as $product ): ?>
20
 
21
  <?php $product = Ecwid_Product::get_by_id($product->id); ?>
22
- <div class="product-<?php echo $product->id; ?>">
23
  <span class="product-name">
24
- <a href="<?php echo $product->get_link( $this->store_base_url ); ?>">
25
  <?php echo esc_html( $product->name ); ?>
26
  </a>
27
  </span>
28
  <span class="product-price">
29
- <?php echo $product->defaultDisplayedPrice . ' ' . $formats->currency; ?>
30
  </span>
31
  </div>
32
 
1
 
2
  <?php if ( $main_category ): ?>
3
 
4
+ <h1 class="category-name"><?php echo esc_html( $main_category->name ); ?></h1>
5
  <?php if ( $main_category->description ): ?>
6
+ <div class="category-description"><?php echo wp_kses_post( $main_category->description ); ?></div>
7
  <?php endif; ?>
8
 
9
  <?php endif; ?>
10
 
11
  <?php if ( $categories ): foreach ( $categories as $category ): ?>
12
+ <div class="category-<?php echo esc_attr( $category->id ); ?>">
13
+ <a href="<?php $cat = Ecwid_Category::get_by_id( $category->id ); echo esc_url( $cat->get_link( $this->store_base_url ) ); ?>">
14
  <?php echo esc_html( $category->name ); ?>
15
  </a>
16
  </div>
19
  <?php if ( $products ): foreach ( $products as $product ): ?>
20
 
21
  <?php $product = Ecwid_Product::get_by_id($product->id); ?>
22
+ <div class="product-<?php echo esc_attr( $product->id ); ?>">
23
  <span class="product-name">
24
+ <a href="<?php echo esc_url( $product->get_link( $this->store_base_url ) ); ?>">
25
  <?php echo esc_html( $product->name ); ?>
26
  </a>
27
  </span>
28
  <span class="product-price">
29
+ <?php echo esc_html( $product->defaultDisplayedPrice . ' ' . $formats->currency ); ?>
30
  </span>
31
  </div>
32
 
lib/html-catalog-templates/product.php CHANGED
@@ -4,7 +4,7 @@
4
  <h1 itemprop="name"><?php echo esc_html( $product->name ); ?></h1>
5
  <p itemprop="sku"><?php echo esc_html( $product->sku ); ?></p>
6
  <img itemprop="image" src="<?php echo esc_attr( $product->originalImageUrl ); ?>" alt="<?php echo esc_attr( $product->name . ' ' . $product->sku); ?>" />
7
- <div itemprop="description"><?php echo isset( $product->seoDescription )&& !empty( $product->seoDescription ) ? $product->seoDescription : $product->description; ?></div>
8
  <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
9
  <span itemprop="price" content="<?php echo esc_html( $product->defaultDisplayedPrice ); ?>"><?php
10
  echo esc_html(
@@ -13,13 +13,13 @@
13
  ?></span>
14
  <span itemprop="priceCurrency" content="<?php echo esc_attr( $formats->currency ); ?>"></span>
15
  <?php if ( !isset( $product->quantity) || $product->quantity > 0): ?><link itemprop="availability" href="http://schema.org/InStock" />In stock<?php endif; ?>
16
- <link itemprop="url" href="<?php if( !empty($product->seo_link) ) { echo $product->seo_link; } else { echo $product->url; }?>" />
17
  </div>
18
  <?php if ( isset( $product->attributes ) && is_array( $product->attributes ) && !empty( $product->attributes) ): ?>
19
  <div class="attributes">
20
  <?php foreach ( $product->attributes as $attribute ):
21
  ?> <div><?php
22
- echo $attribute->name . ':';
23
  if ( isset( $attribute->internalName ) && $attribute->internalName == 'Brand'
24
  ||
25
  isset( $attribute->type ) && $attribute->type == 'BRAND'
@@ -35,7 +35,7 @@
35
  <?php if ( isset( $product->options) && is_array( $product->options ) && !empty( $product->options ) ): ?>
36
  <?php foreach ( $product->options as $option ): ?>
37
  <div class="option">
38
- <span class="name"><?php echo $option->name; ?></span>
39
  <span class="input"><?php
40
  if ( $option->type == 'TEXTAREA' ):
41
  ?>
4
  <h1 itemprop="name"><?php echo esc_html( $product->name ); ?></h1>
5
  <p itemprop="sku"><?php echo esc_html( $product->sku ); ?></p>
6
  <img itemprop="image" src="<?php echo esc_attr( $product->originalImageUrl ); ?>" alt="<?php echo esc_attr( $product->name . ' ' . $product->sku); ?>" />
7
+ <div itemprop="description"><?php echo isset( $product->seoDescription )&& !empty( $product->seoDescription ) ? wp_kses_post( $product->seoDescription ) : wp_kses_post( $product->description ); ?></div>
8
  <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
9
  <span itemprop="price" content="<?php echo esc_html( $product->defaultDisplayedPrice ); ?>"><?php
10
  echo esc_html(
13
  ?></span>
14
  <span itemprop="priceCurrency" content="<?php echo esc_attr( $formats->currency ); ?>"></span>
15
  <?php if ( !isset( $product->quantity) || $product->quantity > 0): ?><link itemprop="availability" href="http://schema.org/InStock" />In stock<?php endif; ?>
16
+ <link itemprop="url" href="<?php if( !empty($product->seo_link) ) { echo esc_attr( $product->seo_link ); } else { echo esc_attr( $product->url ); }?>" />
17
  </div>
18
  <?php if ( isset( $product->attributes ) && is_array( $product->attributes ) && !empty( $product->attributes) ): ?>
19
  <div class="attributes">
20
  <?php foreach ( $product->attributes as $attribute ):
21
  ?> <div><?php
22
+ echo esc_html( $attribute->name ) . ':';
23
  if ( isset( $attribute->internalName ) && $attribute->internalName == 'Brand'
24
  ||
25
  isset( $attribute->type ) && $attribute->type == 'BRAND'
35
  <?php if ( isset( $product->options) && is_array( $product->options ) && !empty( $product->options ) ): ?>
36
  <?php foreach ( $product->options as $option ): ?>
37
  <div class="option">
38
+ <span class="name"><?php echo esc_attr( $option->name ); ?></span>
39
  <span class="input"><?php
40
  if ( $option->type == 'TEXTAREA' ):
41
  ?>
lib/phpseclib/Base.php CHANGED
@@ -1585,7 +1585,7 @@ class Ecwid_Crypt_Base
1585
  */
1586
  function _encryptBlock($in)
1587
  {
1588
- user_error((version_compare(PHP_VERSION, '5.0.0', '>=') ? __METHOD__ : __FUNCTION__) . '() must extend by class ' . get_class($this), E_USER_ERROR);
1589
  }
1590
 
1591
  /**
@@ -1598,7 +1598,7 @@ class Ecwid_Crypt_Base
1598
  */
1599
  function _decryptBlock($in)
1600
  {
1601
- user_error((version_compare(PHP_VERSION, '5.0.0', '>=') ? __METHOD__ : __FUNCTION__) . '() must extend by class ' . get_class($this), E_USER_ERROR);
1602
  }
1603
 
1604
  /**
@@ -1612,7 +1612,7 @@ class Ecwid_Crypt_Base
1612
  */
1613
  function _setupKey()
1614
  {
1615
- user_error((version_compare(PHP_VERSION, '5.0.0', '>=') ? __METHOD__ : __FUNCTION__) . '() must extend by class ' . get_class($this), E_USER_ERROR);
1616
  }
1617
 
1618
  /**
@@ -1673,7 +1673,7 @@ class Ecwid_Crypt_Base
1673
  if ($length % $this->block_size == 0) {
1674
  return $text;
1675
  } else {
1676
- user_error("The plaintext's length ($length) is not a multiple of the block size ({$this->block_size})");
1677
  $this->padding = true;
1678
  }
1679
  }
1585
  */
1586
  function _encryptBlock($in)
1587
  {
1588
+ user_error((version_compare(PHP_VERSION, '5.0.0', '>=') ? __METHOD__ : __FUNCTION__) . '() must extend by class ' . get_class($this), E_USER_ERROR);//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1589
  }
1590
 
1591
  /**
1598
  */
1599
  function _decryptBlock($in)
1600
  {
1601
+ user_error((version_compare(PHP_VERSION, '5.0.0', '>=') ? __METHOD__ : __FUNCTION__) . '() must extend by class ' . get_class($this), E_USER_ERROR);//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1602
  }
1603
 
1604
  /**
1612
  */
1613
  function _setupKey()
1614
  {
1615
+ user_error((version_compare(PHP_VERSION, '5.0.0', '>=') ? __METHOD__ : __FUNCTION__) . '() must extend by class ' . get_class($this), E_USER_ERROR);//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1616
  }
1617
 
1618
  /**
1673
  if ($length % $this->block_size == 0) {
1674
  return $text;
1675
  } else {
1676
+ user_error("The plaintext's length ($length) is not a multiple of the block size ({$this->block_size})");//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1677
  $this->padding = true;
1678
  }
1679
  }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
- === Ecwid Ecommerce Shopping Cart ===
2
  Contributors: Ecwid
3
  Tags: ecommerce, e-commerce, storefront, shopping cart, online store
4
  Requires at least: 4.4
5
  Tested up to: 6.0
6
- Stable tag: 6.10.27
7
 
8
  Powerful, easy to use ecommerce shopping cart for WordPress. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
@@ -152,6 +152,11 @@ You can use Ecwid’s built-in import tools to copy your store products from any
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
155
  = 6.10.27 - Aug 18, 2022 =
156
  - After the last update, the Ecwid ecommerce plugin may have broken other plugins on your ecommerce site. It was a bug. We've fixed it.
157
 
1
+ === Ecwid Ecommerce Shopping Cart ===
2
  Contributors: Ecwid
3
  Tags: ecommerce, e-commerce, storefront, shopping cart, online store
4
  Requires at least: 4.4
5
  Tested up to: 6.0
6
+ Stable tag: 6.10.28
7
 
8
  Powerful, easy to use ecommerce shopping cart for WordPress. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
152
 
153
  == Changelog ==
154
 
155
+ = 6.10.28 - Sep 01, 2022 =
156
+ - Improvements in the plugin code to comply with the WordPress plugin marketplace recommendations.
157
+ - Improvements for compatibility with Divi builder.
158
+ - Minor fixes and improvements.
159
+
160
  = 6.10.27 - Aug 18, 2022 =
161
  - After the last update, the Ecwid ecommerce plugin may have broken other plugins on your ecommerce site. It was a bug. We've fixed it.
162
 
templates/admin-footer.php CHANGED
@@ -1,34 +1,33 @@
1
  <div class="ecwid-admin-footer">
2
- <?php if ( !Ecwid_Config::is_wl()): ?>
3
-
4
- <?php if ( Ecwid_Admin_Main_Page::uses_integrated_admin() ): ?>
5
  <div class="ecwid-admin-footer-block ecwid-app-badges-block">
6
- <h4 class="ecwid-admin-footer-title"><?php _e('Manage Store on iPhone, iPad or Android', 'ecwid-shopping-cart'); ?></h4>
7
  <div class="ecwid-admin-footer-text">
8
  <a target="_blank" id="ecwid-get-mobile-app" href="admin.php?page=ecwid-admin-mobile">
9
- <?php printf( __( 'Get %s mobile app', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
10
 
11
  </a>
12
  </div>
13
  </div>
14
- <?php endif; ?>
15
-
16
  <div class="ecwid-admin-footer-block">
17
- <h4 class="ecwid-admin-footer-title"><?php _e('Questions?', 'ecwid-shopping-cart'); ?></h4>
18
  <div class="ecwid-admin-footer-text">
19
- <?php _e('<a href="admin.php?page=' . Ecwid_Admin::ADMIN_SLUG . '-help">Read FAQ or contact support</a>', 'ecwid-shopping-cart'); ?>
20
  </div>
21
  </div>
22
-
23
- <?php endif; ?>
24
-
25
- <?php if ( @$show_reconnect && Ecwid_Config::should_show_reconnect_in_footer() ): ?>
26
- <div class="ecwid-admin-footer-block">
27
- <h4 class="ecwid-admin-footer-title"><?php printf( __('Want to connect another %s store?', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></h4>
28
- <div class="ecwid-admin-footer-text">
29
- <?php echo sprintf(__('<a %s>Reconnect</a>', 'ecwid-shopping-cart'), 'href="' . Ecwid_Admin::get_dashboard_url() . '&reconnect"'); ?>
30
- </div>
31
- </div>
32
- <?php endif; ?>
33
  </div>
34
-
1
  <div class="ecwid-admin-footer">
2
+ <?php if ( ! Ecwid_Config::is_wl() ) : ?>
3
+
4
+ <?php if ( Ecwid_Admin_Main_Page::uses_integrated_admin() ) : ?>
5
  <div class="ecwid-admin-footer-block ecwid-app-badges-block">
6
+ <h4 class="ecwid-admin-footer-title"><?php esc_html_e( 'Manage Store on iPhone, iPad or Android', 'ecwid-shopping-cart' ); ?></h4>
7
  <div class="ecwid-admin-footer-text">
8
  <a target="_blank" id="ecwid-get-mobile-app" href="admin.php?page=ecwid-admin-mobile">
9
+ <?php echo esc_html( sprintf( __( 'Get %s mobile app', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
10
 
11
  </a>
12
  </div>
13
  </div>
14
+ <?php endif; ?>
15
+
16
  <div class="ecwid-admin-footer-block">
17
+ <h4 class="ecwid-admin-footer-title"><?php esc_html_e( 'Questions?', 'ecwid-shopping-cart' ); ?></h4>
18
  <div class="ecwid-admin-footer-text">
19
+ <?php echo wp_kses_post( __( '<a href="admin.php?page=' . Ecwid_Admin::ADMIN_SLUG . '-help">Read FAQ or contact support</a>', 'ecwid-shopping-cart' ) ); ?>
20
  </div>
21
  </div>
22
+
23
+ <?php endif; ?>
24
+
25
+ <?php if ( @$show_reconnect && Ecwid_Config::should_show_reconnect_in_footer() ) : ?>
26
+ <div class="ecwid-admin-footer-block">
27
+ <h4 class="ecwid-admin-footer-title"><?php echo esc_html( sprintf( __( 'Want to connect another %s store?', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?></h4>
28
+ <div class="ecwid-admin-footer-text">
29
+ <?php echo wp_kses_post( sprintf( __( '<a %s>Reconnect</a>', 'ecwid-shopping-cart' ), 'href="' . Ecwid_Admin::get_dashboard_url() . '&reconnect"' ) ); ?>
30
+ </div>
31
+ </div>
32
+ <?php endif; ?>
33
  </div>
 
templates/admin-head.php CHANGED
@@ -1,10 +1,10 @@
1
  <div class="head">
2
  <?php
3
- if( !Ecwid_Config::is_wl() ) {
4
  ecwid_embed_svg( 'ecwid-logo-blue' );
5
  }
6
  ?>
7
  <h3>
8
- <?php printf( __( '%s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
9
  </h3>
10
- </div>
1
  <div class="head">
2
  <?php
3
+ if ( ! Ecwid_Config::is_wl() ) {
4
  ecwid_embed_svg( 'ecwid-logo-blue' );
5
  }
6
  ?>
7
  <h3>
8
+ <?php echo esc_html( sprintf( __( '%s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
9
  </h3>
10
+ </div>
templates/admin-params.php CHANGED
@@ -8,9 +8,9 @@
8
  </div>
9
  <br />
10
 
11
- <form method="POST" type="multipart/form-data" action="admin-post.php?action=<?php echo ecwid_get_update_params_action(); ?>">
12
 
13
- <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( ecwid_get_update_params_action() ); ?>" />
14
 
15
  <style type="text/css">
16
  #ec-params-table { border-collapse: collapse; border-spacing: 0; margin-bottom: 5px; }
@@ -20,40 +20,40 @@
20
  </style>
21
 
22
  <table id="ec-params-table">
23
-
24
  <?php foreach ( ecwid_get_update_params_options() as $key => $option ) : ?>
25
  <tr style="padding: 0 0 5px;">
26
- <td><?php echo $key; ?>: </td>
27
  <td>
28
- <?php if ( @$option['type'] == 'bool' ) : ?>
29
- <select name="option[<?php echo $key; ?>]">
30
  <option value=""
31
  <?php
32
- if ( get_option( $key ) == '' ) :
33
  ?>
34
- selected="selected"<?php endif; ?>>off</option>
35
  <option value="Y"
36
  <?php
37
  if ( get_option( $key ) ) :
38
  ?>
39
- selected="selected"<?php endif; ?>>on</option>
40
  </select>
41
- <?php elseif ( @$option['type'] == 'string' ) : ?>
42
- <input type="text" name="option[<?php echo $key; ?>]" value="<?php echo esc_attr( get_option( $key ) ); ?>">
43
- <?php elseif ( @$option['type'] == 'html' ) : ?>
44
- <textarea name="option[<?php echo $key; ?>]" style="width:500px"><?php echo htmlentities( get_option( $key ) ); ?></textarea>
45
- <?php elseif ( @$option['values'] ) : ?>
46
- <select name="option[<?php echo $key; ?>]">
47
- <?php foreach ( @$option['values'] as $value ) : ?>
48
- <option value="<?php echo $value; ?>"
49
- <?php
50
- if ( $value == get_option( $key ) ) :
51
- ?>
52
- selected="selected"<?php endif; ?>><?php echo $value; ?></option>
53
  <?php endforeach; ?>
54
  </select>
55
  <?php endif; ?>
56
-
57
  <?php echo esc_attr( get_option( $key ) ); ?>
58
 
59
  </td>
@@ -67,4 +67,4 @@
67
 
68
  <br />
69
  <h2>Clear plugin cache</h2>
70
- <a href="?<?php echo ecwid_get_clear_all_cache_action(); ?>&redirect_back">Clear all caches</a>
8
  </div>
9
  <br />
10
 
11
+ <form method="POST" type="multipart/form-data" action="admin-post.php?action=<?php echo esc_attr( ecwid_get_update_params_action() ); ?>">
12
 
13
+ <input type="hidden" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( ecwid_get_update_params_action() ) ); ?>" />
14
 
15
  <style type="text/css">
16
  #ec-params-table { border-collapse: collapse; border-spacing: 0; margin-bottom: 5px; }
20
  </style>
21
 
22
  <table id="ec-params-table">
23
+
24
  <?php foreach ( ecwid_get_update_params_options() as $key => $option ) : ?>
25
  <tr style="padding: 0 0 5px;">
26
+ <td><?php echo esc_html( $key ); ?>: </td>
27
  <td>
28
+ <?php if ( isset( $option['type'] ) && $option['type'] === 'bool' ) : ?>
29
+ <select name="option[<?php echo esc_attr( $key ); ?>]">
30
  <option value=""
31
  <?php
32
+ if ( get_option( $key ) === '' ) :
33
  ?>
34
+ selected="selected"<?php endif; ?>>off</option>
35
  <option value="Y"
36
  <?php
37
  if ( get_option( $key ) ) :
38
  ?>
39
+ selected="selected"<?php endif; ?>>on</option>
40
  </select>
41
+ <?php elseif ( isset( $option['type'] ) && $option['type'] === 'string' ) : ?>
42
+ <input type="text" name="option[<?php echo esc_attr( $key ); ?>]" value="<?php echo esc_attr( get_option( $key ) ); ?>">
43
+ <?php elseif ( isset( $option['type'] ) && $option['type'] === 'html' ) : ?>
44
+ <textarea name="option[<?php echo esc_attr( $key ); ?>]" style="width:500px"><?php echo esc_textarea( get_option( $key ) ); ?></textarea>
45
+ <?php elseif ( ! empty( $option['values'] ) ) : ?>
46
+ <select name="option[<?php echo esc_attr( $key ); ?>]">
47
+ <?php foreach ( $option['values'] as $value ) : ?>
48
+ <option value="<?php echo esc_attr( $value ); ?>"
49
+ <?php if ( $value === get_option( $key ) ) { ?>
50
+ selected="selected"
51
+ <?php } ?>
52
+ ><?php echo esc_html( $value ); ?></option>
53
  <?php endforeach; ?>
54
  </select>
55
  <?php endif; ?>
56
+
57
  <?php echo esc_attr( get_option( $key ) ); ?>
58
 
59
  </td>
67
 
68
  <br />
69
  <h2>Clear plugin cache</h2>
70
+ <a href="?<?php echo esc_attr( ecwid_get_clear_all_cache_action() ); ?>&redirect_back">Clear all caches</a>
templates/admin-timeout.php CHANGED
@@ -6,8 +6,8 @@
6
  <path d="M34.5 49c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5zM35.5 38.57h-2l-1-14c0-1.17.89-2.07 2-2.07s2 .9 2 2l-1 14.07z"></path>
7
  </svg>
8
  </div>
9
- <h3 class="title"><?php _e("Sorry we're having technical difficulties.", 'ecwid-shopping-cart'); ?></h3>
10
  <div class="text">
11
- <?php _e('Our team is already working on this issue. Please refresh the page in a few minutes. If the issue persists, please contact <a target="_blank" href="https://help.ecwid.com/customer/portal/emails/new">our customer support team</a>.', 'ecwid-shopping-cart'); ?>
12
  </div>
13
- </div>
6
  <path d="M34.5 49c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5zM35.5 38.57h-2l-1-14c0-1.17.89-2.07 2-2.07s2 .9 2 2l-1 14.07z"></path>
7
  </svg>
8
  </div>
9
+ <h3 class="title"><?php esc_html_e( "Sorry we're having technical difficulties.", 'ecwid-shopping-cart' ); ?></h3>
10
  <div class="text">
11
+ <?php echo wp_kses_post( __( 'Our team is already working on this issue. Please refresh the page in a few minutes. If the issue persists, please contact <a target="_blank" href="https://help.ecwid.com/customer/portal/emails/new">our customer support team</a>.', 'ecwid-shopping-cart' ) ); ?>
12
  </div>
13
+ </div>
templates/admin/developers.php CHANGED
@@ -1,9 +1,9 @@
1
  <div id="ec-store-developers" class="settings-page ec-ui-framework-page">
2
  <div class="settings-page__header">
3
  <div class="settings-page__titles settings-page__titles--left">
4
- <h1 class="settings-page__title"><?php echo esc_html( __( 'Developers', 'ecwid-shopping-cart' ) ); ?></h1>
5
  <div class="settings-page__subtitle">
6
- <?php echo esc_html( __( 'Build the store your client needs and realize your own vision with Ecwid. Use the Ecwid plugin, powerful API, apps and integrations to design stores and build your own solutions. Become an Ecwid partner and grow your business effectively.', 'ecwid-shopping-cart' ) ); ?>
7
  </div>
8
  </div>
9
  </div>
@@ -12,10 +12,10 @@
12
  <div class="named-area__header">
13
  <div class="named-area__titles">
14
  <div class="named-area__title">
15
- <?php echo esc_html( __( 'Ecwid plugin features', 'ecwid-shopping-cart' ) ); ?>
16
  </div>
17
  <div class="named-area__subtitle">
18
- <?php echo esc_html( __( 'Extend your site with an easy-to-use plugin compatible with WordPress page builders and editors.', 'ecwid-shopping-cart' ) ); ?>
19
  </div>
20
  </div>
21
  <div class="named-area__description"></div>
@@ -29,7 +29,7 @@
29
  <div class="feature-element__core">
30
  <div class="feature-element__data">
31
  <div class="feature-element__title">
32
- <?php echo esc_html( __( 'Store blocks for your website', 'ecwid-shopping-cart' ) ); ?>
33
  </div>
34
  <div class="feature-element__content">
35
  <div class="feature-element__text">
@@ -37,7 +37,7 @@
37
  <div class="titled-item__title"></div>
38
  <div class="titled-item__content">
39
  <div>
40
- <?php echo esc_html( __( 'Add store components to any place of your WordPress site using shortcodes or WordPress site builders and editors.', 'ecwid-shopping-cart' ) ); ?>
41
  </div>
42
  </div>
43
  </div>
@@ -66,14 +66,14 @@
66
  <div class="cta-block">
67
  <div class="cta-block__central">
68
  <div class="cta-block__title">
69
- <?php echo esc_html( __( 'Shortcodes', 'ecwid-shopping-cart' ) ); ?>
70
  </div>
71
  <div class="cta-block__content">
72
- <?php echo esc_html( __( 'Add shortcodes to the WordPress site to apply basic changes to your store appearance.', 'ecwid-shopping-cart' ) ); ?>
73
  </div>
74
  </div>
75
  <div class="cta-block__cta">
76
- <a href="https://support.ecwid.com/hc/en-us/articles/360002137520?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
77
  </div>
78
  </div>
79
  </div>
@@ -92,14 +92,14 @@
92
  <div class="cta-block">
93
  <div class="cta-block__central">
94
  <div class="cta-block__title">
95
- <?php echo esc_html( __( 'Store blocks for Gutenberg', 'ecwid-shopping-cart' ) ); ?>
96
  </div>
97
  <div class="cta-block__content">
98
- <?php echo esc_html( __( 'Add store plugin to the WordPress site in Gutenberg block editor, with no HTML or shortcodes.', 'ecwid-shopping-cart' ) ); ?>
99
  </div>
100
  </div>
101
  <div class="cta-block__cta">
102
- <a href="https://support.ecwid.com/hc/en-us/articles/4489063443612?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
103
  </div>
104
  </div>
105
  </div>
@@ -118,14 +118,14 @@
118
  <div class="cta-block">
119
  <div class="cta-block__central">
120
  <div class="cta-block__title">
121
- <?php echo esc_html( __( 'Store blocks for Elementor', 'ecwid-shopping-cart' ) ); ?>
122
  </div>
123
  <div class="cta-block__content">
124
- <?php echo esc_html( __( 'Create a store from your website with the Ecwid plugin and Elementor page builder, with no coding required.', 'ecwid-shopping-cart' ) ); ?>
125
  </div>
126
  </div>
127
  <div class="cta-block__cta">
128
- <a href="https://support.ecwid.com/hc/en-us/articles/4489039710364?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
129
  </div>
130
  </div>
131
  </div>
@@ -140,7 +140,7 @@
140
  <div class="feature-element__core">
141
  <div class="feature-element__data">
142
  <div class="feature-element__title">
143
- <?php echo esc_html( __( 'Advanced customization', 'ecwid-shopping-cart' ) ); ?>
144
  </div>
145
  <div class="feature-element__content">
146
  <div class="feature-element__text">
@@ -148,7 +148,7 @@
148
  <div class="titled-item__title"></div>
149
  <div class="titled-item__content">
150
  <div>
151
- <?php echo esc_html( __( 'Use advanced settings and Ecwid API capabilities to tailor the look and functionality of your site.', 'ecwid-shopping-cart' ) ); ?>
152
  </div>
153
  </div>
154
  </div>
@@ -174,14 +174,14 @@
174
  <div class="cta-block">
175
  <div class="cta-block__central">
176
  <div class="cta-block__title">
177
- <?php echo esc_html( __( 'Advanced settings', 'ecwid-shopping-cart' ) ); ?>
178
  </div>
179
  <div class="cta-block__content">
180
- <?php echo esc_html( __( 'Change functionality of the plugin with advanced settings, like dashboard visibility for webmasters, display of store components, clean URLs, and more.', 'ecwid-shopping-cart' ) ); ?>
181
  </div>
182
  </div>
183
  <div class="cta-block__cta">
184
- <a href="<?php echo admin_url( 'admin.php?page=ec-params' ); ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Go to Settings', 'ecwid-shopping-cart' ) ); ?></span> </a>
185
  </div>
186
  </div>
187
  </div>
@@ -200,14 +200,14 @@
200
  <div class="cta-block">
201
  <div class="cta-block__central">
202
  <div class="cta-block__title">
203
- <?php echo esc_html( __( 'Customization with API', 'ecwid-shopping-cart' ) ); ?>
204
  </div>
205
  <div class="cta-block__content">
206
- <?php echo esc_html( __( 'Use the powerful Ecwid API to customize your store design, layout, and functionality.', 'ecwid-shopping-cart' ) ); ?>
207
  </div>
208
  </div>
209
  <div class="cta-block__cta">
210
- <a href="https://api-docs.ecwid.com/reference/customize-appearance?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
211
  </div>
212
  </div>
213
  </div>
@@ -221,10 +221,10 @@
221
  <div class="named-area__header">
222
  <div class="named-area__titles">
223
  <div class="named-area__title">
224
- <?php echo esc_html( __( 'Apps and integrations', 'ecwid-shopping-cart' ) ); ?>
225
  </div>
226
  <div class="named-area__subtitle">
227
- <?php echo esc_html( __( 'Integrate your store with external services to enhance its functionality.', 'ecwid-shopping-cart' ) ); ?>
228
  </div>
229
  </div>
230
  <div class="named-area__description"></div>
@@ -243,17 +243,17 @@
243
  <div class="cta-block">
244
  <div class="cta-block__central">
245
  <div class="cta-block__title">
246
- <?php echo esc_html( __( 'Import product catalog from WooCommerce', 'ecwid-shopping-cart' ) ); ?>
247
  </div>
248
  <div class="cta-block__content">
249
- <?php echo esc_html( __( 'If you want to move your WooCommerce store to Ecwid or have another store outside WooCommerce, use the Ecwid migration tool to import your products in bulk.', 'ecwid-shopping-cart' ) ); ?>
250
  </div>
251
  </div>
252
  <div class="cta-block__cta">
253
  <?php if ( class_exists( 'woocommerce' ) && class_exists( 'Ecwid_Importer' ) ) { ?>
254
- <a href="<?php echo admin_url( 'admin.php?page=ec-store-import-woocommerce' ); ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Go to Import Page', 'ecwid-shopping-cart' ) ); ?></span> </a>
255
  <?php } else { ?>
256
- <a href="https://support.ecwid.com/hc/en-us/articles/360000049040?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
257
  <?php } ?>
258
  </div>
259
  </div>
@@ -273,10 +273,10 @@
273
  <div class="cta-block">
274
  <div class="cta-block__central">
275
  <div class="cta-block__title">
276
- <?php echo esc_html( __( 'App Market', 'ecwid-shopping-cart' ) ); ?>
277
  </div>
278
  <div class="cta-block__content">
279
- <?php echo esc_html( __( 'Enhance your store functionality, add new features, or connect backend systems with powerful apps, tools, and extensions.', 'ecwid-shopping-cart' ) ); ?>
280
  </div>
281
  </div>
282
  <div class="cta-block__cta">
@@ -287,7 +287,7 @@
287
  $app_market_link = admin_url( 'admin.php?page=ec-store-admin-appmarket' );
288
  }
289
  ?>
290
- <a href="<?php echo esc_html( $app_market_link ); ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Go to App Market', 'ecwid-shopping-cart' ) ); ?></span> </a>
291
  </div>
292
  </div>
293
  </div>
@@ -306,14 +306,14 @@
306
  <div class="cta-block">
307
  <div class="cta-block__central">
308
  <div class="cta-block__title">
309
- <?php echo esc_html( __( 'Zapier integration', 'ecwid-shopping-cart' ) ); ?>
310
  </div>
311
  <div class="cta-block__content">
312
- <?php echo esc_html( __( 'Connect thousands of popular apps to your online store with Zapier integration and streamline store management workflows without writing code.', 'ecwid-shopping-cart' ) ); ?>
313
  </div>
314
  </div>
315
  <div class="cta-block__cta">
316
- <a href="https://www.ecwid.com/blog/how-to-connect-ecwid-with-2000-online-business-tools.html?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
317
  </div>
318
  </div>
319
  </div>
@@ -332,14 +332,14 @@
332
  <div class="cta-block">
333
  <div class="cta-block__central">
334
  <div class="cta-block__title">
335
- <?php echo esc_html( __( 'API for catalog and sales', 'ecwid-shopping-cart' ) ); ?>
336
  </div>
337
  <div class="cta-block__content">
338
- <?php echo esc_html( __( 'Use a powerful RESTful API to manage your store, mass update your product catalog and orders.', 'ecwid-shopping-cart' ) ); ?>
339
  </div>
340
  </div>
341
  <div class="cta-block__cta">
342
- <a href="https://api-docs.ecwid.com/reference/rest-api?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
343
  </div>
344
  </div>
345
  </div>
@@ -352,10 +352,10 @@
352
  <div class="named-area__header">
353
  <div class="named-area__titles">
354
  <div class="named-area__title">
355
- <?php echo esc_html( __( 'Partnership', 'ecwid-shopping-cart' ) ); ?>
356
  </div>
357
  <div class="named-area__subtitle">
358
- <?php echo sprintf( __( 'Join our partnership program to build and scale your offering in ecommerce. <a %s>More about partnership</a>', 'ecwid-shopping-cart' ), 'href="https://www.ecwid.com/partners/?utm_source=wp-plugin" target="_blank"' ); ?>
359
  </div>
360
  </div>
361
  <div class="named-area__description"></div>
@@ -374,14 +374,14 @@
374
  <div class="cta-block">
375
  <div class="cta-block__central">
376
  <div class="cta-block__title">
377
- <?php echo esc_html( __( 'Become an Ecwid Referral Partner', 'ecwid-shopping-cart' ) ); ?>
378
  </div>
379
  <div class="cta-block__content">
380
- <?php echo esc_html( __( 'Recommend Ecwid within your network and get a 20% lifetime commission for every referral that creates an account through your link.', 'ecwid-shopping-cart' ) ); ?>
381
  </div>
382
  </div>
383
  <div class="cta-block__cta">
384
- <a href="https://www.ecwid.com/partners/referral?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
385
  </div>
386
  </div>
387
  </div>
@@ -400,14 +400,14 @@
400
  <div class="cta-block">
401
  <div class="cta-block__central">
402
  <div class="cta-block__title">
403
- <?php echo esc_html( __( 'Promote your services as Ecwid Expert', 'ecwid-shopping-cart' ) ); ?>
404
  </div>
405
  <div class="cta-block__content">
406
- <?php echo esc_html( __( 'Join our community of experts and promote your services to clients who need help with store setup, design, or customization.', 'ecwid-shopping-cart' ) ); ?>
407
  </div>
408
  </div>
409
  <div class="cta-block__cta">
410
- <a href="https://www.ecwid.com/experts?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
411
  </div>
412
  </div>
413
  </div>
@@ -426,14 +426,14 @@
426
  <div class="cta-block">
427
  <div class="cta-block__central">
428
  <div class="cta-block__title">
429
- <?php echo esc_html( __( 'Use Ecwid premium plan for free', 'ecwid-shopping-cart' ) ); ?>
430
  </div>
431
  <div class="cta-block__content">
432
- <?php echo esc_html( __( 'If you’re developing sites on WordPress, you can get a free subscription to the Ecwid premium plan. Use it to build and test stores on the WordPress sites, check out the platform features, and get access to Ecwid API. Just apply for the free subscription, and we’ll get in touch with you soon.', 'ecwid-shopping-cart' ) ); ?>
433
  </div>
434
  </div>
435
  <div class="cta-block__cta">
436
- <a href="https://ecommerce-store.typeform.com/to/Heh5d4?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Apply for Free Plan', 'ecwid-shopping-cart' ) ); ?></span> </a>
437
  </div>
438
  </div>
439
  </div>
@@ -446,7 +446,7 @@
446
  <div class="named-area__header">
447
  <div class="named-area__titles">
448
  <div class="named-area__title">
449
- <?php echo esc_html( __( 'Need a hand?', 'ecwid-shopping-cart' ) ); ?>
450
  </div>
451
  <div class="named-area__subtitle"></div>
452
  </div>
@@ -466,10 +466,10 @@
466
  <div class="cta-block">
467
  <div class="cta-block__central">
468
  <div class="cta-block__title">
469
- <?php echo esc_html( __( 'Join developer community on Slack', 'ecwid-shopping-cart' ) ); ?>
470
  </div>
471
  <div class="cta-block__content">
472
- <?php echo esc_html( __( 'Join the community of professionals to get help with questions that are not covered by Help Center or API documentation.', 'ecwid-shopping-cart' ) ); ?>
473
  </div>
474
  </div>
475
  <div class="cta-block__cta">
@@ -490,14 +490,14 @@
490
  <div class="cta-block">
491
  <div class="cta-block__central">
492
  <div class="cta-block__title">
493
- <?php echo esc_html( __( 'Request custom development', 'ecwid-shopping-cart' ) ); ?>
494
  </div>
495
  <div class="cta-block__content">
496
- <?php echo esc_html( __( 'The Ecwid team can help you build the desired features and options that Ecwid does not have out of the box — from integrations with other tools to your own mobile app. Custom development is a paid service, the price depends on the complexity of the request.', 'ecwid-shopping-cart' ) ); ?>
497
  </div>
498
  </div>
499
  <div class="cta-block__cta">
500
- <a href="https://support.ecwid.com/hc/en-us/articles/115005821245?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Submit Request', 'ecwid-shopping-cart' ) ); ?></span> </a>
501
  </div>
502
  </div>
503
  </div>
@@ -516,14 +516,14 @@
516
  <div class="cta-block">
517
  <div class="cta-block__central">
518
  <div class="cta-block__title">
519
- <?php echo esc_html( __( 'Leave feedback', 'ecwid-shopping-cart' ) ); ?>
520
  </div>
521
  <div class="cta-block__content">
522
- <?php echo esc_html( __( 'Tell us what can be improved regarding Ecwid features, integrations, and functionality.', 'ecwid-shopping-cart' ) ); ?>
523
  </div>
524
  </div>
525
  <div class="cta-block__cta">
526
- <a href="https://ecommerce-store.typeform.com/to/qMgJpSBq?utm_source=wp-plugin#store_id=<?php echo get_ecwid_store_id(); ?>&email=<?php echo $admin_email; ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Leave Feedback', 'ecwid-shopping-cart' ) ); ?></span> </a>
527
  </div>
528
  </div>
529
  </div>
1
  <div id="ec-store-developers" class="settings-page ec-ui-framework-page">
2
  <div class="settings-page__header">
3
  <div class="settings-page__titles settings-page__titles--left">
4
+ <h1 class="settings-page__title"><?php echo esc_html__( 'Developers', 'ecwid-shopping-cart' ); ?></h1>
5
  <div class="settings-page__subtitle">
6
+ <?php echo esc_html__( 'Build the store your client needs and realize your own vision with Ecwid. Use the Ecwid plugin, powerful API, apps and integrations to design stores and build your own solutions. Become an Ecwid partner and grow your business effectively.', 'ecwid-shopping-cart' ); ?>
7
  </div>
8
  </div>
9
  </div>
12
  <div class="named-area__header">
13
  <div class="named-area__titles">
14
  <div class="named-area__title">
15
+ <?php echo esc_html__( 'Ecwid plugin features', 'ecwid-shopping-cart' ); ?>
16
  </div>
17
  <div class="named-area__subtitle">
18
+ <?php echo esc_html__( 'Extend your site with an easy-to-use plugin compatible with WordPress page builders and editors.', 'ecwid-shopping-cart' ); ?>
19
  </div>
20
  </div>
21
  <div class="named-area__description"></div>
29
  <div class="feature-element__core">
30
  <div class="feature-element__data">
31
  <div class="feature-element__title">
32
+ <?php echo esc_html__( 'Store blocks for your website', 'ecwid-shopping-cart' ); ?>
33
  </div>
34
  <div class="feature-element__content">
35
  <div class="feature-element__text">
37
  <div class="titled-item__title"></div>
38
  <div class="titled-item__content">
39
  <div>
40
+ <?php echo esc_html__( 'Add store components to any place of your WordPress site using shortcodes or WordPress site builders and editors.', 'ecwid-shopping-cart' ); ?>
41
  </div>
42
  </div>
43
  </div>
66
  <div class="cta-block">
67
  <div class="cta-block__central">
68
  <div class="cta-block__title">
69
+ <?php echo esc_html__( 'Shortcodes', 'ecwid-shopping-cart' ); ?>
70
  </div>
71
  <div class="cta-block__content">
72
+ <?php echo esc_html__( 'Add shortcodes to the WordPress site to apply basic changes to your store appearance.', 'ecwid-shopping-cart' ); ?>
73
  </div>
74
  </div>
75
  <div class="cta-block__cta">
76
+ <a href="https://support.ecwid.com/hc/en-us/articles/360002137520?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Learn More', 'ecwid-shopping-cart' ); ?></span> </a>
77
  </div>
78
  </div>
79
  </div>
92
  <div class="cta-block">
93
  <div class="cta-block__central">
94
  <div class="cta-block__title">
95
+ <?php echo esc_html__( 'Store blocks for Gutenberg', 'ecwid-shopping-cart' ); ?>
96
  </div>
97
  <div class="cta-block__content">
98
+ <?php echo esc_html__( 'Add store plugin to the WordPress site in Gutenberg block editor, with no HTML or shortcodes.', 'ecwid-shopping-cart' ); ?>
99
  </div>
100
  </div>
101
  <div class="cta-block__cta">
102
+ <a href="https://support.ecwid.com/hc/en-us/articles/4489063443612?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Learn More', 'ecwid-shopping-cart' ); ?></span> </a>
103
  </div>
104
  </div>
105
  </div>
118
  <div class="cta-block">
119
  <div class="cta-block__central">
120
  <div class="cta-block__title">
121
+ <?php echo esc_html__( 'Store blocks for Elementor', 'ecwid-shopping-cart' ); ?>
122
  </div>
123
  <div class="cta-block__content">
124
+ <?php echo esc_html__( 'Create a store from your website with the Ecwid plugin and Elementor page builder, with no coding required.', 'ecwid-shopping-cart' ); ?>
125
  </div>
126
  </div>
127
  <div class="cta-block__cta">
128
+ <a href="https://support.ecwid.com/hc/en-us/articles/4489039710364?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Learn More', 'ecwid-shopping-cart' ); ?></span> </a>
129
  </div>
130
  </div>
131
  </div>
140
  <div class="feature-element__core">
141
  <div class="feature-element__data">
142
  <div class="feature-element__title">
143
+ <?php echo esc_html__( 'Advanced customization', 'ecwid-shopping-cart' ); ?>
144
  </div>
145
  <div class="feature-element__content">
146
  <div class="feature-element__text">
148
  <div class="titled-item__title"></div>
149
  <div class="titled-item__content">
150
  <div>
151
+ <?php echo esc_html__( 'Use advanced settings and Ecwid API capabilities to tailor the look and functionality of your site.', 'ecwid-shopping-cart' ); ?>
152
  </div>
153
  </div>
154
  </div>
174
  <div class="cta-block">
175
  <div class="cta-block__central">
176
  <div class="cta-block__title">
177
+ <?php echo esc_html__( 'Advanced settings', 'ecwid-shopping-cart' ); ?>
178
  </div>
179
  <div class="cta-block__content">
180
+ <?php echo esc_html__( 'Change functionality of the plugin with advanced settings, like dashboard visibility for webmasters, display of store components, clean URLs, and more.', 'ecwid-shopping-cart' ); ?>
181
  </div>
182
  </div>
183
  <div class="cta-block__cta">
184
+ <a href="<?php echo esc_url( admin_url( 'admin.php?page=ec-params' ) ); ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Go to Settings', 'ecwid-shopping-cart' ); ?></span> </a>
185
  </div>
186
  </div>
187
  </div>
200
  <div class="cta-block">
201
  <div class="cta-block__central">
202
  <div class="cta-block__title">
203
+ <?php echo esc_html__( 'Customization with API', 'ecwid-shopping-cart' ); ?>
204
  </div>
205
  <div class="cta-block__content">
206
+ <?php echo esc_html__( 'Use the powerful Ecwid API to customize your store design, layout, and functionality.', 'ecwid-shopping-cart' ); ?>
207
  </div>
208
  </div>
209
  <div class="cta-block__cta">
210
+ <a href="https://api-docs.ecwid.com/reference/customize-appearance?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Learn More', 'ecwid-shopping-cart' ); ?></span> </a>
211
  </div>
212
  </div>
213
  </div>
221
  <div class="named-area__header">
222
  <div class="named-area__titles">
223
  <div class="named-area__title">
224
+ <?php echo esc_html__( 'Apps and integrations', 'ecwid-shopping-cart' ); ?>
225
  </div>
226
  <div class="named-area__subtitle">
227
+ <?php echo esc_html__( 'Integrate your store with external services to enhance its functionality.', 'ecwid-shopping-cart' ); ?>
228
  </div>
229
  </div>
230
  <div class="named-area__description"></div>
243
  <div class="cta-block">
244
  <div class="cta-block__central">
245
  <div class="cta-block__title">
246
+ <?php echo esc_html__( 'Import product catalog from WooCommerce', 'ecwid-shopping-cart' ); ?>
247
  </div>
248
  <div class="cta-block__content">
249
+ <?php echo esc_html__( 'If you want to move your WooCommerce store to Ecwid or have another store outside WooCommerce, use the Ecwid migration tool to import your products in bulk.', 'ecwid-shopping-cart' ); ?>
250
  </div>
251
  </div>
252
  <div class="cta-block__cta">
253
  <?php if ( class_exists( 'woocommerce' ) && class_exists( 'Ecwid_Importer' ) ) { ?>
254
+ <a href="<?php echo esc_url( admin_url( 'admin.php?page=ec-store-import-woocommerce' ) ); ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Go to Import Page', 'ecwid-shopping-cart' ); ?></span> </a>
255
  <?php } else { ?>
256
+ <a href="https://support.ecwid.com/hc/en-us/articles/360000049040?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Learn More', 'ecwid-shopping-cart' ); ?></span> </a>
257
  <?php } ?>
258
  </div>
259
  </div>
273
  <div class="cta-block">
274
  <div class="cta-block__central">
275
  <div class="cta-block__title">
276
+ <?php echo esc_html__( 'App Market', 'ecwid-shopping-cart' ); ?>
277
  </div>
278
  <div class="cta-block__content">
279
+ <?php echo esc_html__( 'Enhance your store functionality, add new features, or connect backend systems with powerful apps, tools, and extensions.', 'ecwid-shopping-cart' ); ?>
280
  </div>
281
  </div>
282
  <div class="cta-block__cta">
287
  $app_market_link = admin_url( 'admin.php?page=ec-store-admin-appmarket' );
288
  }
289
  ?>
290
+ <a href="<?php echo esc_url( $app_market_link ); ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Go to App Market', 'ecwid-shopping-cart' ); ?></span> </a>
291
  </div>
292
  </div>
293
  </div>
306
  <div class="cta-block">
307
  <div class="cta-block__central">
308
  <div class="cta-block__title">
309
+ <?php echo esc_html__( 'Zapier integration', 'ecwid-shopping-cart' ); ?>
310
  </div>
311
  <div class="cta-block__content">
312
+ <?php echo esc_html__( 'Connect thousands of popular apps to your online store with Zapier integration and streamline store management workflows without writing code.', 'ecwid-shopping-cart' ); ?>
313
  </div>
314
  </div>
315
  <div class="cta-block__cta">
316
+ <a href="https://www.ecwid.com/blog/how-to-connect-ecwid-with-2000-online-business-tools.html?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Learn More', 'ecwid-shopping-cart' ); ?></span> </a>
317
  </div>
318
  </div>
319
  </div>
332
  <div class="cta-block">
333
  <div class="cta-block__central">
334
  <div class="cta-block__title">
335
+ <?php echo esc_html__( 'API for catalog and sales', 'ecwid-shopping-cart' ); ?>
336
  </div>
337
  <div class="cta-block__content">
338
+ <?php echo esc_html__( 'Use a powerful RESTful API to manage your store, mass update your product catalog and orders.', 'ecwid-shopping-cart' ); ?>
339
  </div>
340
  </div>
341
  <div class="cta-block__cta">
342
+ <a href="https://api-docs.ecwid.com/reference/rest-api?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Learn More', 'ecwid-shopping-cart' ); ?></span> </a>
343
  </div>
344
  </div>
345
  </div>
352
  <div class="named-area__header">
353
  <div class="named-area__titles">
354
  <div class="named-area__title">
355
+ <?php echo esc_html__( 'Partnership', 'ecwid-shopping-cart' ); ?>
356
  </div>
357
  <div class="named-area__subtitle">
358
+ <?php echo wp_kses_post( sprintf( __( 'Join our partnership program to build and scale your offering in ecommerce. <a %s>More about partnership</a>', 'ecwid-shopping-cart' ), 'href="https://www.ecwid.com/partners/?utm_source=wp-plugin" target="_blank"' ) ); ?>
359
  </div>
360
  </div>
361
  <div class="named-area__description"></div>
374
  <div class="cta-block">
375
  <div class="cta-block__central">
376
  <div class="cta-block__title">
377
+ <?php echo esc_html__( 'Become an Ecwid Referral Partner', 'ecwid-shopping-cart' ); ?>
378
  </div>
379
  <div class="cta-block__content">
380
+ <?php echo esc_html__( 'Recommend Ecwid within your network and get a 20% lifetime commission for every referral that creates an account through your link.', 'ecwid-shopping-cart' ); ?>
381
  </div>
382
  </div>
383
  <div class="cta-block__cta">
384
+ <a href="https://www.ecwid.com/partners/referral?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Learn More', 'ecwid-shopping-cart' ); ?></span> </a>
385
  </div>
386
  </div>
387
  </div>
400
  <div class="cta-block">
401
  <div class="cta-block__central">
402
  <div class="cta-block__title">
403
+ <?php echo esc_html__( 'Promote your services as Ecwid Expert', 'ecwid-shopping-cart' ); ?>
404
  </div>
405
  <div class="cta-block__content">
406
+ <?php echo esc_html__( 'Join our community of experts and promote your services to clients who need help with store setup, design, or customization.', 'ecwid-shopping-cart' ); ?>
407
  </div>
408
  </div>
409
  <div class="cta-block__cta">
410
+ <a href="https://www.ecwid.com/experts?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Learn More', 'ecwid-shopping-cart' ); ?></span> </a>
411
  </div>
412
  </div>
413
  </div>
426
  <div class="cta-block">
427
  <div class="cta-block__central">
428
  <div class="cta-block__title">
429
+ <?php echo esc_html__( 'Use Ecwid premium plan for free', 'ecwid-shopping-cart' ); ?>
430
  </div>
431
  <div class="cta-block__content">
432
+ <?php echo esc_html__( 'If you’re developing sites on WordPress, you can get a free subscription to the Ecwid premium plan. Use it to build and test stores on the WordPress sites, check out the platform features, and get access to Ecwid API. Just apply for the free subscription, and we’ll get in touch with you soon.', 'ecwid-shopping-cart' ); ?>
433
  </div>
434
  </div>
435
  <div class="cta-block__cta">
436
+ <a href="https://ecommerce-store.typeform.com/to/Heh5d4?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Apply for Free Plan', 'ecwid-shopping-cart' ); ?></span> </a>
437
  </div>
438
  </div>
439
  </div>
446
  <div class="named-area__header">
447
  <div class="named-area__titles">
448
  <div class="named-area__title">
449
+ <?php echo esc_html__( 'Need a hand?', 'ecwid-shopping-cart' ); ?>
450
  </div>
451
  <div class="named-area__subtitle"></div>
452
  </div>
466
  <div class="cta-block">
467
  <div class="cta-block__central">
468
  <div class="cta-block__title">
469
+ <?php echo esc_html__( 'Join developer community on Slack', 'ecwid-shopping-cart' ); ?>
470
  </div>
471
  <div class="cta-block__content">
472
+ <?php echo esc_html__( 'Join the community of professionals to get help with questions that are not covered by Help Center or API documentation.', 'ecwid-shopping-cart' ); ?>
473
  </div>
474
  </div>
475
  <div class="cta-block__cta">
490
  <div class="cta-block">
491
  <div class="cta-block__central">
492
  <div class="cta-block__title">
493
+ <?php echo esc_html__( 'Request custom development', 'ecwid-shopping-cart' ); ?>
494
  </div>
495
  <div class="cta-block__content">
496
+ <?php echo esc_html__( 'The Ecwid team can help you build the desired features and options that Ecwid does not have out of the box — from integrations with other tools to your own mobile app. Custom development is a paid service, the price depends on the complexity of the request.', 'ecwid-shopping-cart' ); ?>
497
  </div>
498
  </div>
499
  <div class="cta-block__cta">
500
+ <a href="https://support.ecwid.com/hc/en-us/articles/115005821245?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Submit Request', 'ecwid-shopping-cart' ); ?></span> </a>
501
  </div>
502
  </div>
503
  </div>
516
  <div class="cta-block">
517
  <div class="cta-block__central">
518
  <div class="cta-block__title">
519
+ <?php echo esc_html__( 'Leave feedback', 'ecwid-shopping-cart' ); ?>
520
  </div>
521
  <div class="cta-block__content">
522
+ <?php echo esc_html__( 'Tell us what can be improved regarding Ecwid features, integrations, and functionality.', 'ecwid-shopping-cart' ); ?>
523
  </div>
524
  </div>
525
  <div class="cta-block__cta">
526
+ <a href="https://ecommerce-store.typeform.com/to/qMgJpSBq?utm_source=wp-plugin#store_id=<?php echo esc_attr( get_ecwid_store_id() ); ?>&email=<?php echo esc_attr( $admin_email ); ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html__( 'Leave Feedback', 'ecwid-shopping-cart' ); ?></span> </a>
527
  </div>
528
  </div>
529
  </div>
templates/admin/legacy-connect.tpl.php CHANGED
@@ -1,81 +1,86 @@
1
  <div class="wrap ecwid-admin">
2
-
3
- <div class="ec-store-box">
4
  <?php require ECWID_PLUGIN_DIR . 'templates/admin-head.php'; ?>
5
 
6
- <form method="POST" action="options.php" class="pure-form ecwid-settings general-settings">
7
- <?php settings_fields('ecwid_options_page'); ?>
8
- <fieldset>
9
-
10
- <input type="hidden" name="settings_section" value="general" />
11
-
12
- <div class="greeting-box">
13
-
14
- <div class="image-container">
15
- <img class="greeting-image" src="<?php echo( esc_attr ( ECWID_PLUGIN_URL ) ); ?>/images/store_inprogress.png" width="142" />
16
- </div>
17
-
18
- <div class="messages-container">
19
- <div class="main-message">
20
-
21
- <?php printf( __('Thank you for choosing %s to build your online store', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
22
- </div>
23
- <div class="secondary-message">
24
- <?php _e('The first step towards opening your online business: <br />Let’s get started and add a store to your WordPress website in <strong>3</strong> simple steps.', 'ecwid-shopping-cart'); ?>
25
- </div>
26
- </div>
27
-
28
- </div>
29
- <hr />
30
-
31
- <ol>
32
- <li>
33
- <h4><?php printf( __('Register at %s', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></h4>
34
- <div>
35
- <?php printf( __('Create a new %s account which you will use to manage your store and inventory. The registration is free.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
36
- </div>
37
- <div class="ecwid-account-buttons">
38
 
39
- <?php if(!$this->_is_registration_blocked_locale()) {?>
40
- <a class="pure-button pure-button-secondary" target="_blank" href="<?php echo ecwid_get_register_link(); ?>">
41
- <?php _e('Create new account', 'ecwid-shopping-cart'); ?>
42
- </a>
43
- <?php } ?>
44
 
45
- <a class="pure-button pure-button-secondary" target="_blank" href="https://<?php echo Ecwid_Config::get_cpanel_domain(); ?>">
46
- <?php _e('I already have an account, sign in', 'ecwid-shopping-cart'); ?>
47
- </a>
48
- </div>
49
- <div class="note">
50
- <?php _e('You will be able to sign up through your existing Google, Facebook or PayPal profiles as well.', 'ecwid-shopping-cart'); ?>
51
- </div>
52
- </li>
53
- <li>
54
- <h4><?php _e('Find your Store ID', 'ecwid-shopping-cart'); ?></h4>
55
- <div>
56
- <?php printf( __('Store ID is a unique identifier of any %1$s store, it consists of several digits. You can find it on the "Dashboard" page of %1$s control panel. Also the Store ID will be sent in the Welcome email after the registration.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
57
- </div>
58
- </li>
59
- <li>
60
- <h4>
61
- <?php _e('Enter your Store ID', 'ecwid-shopping-cart'); ?>
62
- </h4>
63
- <div><label for="ecwid_store_id"><?php _e('Enter your Store ID here:', 'ecwid-shopping-cart'); ?></label></div>
64
- <div class="pure-control-group store-id">
65
- <input
66
- id="ecwid_store_id"
67
- name="ecwid_store_id"
68
- type="text"
69
- placeholder="<?php _e('Store ID', 'ecwid-shopping-cart'); ?>"
70
- value="<?php if ( !ecwid_is_demo_store() ) echo esc_attr( get_ecwid_store_id() ); ?>"
71
- />
72
- <button type="submit" class="<?php echo ECWID_MAIN_BUTTON_CLASS; ?>"><?php printf( __('Save and connect your %s store to the site', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></button>
73
- </div>
74
-
75
- </li>
76
- </ol>
77
- </fieldset>
78
- </form>
79
- </div>
 
 
 
 
 
80
  <?php require ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
81
  </div>
1
  <div class="wrap ecwid-admin">
2
+
3
+ <div class="ec-store-box">
4
  <?php require ECWID_PLUGIN_DIR . 'templates/admin-head.php'; ?>
5
 
6
+ <form method="POST" action="options.php" class="pure-form ecwid-settings general-settings">
7
+ <?php settings_fields( 'ecwid_options_page' ); ?>
8
+ <fieldset>
9
+
10
+ <input type="hidden" name="settings_section" value="general" />
11
+
12
+ <div class="greeting-box">
13
+
14
+ <div class="image-container">
15
+ <img class="greeting-image" src="<?php echo esc_attr( ECWID_PLUGIN_URL ); ?>/images/store_inprogress.png" width="142" />
16
+ </div>
17
+
18
+ <div class="messages-container">
19
+ <div class="main-message">
20
+
21
+ <?php echo esc_html( sprintf( __( 'Thank you for choosing %s to build your online store', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
22
+ </div>
23
+ <div class="secondary-message">
24
+ <?php echo wp_kses_post( __( 'The first step towards opening your online business: <br />Let’s get started and add a store to your WordPress website in <strong>3</strong> simple steps.', 'ecwid-shopping-cart' ) ); ?>
25
+ </div>
26
+ </div>
27
+
28
+ </div>
29
+ <hr />
30
+
31
+ <ol>
32
+ <li>
33
+ <h4><?php echo esc_html( sprintf( __( 'Register at %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?></h4>
34
+ <div>
35
+ <?php echo esc_html( sprintf( __( 'Create a new %s account which you will use to manage your store and inventory. The registration is free.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
36
+ </div>
37
+ <div class="ecwid-account-buttons">
38
 
39
+ <?php if ( ! $this->_is_registration_blocked_locale() ) { ?>
40
+ <a class="pure-button pure-button-secondary" target="_blank" href="<?php echo esc_url( ecwid_get_register_link() ); ?>">
41
+ <?php esc_html_e( 'Create new account', 'ecwid-shopping-cart' ); ?>
42
+ </a>
43
+ <?php } ?>
44
 
45
+ <a class="pure-button pure-button-secondary" target="_blank" href="<?php echo esc_url( 'https://' . Ecwid_Config::get_cpanel_domain() ); ?>">
46
+ <?php esc_html_e( 'I already have an account, sign in', 'ecwid-shopping-cart' ); ?>
47
+ </a>
48
+ </div>
49
+ <div class="note">
50
+ <?php esc_html_e( 'You will be able to sign up through your existing Google, Facebook or PayPal profiles as well.', 'ecwid-shopping-cart' ); ?>
51
+ </div>
52
+ </li>
53
+ <li>
54
+ <h4><?php esc_html_e( 'Find your Store ID', 'ecwid-shopping-cart' ); ?></h4>
55
+ <div>
56
+ <?php echo esc_html( sprintf( __( 'Store ID is a unique identifier of any %1$s store, it consists of several digits. You can find it on the "Dashboard" page of %1$s control panel. Also the Store ID will be sent in the Welcome email after the registration.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
57
+ </div>
58
+ </li>
59
+ <li>
60
+ <h4>
61
+ <?php esc_html_e( 'Enter your Store ID', 'ecwid-shopping-cart' ); ?>
62
+ </h4>
63
+ <div><label for="ecwid_store_id"><?php esc_html_e( 'Enter your Store ID here:', 'ecwid-shopping-cart' ); ?></label></div>
64
+ <div class="pure-control-group store-id">
65
+ <input
66
+ id="ecwid_store_id"
67
+ name="ecwid_store_id"
68
+ type="text"
69
+ placeholder="<?php esc_html_e( 'Store ID', 'ecwid-shopping-cart' ); ?>"
70
+ value="
71
+ <?php
72
+ if ( ! ecwid_is_demo_store() ) {
73
+ echo esc_attr( get_ecwid_store_id() );}
74
+ ?>
75
+ "
76
+ />
77
+ <button type="submit" class="<?php echo esc_attr( ECWID_MAIN_BUTTON_CLASS ); ?>"><?php echo esc_html( sprintf( __( 'Save and connect your %s store to the site', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?></button>
78
+ </div>
79
+
80
+ </li>
81
+ </ol>
82
+ </fieldset>
83
+ </form>
84
+ </div>
85
  <?php require ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
86
  </div>
templates/admin/simple-dashboard.php CHANGED
@@ -2,68 +2,66 @@
2
  <div class="ec-store-box">
3
  <div class="head">
4
  <?php
5
- if( !Ecwid_Config::is_wl() ) {
6
  ecwid_embed_svg( 'ecwid-logo-blue' );
7
  }
8
  ?>
9
  <h3>
10
- <?php printf( __( '%s Shopping Cart', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
11
  </h3>
12
  <div class="store-id drop-down">
13
  <span>
14
- <?php _e( 'Store ID', 'ecwid-shopping-cart' ); ?> : <?php echo get_ecwid_store_id(); ?>
15
  </span>
16
  <ul>
17
  <li>
18
- <a href="admin.php?page=ec-store&reconnect"><?php _e( 'Disconnect store', 'ecwid-shopping-cart' ); ?></a>
19
  </li>
20
  </ul>
21
  </div>
22
  </div>
23
  <div class="body">
24
  <div class="greeting-image">
25
- <img src="<?php echo( esc_attr( ECWID_PLUGIN_URL )); ?>/images/store_ready.png" width="142" />
26
  </div>
27
 
28
  <div class="greeting">
29
- <?php if ( isset($_GET['settings-updated']) ): ?>
30
  <div class="greeting-title">
31
- <?php _e('Congratulations!', 'ecwid-shopping-cart'); ?>
32
  </div>
33
  <div class="greeting-message mobile-br">
34
- <?php printf( __( 'Your %s store is now connected<br /> to your WordPress website', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
35
  </div>
36
- <?php else: ?>
37
 
38
  <div class="greeting-title">
39
- <?php _e('Greetings!', 'ecwid-shopping-cart'); ?>
40
  </div>
41
  <div class="greeting-message mobile-br">
42
- <?php printf( __( 'Your %s store is connected<br /> to your WordPress website', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
43
  </div>
44
  <?php endif; ?>
45
 
46
  <ul class="greeting-links">
47
  <li>
48
- <a target="_blank" href="<?php echo Ecwid_Store_Page::get_store_url(); ?>"><?php _e('Visit storefront', 'ecwid-shopping-cart'); ?></a>
49
  </li>
50
  <li>
51
  <a target="_blank"
52
- <?php if ( Ecwid_Api_V3::is_available() && ecwid_get_admin_sso_url(time(), '') ): ?>
53
- href="admin-post.php?action=ecwid-do-sso"
54
- <?php else: ?>
55
- href="//<?php echo Ecwid_Config::get_cpanel_domain(); ?>/cp"
56
- <?php endif; ?>
57
-
58
- ><?php _e('Open control panel', 'ecwid-shopping-cart'); ?></a>
59
  </li>
60
  </ul>
61
 
62
-
63
-
64
  </div>
65
  </div>
66
  </div>
67
 
68
  <?php require ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
69
- </div>
2
  <div class="ec-store-box">
3
  <div class="head">
4
  <?php
5
+ if ( ! Ecwid_Config::is_wl() ) {
6
  ecwid_embed_svg( 'ecwid-logo-blue' );
7
  }
8
  ?>
9
  <h3>
10
+ <?php echo esc_html( sprintf( __( '%s Shopping Cart', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
11
  </h3>
12
  <div class="store-id drop-down">
13
  <span>
14
+ <?php esc_html_e( 'Store ID', 'ecwid-shopping-cart' ); ?> : <?php echo esc_html( get_ecwid_store_id() ); ?>
15
  </span>
16
  <ul>
17
  <li>
18
+ <a href="admin.php?page=ec-store&reconnect"><?php esc_html_e( 'Disconnect store', 'ecwid-shopping-cart' ); ?></a>
19
  </li>
20
  </ul>
21
  </div>
22
  </div>
23
  <div class="body">
24
  <div class="greeting-image">
25
+ <img src="<?php echo esc_attr( ECWID_PLUGIN_URL ); ?>/images/store_ready.png" width="142" />
26
  </div>
27
 
28
  <div class="greeting">
29
+ <?php if ( isset( $_GET['settings-updated'] ) ) : ?>
30
  <div class="greeting-title">
31
+ <?php esc_html_e( 'Congratulations!', 'ecwid-shopping-cart' ); ?>
32
  </div>
33
  <div class="greeting-message mobile-br">
34
+ <?php echo wp_kses_post( sprintf( __( 'Your %s store is now connected<br /> to your WordPress website', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
35
  </div>
36
+ <?php else : ?>
37
 
38
  <div class="greeting-title">
39
+ <?php esc_html_e( 'Greetings!', 'ecwid-shopping-cart' ); ?>
40
  </div>
41
  <div class="greeting-message mobile-br">
42
+ <?php echo wp_kses_post( sprintf( __( 'Your %s store is connected<br /> to your WordPress website', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
43
  </div>
44
  <?php endif; ?>
45
 
46
  <ul class="greeting-links">
47
  <li>
48
+ <a target="_blank" href="<?php echo esc_url( Ecwid_Store_Page::get_store_url() ); ?>"><?php esc_html_e( 'Visit storefront', 'ecwid-shopping-cart' ); ?></a>
49
  </li>
50
  <li>
51
  <a target="_blank"
52
+ <?php if ( Ecwid_Api_V3::is_available() && ecwid_get_admin_sso_url( time(), '' ) ) : ?>
53
+ href="admin-post.php?action=ecwid-do-sso"
54
+ <?php else : ?>
55
+ href="<?php echo esc_url( 'https://' . Ecwid_Config::get_cpanel_domain() ); ?>/cp"
56
+ <?php endif; ?>
57
+
58
+ ><?php esc_html_e( 'Open control panel', 'ecwid-shopping-cart' ); ?></a>
59
  </li>
60
  </ul>
61
 
 
 
62
  </div>
63
  </div>
64
  </div>
65
 
66
  <?php require ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
67
+ </div>
templates/admin/storefront/area-additional.php CHANGED
@@ -1,7 +1,7 @@
1
  <div class="named-area" data-ec-state="publish draft">
2
  <div class="named-area__header">
3
- <div class="named-area__titles"><div class="named-area__title"><?php _e( 'Additional store pages', 'ecwid-shopping-cart'); ?></div></div>
4
- <div class="named-area__description"><?php _e( 'Highlight products, categories, and other store pages by adding them to separate website pages.', 'ecwid-shopping-cart'); ?></div>
5
  </div>
6
  <div class="named-area__body">
7
 
@@ -18,13 +18,13 @@
18
  <div class="iconable-block__content">
19
  <div class="cta-block">
20
  <div class="cta-block__central">
21
- <div class="cta-block__title"><?php _e( 'Add cart and checkout page', 'ecwid-shopping-cart'); ?></div>
22
  <div class="cta-block__content">
23
- <?php _e( 'Customers go to the cart page to review products they’ve added to the cart and proceed to the checkout.', 'ecwid-shopping-cart'); ?>
24
  </div>
25
  </div>
26
  <div class="cta-block__cta">
27
- <a href="#" class="btn btn-default btn-medium" data-storefront-create-page="cart"><?php _e( 'Create Cart Page', 'ecwid-shopping-cart'); ?></a>
28
  </div>
29
  </div>
30
  </div>
@@ -45,13 +45,13 @@
45
  <div class="iconable-block__content">
46
  <div class="cta-block">
47
  <div class="cta-block__central">
48
- <div class="cta-block__title"><?php _e( 'Add a search and filters page', 'ecwid-shopping-cart'); ?></div>
49
  <div class="cta-block__content">
50
- <?php _e( 'Show customers that they can use a search and filters to find desired products faster.', 'ecwid-shopping-cart'); ?>
51
  </div>
52
  </div>
53
  <div class="cta-block__cta">
54
- <a href="#" class="btn btn-default btn-medium" data-storefront-create-page="search"><?php _e( 'Create Search Page', 'ecwid-shopping-cart'); ?></a>
55
  </div>
56
  </div>
57
  </div>
@@ -72,42 +72,44 @@
72
  <div class="iconable-block__content">
73
  <div class="cta-block">
74
  <div class="cta-block__central">
75
- <div class="cta-block__title"><?php _e( 'Add a category page', 'ecwid-shopping-cart'); ?></div>
76
  <div class="cta-block__content">
77
  <?php
78
- if( $categories && count($categories) > 0 && count($categories) <= 100 ) {
79
- _e( 'Feature a specific store category on a separate page of your site.', 'ecwid-shopping-cart');
80
  } else {
81
- _e( 'Feature a specific store category on a separate page of your site.', 'ecwid-shopping-cart');
82
  }
83
  ?>
84
  </div>
85
  </div>
86
  <div class="cta-block__cta">
87
 
88
- <?php if( $categories && count($categories) > 0 && count($categories) <= 100 ) { ?>
89
  <div class="btn-group dropdown-toggle drop-right">
90
  <button data-storefront-create-page="category" type="button" class="btn btn-default btn-medium" aria-hidden="true" style="display: none;"></button>
91
  <div class="btn btn-default btn-dropdown btn-medium list-dropdown-no-general-text">
92
  <span class="btn-dropdown-container">
93
- <span class="actions"><?php _e( 'Pick Category', 'ecwid-shopping-cart'); ?></span>
94
  </span>
95
  <span class="icon-arr-down"></span>
96
  </div>
97
  <div class="list-dropdown list-dropdown-medium list-dropdown-scroll">
98
  <ul>
99
- <?php foreach( $categories as $category ) {?>
100
  <li
101
  data-storefront-create-page="category"
102
- data-storefront-item-id="<?php echo $category->id?>"
103
- ><a><?php echo $category->name?></a></li>
104
  <?php } ?>
105
  </ul>
106
  </div>
107
  </div>
108
- <?php } else {?>
109
- <a href="#" class="btn btn-default btn-medium" data-storefront-create-page="category"><?php _e( 'Create Category Page', 'ecwid-shopping-cart'); ?></a>
110
- <?php } ?>
 
 
111
 
112
  </div>
113
  </div>
@@ -129,42 +131,44 @@
129
  <div class="iconable-block__content">
130
  <div class="cta-block">
131
  <div class="cta-block__central">
132
- <div class="cta-block__title"><?php _e( 'Add a product page', 'ecwid-shopping-cart'); ?></div>
133
  <div class="cta-block__content">
134
  <?php
135
- if( $products_total > 0 && $products_total <= 100 ) {
136
- _e( 'Create a landing page featuring one of your products.', 'ecwid-shopping-cart');
137
  } else {
138
- _e( 'Create a landing page featuring one of your products.', 'ecwid-shopping-cart');
139
  }
140
  ?>
141
  </div>
142
  </div>
143
  <div class="cta-block__cta">
144
 
145
- <?php if( $products_total > 0 && $products_total <= 100 ) { ?>
146
  <div class="btn-group dropdown-toggle drop-right">
147
  <button data-storefront-create-page="category" type="button" class="btn btn-default btn-medium" aria-hidden="true" style="display: none;"></button>
148
  <div class="btn btn-default btn-dropdown btn-medium list-dropdown-no-general-text">
149
  <span class="btn-dropdown-container">
150
- <span class="actions"><?php _e( 'Pick Product', 'ecwid-shopping-cart'); ?></span>
151
  </span>
152
  <span class="icon-arr-down"></span>
153
  </div>
154
  <div class="list-dropdown list-dropdown-medium list-dropdown-scroll">
155
  <ul>
156
- <?php foreach( $products as $product ) {?>
157
  <li
158
  data-storefront-create-page="product"
159
- data-storefront-item-id="<?php echo $product->id?>"
160
- ><a><?php echo $product->name?></a></li>
161
  <?php } ?>
162
  </ul>
163
  </div>
164
  </div>
165
- <?php } else {?>
166
- <a href="#" class="btn btn-default btn-medium" data-storefront-create-page="product"><?php _e( 'Create Product Page', 'ecwid-shopping-cart'); ?></a>
167
- <?php } ?>
 
 
168
 
169
  </div>
170
  </div>
@@ -186,18 +190,20 @@
186
  <div class="iconable-block__content">
187
  <div class="cta-block">
188
  <div class="cta-block__central">
189
- <div class="cta-block__title"><?php _e( 'Add your store to other site pages', 'ecwid-shopping-cart'); ?></div>
190
  <div class="cta-block__content">
191
  <?php
192
- echo sprintf(
193
- __( 'You can add the entire storefront, categories, products, or "Buy now" buttons to other pages on your site. To do that, open a page in the editor and add an appropriate %s block.', 'ecwid-shopping-cart'),
194
- Ecwid_Config::get_brand()
 
 
195
  );
196
  ?>
197
  </div>
198
  </div>
199
  <div class="cta-block__cta">
200
- <a href="<?php echo admin_url( 'edit.php?post_type=page' ); ?>" target="_blank" class="btn btn-default btn-medium"><?php _e( 'Go to Pages', 'ecwid-shopping-cart'); ?></a>
201
  </div>
202
  </div>
203
  </div>
@@ -205,7 +211,7 @@
205
  </div>
206
  </div>
207
 
208
- <?php if( $store_pages ) { ?>
209
  <div class="a-card a-card--compact">
210
  <div class="a-card__paddings">
211
  <div class="iconable-block iconable-block--hide-in-mobile">
@@ -219,23 +225,23 @@
219
  <div class="iconable-block__content">
220
  <div class="cta-block">
221
  <div class="cta-block__central">
222
- <div class="cta-block__title"><?php _e( 'Choose the main store page', 'ecwid-shopping-cart'); ?></div>
223
  <div class="cta-block__content">
224
- <?php _e( 'Your store is added to several pages on the site. Choose the main page. Customers are directed to the main store page when they click on the cart icon, store links in the site menu, and products in the sidebar.', 'ecwid-shopping-cart'); ?>
225
  </div>
226
  <div class="cta-block__content">
227
 
228
  <div class="fieldset fieldset--select fieldset--no-label">
229
  <div class="field field--medium field--filled">
230
  <select class="field__select" data-storefront-save-main-page="1">
231
- <?php foreach ( $store_pages as $id ): ?>
232
- <option
233
- value="<?php echo $id; ?>"
234
- <?php if ( $id == $page_id ): ?>
235
- selected="selected"
236
- <?php endif; ?>
237
- ><?php esc_html_e( get_post( $id )->post_title ); ?></option>
238
- <?php endforeach; ?>
239
  </select>
240
  <span class="field__arrow"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" focusable="false"><path d="M7.85 10l5.02 4.9 5.27-4.9c.65-.66 1.71-.66 2.36 0 .65.67.65 1.74 0 2.4l-6.45 6.1c-.33.33-.76.5-1.18.5-.43 0-.86-.17-1.18-.5l-6.21-6.1c-.65-.66-.65-1.74 0-2.41.66-.65 1.72-.65 2.37.01z"></path></svg></span>
241
  </div>
@@ -249,7 +255,9 @@
249
  </div>
250
  </div>
251
  </div>
252
- <?php } ?>
 
 
253
 
254
  </div>
255
- </div>
1
  <div class="named-area" data-ec-state="publish draft">
2
  <div class="named-area__header">
3
+ <div class="named-area__titles"><div class="named-area__title"><?php esc_html_e( 'Additional store pages', 'ecwid-shopping-cart' ); ?></div></div>
4
+ <div class="named-area__description"><?php esc_html_e( 'Highlight products, categories, and other store pages by adding them to separate website pages.', 'ecwid-shopping-cart' ); ?></div>
5
  </div>
6
  <div class="named-area__body">
7
 
18
  <div class="iconable-block__content">
19
  <div class="cta-block">
20
  <div class="cta-block__central">
21
+ <div class="cta-block__title"><?php esc_html_e( 'Add cart and checkout page', 'ecwid-shopping-cart' ); ?></div>
22
  <div class="cta-block__content">
23
+ <?php esc_html_e( 'Customers go to the cart page to review products they’ve added to the cart and proceed to the checkout.', 'ecwid-shopping-cart' ); ?>
24
  </div>
25
  </div>
26
  <div class="cta-block__cta">
27
+ <a href="#" class="btn btn-default btn-medium" data-storefront-create-page="cart"><?php esc_html_e( 'Create Cart Page', 'ecwid-shopping-cart' ); ?></a>
28
  </div>
29
  </div>
30
  </div>
45
  <div class="iconable-block__content">
46
  <div class="cta-block">
47
  <div class="cta-block__central">
48
+ <div class="cta-block__title"><?php esc_html_e( 'Add a search and filters page', 'ecwid-shopping-cart' ); ?></div>
49
  <div class="cta-block__content">
50
+ <?php esc_html_e( 'Show customers that they can use a search and filters to find desired products faster.', 'ecwid-shopping-cart' ); ?>
51
  </div>
52
  </div>
53
  <div class="cta-block__cta">
54
+ <a href="#" class="btn btn-default btn-medium" data-storefront-create-page="search"><?php esc_html_e( 'Create Search Page', 'ecwid-shopping-cart' ); ?></a>
55
  </div>
56
  </div>
57
  </div>
72
  <div class="iconable-block__content">
73
  <div class="cta-block">
74
  <div class="cta-block__central">
75
+ <div class="cta-block__title"><?php esc_html_e( 'Add a category page', 'ecwid-shopping-cart' ); ?></div>
76
  <div class="cta-block__content">
77
  <?php
78
+ if ( $categories && count( $categories ) > 0 && count( $categories ) <= 100 ) {
79
+ esc_html_e( 'Feature a specific store category on a separate page of your site.', 'ecwid-shopping-cart' );
80
  } else {
81
+ esc_html_e( 'Feature a specific store category on a separate page of your site.', 'ecwid-shopping-cart' );
82
  }
83
  ?>
84
  </div>
85
  </div>
86
  <div class="cta-block__cta">
87
 
88
+ <?php if ( $categories && count( $categories ) > 0 && count( $categories ) <= 100 ) { ?>
89
  <div class="btn-group dropdown-toggle drop-right">
90
  <button data-storefront-create-page="category" type="button" class="btn btn-default btn-medium" aria-hidden="true" style="display: none;"></button>
91
  <div class="btn btn-default btn-dropdown btn-medium list-dropdown-no-general-text">
92
  <span class="btn-dropdown-container">
93
+ <span class="actions"><?php esc_html_e( 'Pick Category', 'ecwid-shopping-cart' ); ?></span>
94
  </span>
95
  <span class="icon-arr-down"></span>
96
  </div>
97
  <div class="list-dropdown list-dropdown-medium list-dropdown-scroll">
98
  <ul>
99
+ <?php foreach ( $categories as $category ) { ?>
100
  <li
101
  data-storefront-create-page="category"
102
+ data-storefront-item-id="<?php echo esc_attr( $category->id ); ?>"
103
+ ><a><?php echo esc_html( $category->name ); ?></a></li>
104
  <?php } ?>
105
  </ul>
106
  </div>
107
  </div>
108
+ <?php } else { ?>
109
+ <a href="#" class="btn btn-default btn-medium" data-storefront-create-page="category"><?php esc_html_e( 'Create Category Page', 'ecwid-shopping-cart' ); ?></a>
110
+ <?php
111
+ }//end if
112
+ ?>
113
 
114
  </div>
115
  </div>
131
  <div class="iconable-block__content">
132
  <div class="cta-block">
133
  <div class="cta-block__central">
134
+ <div class="cta-block__title"><?php esc_html_e( 'Add a product page', 'ecwid-shopping-cart' ); ?></div>
135
  <div class="cta-block__content">
136
  <?php
137
+ if ( $products_total > 0 && $products_total <= 100 ) {
138
+ esc_html_e( 'Create a landing page featuring one of your products.', 'ecwid-shopping-cart' );
139
  } else {
140
+ esc_html_e( 'Create a landing page featuring one of your products.', 'ecwid-shopping-cart' );
141
  }
142
  ?>
143
  </div>
144
  </div>
145
  <div class="cta-block__cta">
146
 
147
+ <?php if ( $products_total > 0 && $products_total <= 100 ) { ?>
148
  <div class="btn-group dropdown-toggle drop-right">
149
  <button data-storefront-create-page="category" type="button" class="btn btn-default btn-medium" aria-hidden="true" style="display: none;"></button>
150
  <div class="btn btn-default btn-dropdown btn-medium list-dropdown-no-general-text">
151
  <span class="btn-dropdown-container">
152
+ <span class="actions"><?php esc_html_e( 'Pick Product', 'ecwid-shopping-cart' ); ?></span>
153
  </span>
154
  <span class="icon-arr-down"></span>
155
  </div>
156
  <div class="list-dropdown list-dropdown-medium list-dropdown-scroll">
157
  <ul>
158
+ <?php foreach ( $products as $product ) { ?>
159
  <li
160
  data-storefront-create-page="product"
161
+ data-storefront-item-id="<?php echo esc_attr( $product->id ); ?>"
162
+ ><a><?php echo esc_html( $product->name ); ?></a></li>
163
  <?php } ?>
164
  </ul>
165
  </div>
166
  </div>
167
+ <?php } else { ?>
168
+ <a href="#" class="btn btn-default btn-medium" data-storefront-create-page="product"><?php esc_html_e( 'Create Product Page', 'ecwid-shopping-cart' ); ?></a>
169
+ <?php
170
+ }//end if
171
+ ?>
172
 
173
  </div>
174
  </div>
190
  <div class="iconable-block__content">
191
  <div class="cta-block">
192
  <div class="cta-block__central">
193
+ <div class="cta-block__title"><?php esc_html_e( 'Add your store to other site pages', 'ecwid-shopping-cart' ); ?></div>
194
  <div class="cta-block__content">
195
  <?php
196
+ echo esc_html(
197
+ sprintf(
198
+ __( 'You can add the entire storefront, categories, products, or "Buy now" buttons to other pages on your site. To do that, open a page in the editor and add an appropriate %s block.', 'ecwid-shopping-cart' ),
199
+ Ecwid_Config::get_brand()
200
+ )
201
  );
202
  ?>
203
  </div>
204
  </div>
205
  <div class="cta-block__cta">
206
+ <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=page' ) ); ?>" target="_blank" class="btn btn-default btn-medium"><?php esc_html_e( 'Go to Pages', 'ecwid-shopping-cart' ); ?></a>
207
  </div>
208
  </div>
209
  </div>
211
  </div>
212
  </div>
213
 
214
+ <?php if ( $store_pages ) { ?>
215
  <div class="a-card a-card--compact">
216
  <div class="a-card__paddings">
217
  <div class="iconable-block iconable-block--hide-in-mobile">
225
  <div class="iconable-block__content">
226
  <div class="cta-block">
227
  <div class="cta-block__central">
228
+ <div class="cta-block__title"><?php esc_html_e( 'Choose the main store page', 'ecwid-shopping-cart' ); ?></div>
229
  <div class="cta-block__content">
230
+ <?php esc_html_e( 'Your store is added to several pages on the site. Choose the main page. Customers are directed to the main store page when they click on the cart icon, store links in the site menu, and products in the sidebar.', 'ecwid-shopping-cart' ); ?>
231
  </div>
232
  <div class="cta-block__content">
233
 
234
  <div class="fieldset fieldset--select fieldset--no-label">
235
  <div class="field field--medium field--filled">
236
  <select class="field__select" data-storefront-save-main-page="1">
237
+ <?php foreach ( $store_pages as $id ) : ?>
238
+ <option
239
+ value="<?php echo esc_attr( $id ); ?>"
240
+ <?php if ( $id == $page_id ) : ?>
241
+ selected="selected"
242
+ <?php endif; ?>
243
+ ><?php esc_html_e( get_post( $id )->post_title ); ?></option>
244
+ <?php endforeach; ?>
245
  </select>
246
  <span class="field__arrow"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" focusable="false"><path d="M7.85 10l5.02 4.9 5.27-4.9c.65-.66 1.71-.66 2.36 0 .65.67.65 1.74 0 2.4l-6.45 6.1c-.33.33-.76.5-1.18.5-.43 0-.86-.17-1.18-.5l-6.21-6.1c-.65-.66-.65-1.74 0-2.41.66-.65 1.72-.65 2.37.01z"></path></svg></span>
247
  </div>
255
  </div>
256
  </div>
257
  </div>
258
+ <?php
259
+ }//end if
260
+ ?>
261
 
262
  </div>
263
+ </div>
templates/admin/storefront/area-design.php CHANGED
@@ -1,7 +1,7 @@
1
  <div class="named-area" data-ec-state="publish draft">
2
  <div class="named-area__header">
3
- <div class="named-area__titles"><div class="named-area__title"><?php _e( 'Design and content', 'ecwid-shopping-cart'); ?></div></div>
4
- <div class="named-area__description"><?php _e( 'Personalize your storefront\'s appearance and edit the content on the store page to reflect your brand and stay connected with your customers.', 'ecwid-shopping-cart'); ?></div>
5
  </div>
6
  <div class="named-area__body">
7
 
@@ -18,19 +18,19 @@
18
  <div class="iconable-block__content">
19
  <div class="cta-block">
20
  <div class="cta-block__central">
21
- <div class="cta-block__title"><?php _e( 'Store appearance', 'ecwid-shopping-cart'); ?></div>
22
  <div class="cta-block__content">
23
  <?php
24
- if( self::is_gutenberg_active() ) {
25
- _e( 'Adjust your store design to fit your business needs.', 'ecwid-shopping-cart');
26
  } else {
27
- _e( 'Adjust your store design to fit your business needs.', 'ecwid-shopping-cart');
28
  }
29
  ?>
30
  </div>
31
  </div>
32
  <div class="cta-block__cta">
33
- <a href="<?php echo $design_edit_link;?>" target="_blank" class="btn btn-default btn-medium"><?php _e( 'Edit', 'ecwid-shopping-cart'); ?></a>
34
  </div>
35
  </div>
36
  </div>
@@ -51,12 +51,12 @@
51
  <div class="iconable-block__content">
52
  <div class="cta-block">
53
  <div class="cta-block__central">
54
- <div class="cta-block__title"><?php _e( 'Store page content', 'ecwid-shopping-cart'); ?></div>
55
- <div class="cta-block__content"><?php _e( 'Along with the store catalog, you can add other widgets and texts to the store page.', 'ecwid-shopping-cart'); ?></div>
56
  </div>
57
  <div class="cta-block__cta">
58
- <a href="<?php echo $page_edit_link; ?>" target="_blank" class="btn btn-default btn-medium">
59
- <?php _e( 'Edit', 'ecwid-shopping-cart'); ?>
60
  </a>
61
  </div>
62
  </div>
@@ -67,4 +67,4 @@
67
 
68
 
69
  </div>
70
- </div>
1
  <div class="named-area" data-ec-state="publish draft">
2
  <div class="named-area__header">
3
+ <div class="named-area__titles"><div class="named-area__title"><?php esc_html_e( 'Design and content', 'ecwid-shopping-cart' ); ?></div></div>
4
+ <div class="named-area__description"><?php esc_html_e( 'Personalize your storefront\'s appearance and edit the content on the store page to reflect your brand and stay connected with your customers.', 'ecwid-shopping-cart' ); ?></div>
5
  </div>
6
  <div class="named-area__body">
7
 
18
  <div class="iconable-block__content">
19
  <div class="cta-block">
20
  <div class="cta-block__central">
21
+ <div class="cta-block__title"><?php esc_html_e( 'Store appearance', 'ecwid-shopping-cart' ); ?></div>
22
  <div class="cta-block__content">
23
  <?php
24
+ if ( self::is_gutenberg_active() ) {
25
+ esc_html_e( 'Adjust your store design to fit your business needs.', 'ecwid-shopping-cart' );
26
  } else {
27
+ esc_html_e( 'Adjust your store design to fit your business needs.', 'ecwid-shopping-cart' );
28
  }
29
  ?>
30
  </div>
31
  </div>
32
  <div class="cta-block__cta">
33
+ <a href="<?php echo esc_url( $design_edit_link ); ?>" target="_blank" class="btn btn-default btn-medium"><?php esc_html_e( 'Edit', 'ecwid-shopping-cart' ); ?></a>
34
  </div>
35
  </div>
36
  </div>
51
  <div class="iconable-block__content">
52
  <div class="cta-block">
53
  <div class="cta-block__central">
54
+ <div class="cta-block__title"><?php esc_html_e( 'Store page content', 'ecwid-shopping-cart' ); ?></div>
55
+ <div class="cta-block__content"><?php esc_html_e( 'Along with the store catalog, you can add other widgets and texts to the store page.', 'ecwid-shopping-cart' ); ?></div>
56
  </div>
57
  <div class="cta-block__cta">
58
+ <a href="<?php echo esc_url( $page_edit_link ); ?>" target="_blank" class="btn btn-default btn-medium">
59
+ <?php esc_html_e( 'Edit', 'ecwid-shopping-cart' ); ?>
60
  </a>
61
  </div>
62
  </div>
67
 
68
 
69
  </div>
70
+ </div>
templates/admin/storefront/area-navigation.php CHANGED
@@ -1,7 +1,7 @@
1
  <div class="named-area" data-ec-state="publish draft">
2
  <div class="named-area__header">
3
- <div class="named-area__titles"><div class="named-area__title"><?php _e( 'Navigation', 'ecwid-shopping-cart'); ?></div></div>
4
- <div class="named-area__description"><?php _e( 'Help customers find your store on the website.', 'ecwid-shopping-cart'); ?></div>
5
  </div>
6
  <div class="named-area__body">
7
 
@@ -18,23 +18,31 @@
18
  <div class="iconable-block__content">
19
  <div class="cta-block">
20
  <div class="cta-block__central">
21
- <div class="cta-block__title"><?php _e( 'Show your store on the home page', 'ecwid-shopping-cart'); ?></div>
22
  <div class="cta-block__content">
23
  <?php
24
  require self::$templates_dir . '/draft-message.php';
25
  ?>
26
 
27
- <div><?php
28
- echo sprintf(
29
- __( 'Add your storefront to the website home page to make it more prominent. You can also tweak the site home page settings in <a href="%s" target="_blank">WordPress Settings > Reading</a>', 'ecwid-shopping-cart'),
30
- admin_url( 'options-reading.php' )
 
 
 
31
  );
32
- ?></div>
 
33
  </div>
34
  </div>
35
  <div class="cta-block__cta">
36
  <label class="checkbox big">
37
- <input name="" type="checkbox" <?php if($store_on_front){?>checked=""<?php }?> data-storefront-checkbox="store_on_front">
 
 
 
 
38
  <div data-on="enabled" data-off="disabled">
39
  <div></div>
40
  </div>
@@ -48,16 +56,16 @@
48
  </div>
49
  </div>
50
 
51
- <?php if( Ecwid_Seo_Links::is_feature_available() ) {?>
52
 
53
  <div class="a-card a-card--normal" data-storefront-card="change-link-form" style="display: none;">
54
  <div class="a-card__paddings">
55
  <div class="form-area">
56
- <div class="form-area__title"><?php _e( 'Customize store page address', 'ecwid-shopping-cart'); ?></div>
57
  <div class="form-area__content">
58
  <div class="fieldsets-batch">
59
  <?php
60
- _e( 'A slug is the last part of a URL. You can create a custom slug for your store page. It’s better to keep it short since customers and search engines prefer short URLs. For example, use "/shop" or "/products".', 'ecwid-shopping-cart');
61
  ?>
62
  </div>
63
  <div class="fieldsets-batch">
@@ -65,18 +73,18 @@
65
  <div class="fieldset__field-wrapper">
66
  <div class="field field--medium">
67
  <label class="field__label"></label>
68
- <input type="text" class="field__input" maxlength="64" name="post_name" value="<?php echo $page_slug; ?>" data-ec-store-slug-input="1">
69
- <div class="field__placeholder"><?php _e( 'URL Slug', 'ecwid-shopping-cart' ); ?></div>
70
  </div>
71
- <div class="fieldset__field-prefix"><?php echo get_site_url();?>/</div>
72
  </div>
73
  <div class="field__error" aria-hidden="true" style="display: none;"></div>
74
  </div>
75
  </div>
76
  </div>
77
  <div class="form-area__action">
78
- <button type="button" class="btn btn-primary btn-medium" data-storefront-save-slug><?php _e( 'Save', 'ecwid-shopping-cart' ); ?></button>
79
- <button type="button" class="btn btn-link btn-medium" data-storefront-show-card="change-link"><?php _e( 'Cancel', 'ecwid-shopping-cart' ); ?></button>
80
  </div>
81
  </div>
82
  </div>
@@ -95,14 +103,19 @@
95
  <div class="iconable-block__content">
96
  <div class="cta-block">
97
  <div class="cta-block__central">
98
- <div class="cta-block__title"><?php _e( 'Customize store page address', 'ecwid-shopping-cart'); ?></div>
99
 
100
  <div class="cta-block__content" data-ec-state="publish">
101
- <b><?php echo sprintf(
102
- __( 'Current URL slug: /<span data-ec-store-slug>%s</span>', 'ecwid-shopping-cart' ),
103
- $page_slug
 
 
 
 
104
  );
105
- ?></b>
 
106
  </div>
107
 
108
  <div class="cta-block__content">
@@ -110,19 +123,21 @@
110
  require self::$templates_dir . '/draft-message.php';
111
  ?>
112
  <?php
113
- _e( 'A slug is the last part of a URL. You can create a custom slug for your store page. It’s better to keep it short since customers and search engines prefer short URLs. For example, use "/shop" or "/products".', 'ecwid-shopping-cart');
114
  ?>
115
  </div>
116
  </div>
117
  <div class="cta-block__cta">
118
- <a href="<?php echo $page_edit_link; ?>" target="_blank" class="btn btn-default btn-medium" data-storefront-show-card="change-link-form"><?php _e( 'Edit URL Slug', 'ecwid-shopping-cart'); ?></a>
119
  </div>
120
  </div>
121
  </div>
122
  </div>
123
  </div>
124
  </div>
125
- <?php } ?>
 
 
126
 
127
 
128
  <div class="a-card a-card--compact" data-ec-storefront-disabled-card="draft">
@@ -138,17 +153,17 @@
138
  <div class="iconable-block__content">
139
  <div class="cta-block">
140
  <div class="cta-block__central">
141
- <div class="cta-block__title"><?php _e( 'Add store page to the site menu', 'ecwid-shopping-cart'); ?></div>
142
  <div class="cta-block__content">
143
  <?php
144
  require self::$templates_dir . '/draft-message.php';
145
  ?>
146
 
147
- <div><?php _e( 'Make your store accessible from the site menu so your customers can easily find it.', 'ecwid-shopping-cart'); ?></div>
148
  </div>
149
  </div>
150
  <div class="cta-block__cta">
151
- <a href="<?php echo admin_url('nav-menus.php'); ?>" target="_blank" class="btn btn-default btn-medium"><?php _e( 'Add Store Page to Menu', 'ecwid-shopping-cart'); ?></a>
152
  </div>
153
  </div>
154
  </div>
@@ -170,13 +185,13 @@
170
  <div class="iconable-block__content">
171
  <div class="cta-block">
172
  <div class="cta-block__central">
173
- <div class="cta-block__title"><?php _e( 'Feature your products in the sidebar', 'ecwid-shopping-cart'); ?></div>
174
  <div class="cta-block__content">
175
- <?php _e( 'Highlight your best sellers or new products in the website sidebar.', 'ecwid-shopping-cart'); ?>
176
  </div>
177
  </div>
178
  <div class="cta-block__cta">
179
- <a href="<?php echo admin_url( 'widgets.php?highlight-ec-widgets=1' );?>" target="_blank" class="btn btn-default btn-medium"><?php _e( 'Manage Sidebar', 'ecwid-shopping-cart'); ?></a>
180
  </div>
181
  </div>
182
  </div>
@@ -184,7 +199,7 @@
184
  </div>
185
  </div>
186
 
187
- <?php if( class_exists( 'Ecwid_Floating_Minicart' ) ) {?>
188
  <div class="a-card a-card--compact">
189
  <div class="a-card__paddings">
190
  <div class="iconable-block iconable-block--hide-in-mobile">
@@ -198,19 +213,25 @@
198
  <div class="iconable-block__content">
199
  <div class="cta-block">
200
  <div class="cta-block__central">
201
- <div class="cta-block__title"><?php _e( 'Display the shopping cart icon on site pages', 'ecwid-shopping-cart'); ?></div>
202
  <div class="cta-block__content">
203
- <?php
204
- echo sprintf(
205
- __( 'The shopping cart icon shows the number of items in the cart and helps customers proceed to the checkout. Additionally, you can <a href="%s" target="_blank">adjust the cart icon appearance</a>.', 'ecwid-shopping-cart'),
206
- $customizer_minicart_link
 
 
207
  );
208
  ?>
209
  </div>
210
  </div>
211
  <div class="cta-block__cta">
212
  <label class="checkbox big">
213
- <input name="" type="checkbox" <?php if(!$minicart_hide) {?>checked=""<?php } ?> data-storefront-checkbox="display_cart_icon">
 
 
 
 
214
  <div data-on="enabled" data-off="disabled">
215
  <div></div>
216
  </div>
@@ -223,7 +244,9 @@
223
  </div>
224
  </div>
225
  </div>
226
- <?php } ?>
 
 
227
 
228
  </div>
229
- </div>
1
  <div class="named-area" data-ec-state="publish draft">
2
  <div class="named-area__header">
3
+ <div class="named-area__titles"><div class="named-area__title"><?php esc_html_e( 'Navigation', 'ecwid-shopping-cart' ); ?></div></div>
4
+ <div class="named-area__description"><?php esc_html_e( 'Help customers find your store on the website.', 'ecwid-shopping-cart' ); ?></div>
5
  </div>
6
  <div class="named-area__body">
7
 
18
  <div class="iconable-block__content">
19
  <div class="cta-block">
20
  <div class="cta-block__central">
21
+ <div class="cta-block__title"><?php esc_html_e( 'Show your store on the home page', 'ecwid-shopping-cart' ); ?></div>
22
  <div class="cta-block__content">
23
  <?php
24
  require self::$templates_dir . '/draft-message.php';
25
  ?>
26
 
27
+ <div>
28
+ <?php
29
+ echo wp_kses_post(
30
+ sprintf(
31
+ __( 'Add your storefront to the website home page to make it more prominent. You can also tweak the site home page settings in <a href="%s" target="_blank">WordPress Settings > Reading</a>', 'ecwid-shopping-cart' ),
32
+ admin_url( 'options-reading.php' )
33
+ )
34
  );
35
+ ?>
36
+ </div>
37
  </div>
38
  </div>
39
  <div class="cta-block__cta">
40
  <label class="checkbox big">
41
+ <input name="" type="checkbox"
42
+ <?php
43
+ if ( $store_on_front ) {
44
+ ?>
45
+ checked=""<?php } ?> data-storefront-checkbox="store_on_front">
46
  <div data-on="enabled" data-off="disabled">
47
  <div></div>
48
  </div>
56
  </div>
57
  </div>
58
 
59
+ <?php if ( Ecwid_Seo_Links::is_feature_available() ) { ?>
60
 
61
  <div class="a-card a-card--normal" data-storefront-card="change-link-form" style="display: none;">
62
  <div class="a-card__paddings">
63
  <div class="form-area">
64
+ <div class="form-area__title"><?php esc_html_e( 'Customize store page address', 'ecwid-shopping-cart' ); ?></div>
65
  <div class="form-area__content">
66
  <div class="fieldsets-batch">
67
  <?php
68
+ esc_html_e( 'A slug is the last part of a URL. You can create a custom slug for your store page. It’s better to keep it short since customers and search engines prefer short URLs. For example, use "/shop" or "/products".', 'ecwid-shopping-cart' );
69
  ?>
70
  </div>
71
  <div class="fieldsets-batch">
73
  <div class="fieldset__field-wrapper">
74
  <div class="field field--medium">
75
  <label class="field__label"></label>
76
+ <input type="text" class="field__input" maxlength="64" name="post_name" value="<?php echo esc_attr( $page_slug ); ?>" data-ec-store-slug-input="1">
77
+ <div class="field__placeholder"><?php esc_html_e( 'URL Slug', 'ecwid-shopping-cart' ); ?></div>
78
  </div>
79
+ <div class="fieldset__field-prefix"><?php echo esc_url( get_site_url() ); ?>/</div>
80
  </div>
81
  <div class="field__error" aria-hidden="true" style="display: none;"></div>
82
  </div>
83
  </div>
84
  </div>
85
  <div class="form-area__action">
86
+ <button type="button" class="btn btn-primary btn-medium" data-storefront-save-slug><?php esc_html_e( 'Save', 'ecwid-shopping-cart' ); ?></button>
87
+ <button type="button" class="btn btn-link btn-medium" data-storefront-show-card="change-link"><?php esc_html_e( 'Cancel', 'ecwid-shopping-cart' ); ?></button>
88
  </div>
89
  </div>
90
  </div>
103
  <div class="iconable-block__content">
104
  <div class="cta-block">
105
  <div class="cta-block__central">
106
+ <div class="cta-block__title"><?php esc_html_e( 'Customize store page address', 'ecwid-shopping-cart' ); ?></div>
107
 
108
  <div class="cta-block__content" data-ec-state="publish">
109
+ <b>
110
+ <?php
111
+ echo wp_kses_post(
112
+ sprintf(
113
+ __( 'Current URL slug: /<span data-ec-store-slug>%s</span>', 'ecwid-shopping-cart' ),
114
+ $page_slug
115
+ )
116
  );
117
+ ?>
118
+ </b>
119
  </div>
120
 
121
  <div class="cta-block__content">
123
  require self::$templates_dir . '/draft-message.php';
124
  ?>
125
  <?php
126
+ esc_html_e( 'A slug is the last part of a URL. You can create a custom slug for your store page. It’s better to keep it short since customers and search engines prefer short URLs. For example, use "/shop" or "/products".', 'ecwid-shopping-cart' );
127
  ?>
128
  </div>
129
  </div>
130
  <div class="cta-block__cta">
131
+ <a href="<?php echo esc_url( $page_edit_link ); ?>" target="_blank" class="btn btn-default btn-medium" data-storefront-show-card="change-link-form"><?php esc_html_e( 'Edit URL Slug', 'ecwid-shopping-cart' ); ?></a>
132
  </div>
133
  </div>
134
  </div>
135
  </div>
136
  </div>
137
  </div>
138
+ <?php
139
+ }//end if
140
+ ?>
141
 
142
 
143
  <div class="a-card a-card--compact" data-ec-storefront-disabled-card="draft">
153
  <div class="iconable-block__content">
154
  <div class="cta-block">
155
  <div class="cta-block__central">
156
+ <div class="cta-block__title"><?php esc_html_e( 'Add store page to the site menu', 'ecwid-shopping-cart' ); ?></div>
157
  <div class="cta-block__content">
158
  <?php
159
  require self::$templates_dir . '/draft-message.php';
160
  ?>
161
 
162
+ <div><?php esc_html_e( 'Make your store accessible from the site menu so your customers can easily find it.', 'ecwid-shopping-cart' ); ?></div>
163
  </div>
164
  </div>
165
  <div class="cta-block__cta">
166
+ <a href="<?php echo esc_url( admin_url( 'nav-menus.php' ) ); ?>" target="_blank" class="btn btn-default btn-medium"><?php esc_html_e( 'Add Store Page to Menu', 'ecwid-shopping-cart' ); ?></a>
167
  </div>
168
  </div>
169
  </div>
185
  <div class="iconable-block__content">
186
  <div class="cta-block">
187
  <div class="cta-block__central">
188
+ <div class="cta-block__title"><?php esc_html_e( 'Feature your products in the sidebar', 'ecwid-shopping-cart' ); ?></div>
189
  <div class="cta-block__content">
190
+ <?php esc_html_e( 'Highlight your best sellers or new products in the website sidebar.', 'ecwid-shopping-cart' ); ?>
191
  </div>
192
  </div>
193
  <div class="cta-block__cta">
194
+ <a href="<?php echo esc_url( admin_url( 'widgets.php?highlight-ec-widgets=1' ) ); ?>" target="_blank" class="btn btn-default btn-medium"><?php esc_html_e( 'Manage Sidebar', 'ecwid-shopping-cart' ); ?></a>
195
  </div>
196
  </div>
197
  </div>
199
  </div>
200
  </div>
201
 
202
+ <?php if ( class_exists( 'Ecwid_Floating_Minicart' ) ) { ?>
203
  <div class="a-card a-card--compact">
204
  <div class="a-card__paddings">
205
  <div class="iconable-block iconable-block--hide-in-mobile">
213
  <div class="iconable-block__content">
214
  <div class="cta-block">
215
  <div class="cta-block__central">
216
+ <div class="cta-block__title"><?php esc_html_e( 'Display the shopping cart icon on site pages', 'ecwid-shopping-cart' ); ?></div>
217
  <div class="cta-block__content">
218
+ <?php
219
+ echo wp_kses_post(
220
+ sprintf(
221
+ __( 'The shopping cart icon shows the number of items in the cart and helps customers proceed to the checkout. Additionally, you can <a href="%s" target="_blank">adjust the cart icon appearance</a>.', 'ecwid-shopping-cart' ),
222
+ $customizer_minicart_link
223
+ )
224
  );
225
  ?>
226
  </div>
227
  </div>
228
  <div class="cta-block__cta">
229
  <label class="checkbox big">
230
+ <input name="" type="checkbox"
231
+ <?php if ( ! $minicart_hide ) { ?>
232
+ checked=""
233
+ <?php } ?>
234
+ data-storefront-checkbox="display_cart_icon">
235
  <div data-on="enabled" data-off="disabled">
236
  <div></div>
237
  </div>
244
  </div>
245
  </div>
246
  </div>
247
+ <?php
248
+ }//end if
249
+ ?>
250
 
251
  </div>
252
+ </div>
templates/admin/storefront/area-promo.php CHANGED
@@ -1,11 +1,13 @@
1
  <div class="named-area" data-ec-state="demo no-pages">
2
  <div class="named-area__header">
3
- <div class="named-area__titles"><div class="named-area__title"><?php _e( "What's next?" , 'ecwid-shopping-cart'); ?></div></div>
4
  <div class="named-area__description">
5
- <?php
6
- echo sprintf(
7
- __( 'Add your %s store to the website and start selling in minutes.', 'ecwid-shopping-cart'),
8
- Ecwid_Config::get_brand()
 
 
9
  );
10
  ?>
11
  </div>
@@ -18,16 +20,16 @@
18
  <div class="promo-row__content">
19
  <ul class="titled-items-list titled-items-list--ordered">
20
  <li class="titled-items-list__item titled-item">
21
- <div class="titled-item__title"><?php _e( "Customize store appearance" , 'ecwid-shopping-cart'); ?></div>
22
- <div class="titled-item__content"><?php _e( "Customize your store’s appearance to fit your business needs. Give your store the exact look and feel that reflects your brand." , 'ecwid-shopping-cart'); ?></div>
23
  </li>
24
  <li class="titled-items-list__item titled-item">
25
- <div class="titled-item__title"><?php _e( "Change store content" , 'ecwid-shopping-cart'); ?></div>
26
- <div class="titled-item__content"><?php _e( "Stay connected with your customers. Update the content of your store anytime to tell customers about ongoing promotions and what's new in your store." , 'ecwid-shopping-cart'); ?></div>
27
  </li>
28
  <li class="titled-items-list__item titled-item">
29
- <div class="titled-item__title"><?php _e( "Promote your store" , 'ecwid-shopping-cart'); ?></div>
30
- <div class="titled-item__content"><?php _e( "Help customers find your store on the site. Add the store link to the site menu, create additional store pages, and highlight store products on other site pages and in sidebars." , 'ecwid-shopping-cart'); ?></div>
31
  </li>
32
  </ul>
33
  </div>
@@ -37,4 +39,4 @@
37
  </div>
38
 
39
  </div>
40
- </div>
1
  <div class="named-area" data-ec-state="demo no-pages">
2
  <div class="named-area__header">
3
+ <div class="named-area__titles"><div class="named-area__title"><?php esc_html_e( "What's next?", 'ecwid-shopping-cart' ); ?></div></div>
4
  <div class="named-area__description">
5
+ <?php
6
+ echo esc_html(
7
+ sprintf(
8
+ __( 'Add your %s store to the website and start selling in minutes.', 'ecwid-shopping-cart' ),
9
+ Ecwid_Config::get_brand()
10
+ )
11
  );
12
  ?>
13
  </div>
20
  <div class="promo-row__content">
21
  <ul class="titled-items-list titled-items-list--ordered">
22
  <li class="titled-items-list__item titled-item">
23
+ <div class="titled-item__title"><?php esc_html_e( 'Customize store appearance', 'ecwid-shopping-cart' ); ?></div>
24
+ <div class="titled-item__content"><?php esc_html_e( 'Customize your store’s appearance to fit your business needs. Give your store the exact look and feel that reflects your brand.', 'ecwid-shopping-cart' ); ?></div>
25
  </li>
26
  <li class="titled-items-list__item titled-item">
27
+ <div class="titled-item__title"><?php esc_html_e( 'Change store content', 'ecwid-shopping-cart' ); ?></div>
28
+ <div class="titled-item__content"><?php esc_html_e( "Stay connected with your customers. Update the content of your store anytime to tell customers about ongoing promotions and what's new in your store.", 'ecwid-shopping-cart' ); ?></div>
29
  </li>
30
  <li class="titled-items-list__item titled-item">
31
+ <div class="titled-item__title"><?php esc_html_e( 'Promote your store', 'ecwid-shopping-cart' ); ?></div>
32
+ <div class="titled-item__content"><?php esc_html_e( 'Help customers find your store on the site. Add the store link to the site menu, create additional store pages, and highlight store products on other site pages and in sidebars.', 'ecwid-shopping-cart' ); ?></div>
33
  </li>
34
  </ul>
35
  </div>
39
  </div>
40
 
41
  </div>
42
+ </div>
templates/admin/storefront/area-status.php CHANGED
@@ -1,13 +1,13 @@
1
  <div class="named-area">
2
  <div class="named-area__header">
3
  <div class="named-area__titles">
4
- <div class="named-area__title"><?php _e('Store page on your site', 'ecwid-shopping-cart'); ?></div>
5
 
6
  <div class="named-area__subtitle" data-ec-state="demo">
7
- <?php _e( 'While your store is not connected, a demo store displays on your site. Check it to get the idea of how your store may look on the site.', 'ecwid-shopping-cart' ); ?>
8
  </div>
9
  <div class="named-area__subtitle" data-ec-state="no-pages">
10
- <?php _e( 'To start selling, add a page to your site where the storefront will display.', 'ecwid-shopping-cart' ); ?>
11
  </div>
12
  </div>
13
  </div>
@@ -18,22 +18,25 @@
18
  <div class="feature-element__core">
19
  <div class="feature-element__data">
20
 
21
- <div class="feature-element__title" data-ec-state="publish draft"><?php _e('Your store page', 'ecwid-shopping-cart'); ?></div>
22
  <div class="feature-element__title" data-ec-state="demo">
23
- <?php echo sprintf(
24
- __('Connect your %s store', 'ecwid-shopping-cart'),
25
- Ecwid_Config::get_brand()
 
 
 
26
  );
27
  ?>
28
  </div>
29
- <div class="feature-element__title" data-ec-state="no-pages"><?php _e('Add a store page', 'ecwid-shopping-cart'); ?></div>
30
 
31
  <div class="feature-element__status" data-ec-state="publish draft">
32
  <span class="feature-element__status-title success" data-ec-state="publish">
33
- <?php _e('Status', 'ecwid-shopping-cart'); ?>:
34
  </span>
35
  <span class="feature-element__status-title error" data-ec-state="draft">
36
- <?php _e('Status', 'ecwid-shopping-cart'); ?>:
37
  </span>
38
 
39
  <div class="feature-element__status-dropdown-container">
@@ -42,8 +45,8 @@
42
 
43
  <div class="dropdown-menu__link">
44
  <a class="iconable-link">
45
- <div class="iconable-link__text" data-ec-state="publish"><?php _e( 'Published', 'ecwid-shopping-cart' ); ?></div>
46
- <div class="iconable-link__text" data-ec-state="draft"><?php _e( 'Draft', 'ecwid-shopping-cart' ); ?></div>
47
  &zwj;
48
  <span class="iconable-link__icon">
49
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 28" focusable="false"><path d="M3.3 9.5l5.6 5.1 6-5.1c.8-.7 1.9-.7 2.6 0 .8.7.8 1.8 0 2.5l-7.2 6.4c-.5.4-1 .6-1.4.6s-1-.2-1.3-.5L.7 12.1c-.8-.7-.8-1.8 0-2.5.6-.8 1.9-.8 2.6-.1z"></path></svg>
@@ -53,17 +56,17 @@
53
 
54
  <div class="list-dropdown list-dropdown-medium" style="display: none;" aria-hidden="true">
55
  <ul data-ec-state="publish">
56
- <?php self::render_dropdown_list_items( self::get_dropdown_items('publish', $page_data) ); ?>
57
  </ul>
58
 
59
  <ul data-ec-state="draft">
60
- <?php self::render_dropdown_list_items( self::get_dropdown_items('draft', $page_data) ); ?>
61
  </ul>
62
  </div>
63
  </div>
64
 
65
  <a class="iconable-link text-default simple-svg-loader" style="display: none;" aria-hidden="true">
66
- <div class="iconable-link__text"><?php echo ucfirst($page_status); ?></div>
67
  &zwj;
68
  <span class="iconable-link__icon">
69
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" focusable="false"><path d="M14,27C6.83,27,1,21.17,1,14c0-1.56,0.27-3.08,0.81-4.52C2.1,8.7,2.96,8.31,3.74,8.59c0.78,0.29,1.17,1.15,0.88,1.93 C4.21,11.63,4,12.8,4,14c0,5.51,4.49,10,10,10c5.51,0,10-4.49,10-10c0-5.51-4.49-10-10-10c-0.83,0-1.5-0.67-1.5-1.5S13.17,1,14,1 c7.17,0,13,5.83,13,13C27,21.17,21.17,27,14,27z"></path></svg>
@@ -73,8 +76,8 @@
73
  </div>
74
 
75
  <div class="feature-element__status" data-ec-state="demo">
76
- <a class="iconable-link iconable-link--append" href="<?php echo $page_link; ?>" target="_blank">
77
- <span class="iconable-link__text"><?php _e( 'View demo store page', 'ecwid-shopping-cart' ); ?></span>
78
  <span class="iconable-link__icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28"><path d="M25.5 15.39c-.83 0-1.5.67-1.5 1.5v4.41c0 1.49-1.21 2.71-2.71 2.71H6.71A2.72 2.72 0 0 1 4 21.29V6.71C4 5.21 5.21 4 6.71 4h4.45c.83 0 1.5-.67 1.5-1.5S11.99 1 11.16 1H6.71C3.56 1 1 3.56 1 6.71v14.58C1 24.44 3.56 27 6.71 27h14.58c3.15 0 5.71-2.56 5.71-5.71v-4.41c0-.82-.67-1.49-1.5-1.49z"></path><path d="M25.05 1h-7.37c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5h4.2l-9.94 9.94a1.49 1.49 0 0 0 0 2.12c.29.29.68.44 1.06.44s.77-.15 1.06-.44L24 6.12v4.2c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5V2.95C27 1.87 26.13 1 25.05 1z"></path></svg></span>
79
  </a>
80
  </div>
@@ -83,45 +86,49 @@
83
  <div class="feature-element__content" data-ec-state="publish">
84
  <div class="feature-element__text">
85
  <?php
86
- _e('Your store page is published. Customers can browse your store at ', 'ecwid-shopping-cart');
87
-
88
- echo sprintf( '<a href="%s" target="_blank" data-ec-store-link="1">%s</a>', $page_link, urldecode($page_link) );
89
  ?>
90
  </div>
91
  <div class="feature-element__action">
92
- <a href="<?php echo $page_link;?>" class="feature-element__button btn btn-default btn-medium" target="_blank"><?php _e('View Store Page', 'ecwid-shopping-cart'); ?></a>
93
  </div>
94
  </div>
95
 
96
  <div class="feature-element__content" data-ec-state="draft">
97
  <div class="feature-element__text">
98
- <p><?php _e('Your store page is currently in draft. Once you are ready, publish it to let customers browse the store and place orders.', 'ecwid-shopping-cart'); ?></p>
99
  </div>
100
  <div class="feature-element__action">
101
- <a class="feature-element__button btn btn-primary btn-medium" data-storefront-status="1"><?php _e('Publish Store Page', 'ecwid-shopping-cart'); ?></a>
102
  </div>
103
  </div>
104
 
105
  <div class="feature-element__content" data-ec-state="demo">
106
  <div class="feature-element__text">
107
- <p><?php
108
- echo sprintf(
109
- __('To show your storefront instead of the demo store, connect your existing %s account or create a new one.', 'ecwid-shopping-cart'),
110
- Ecwid_Config::get_brand()
 
 
 
111
  );
112
- ?></p>
 
113
  </div>
114
  <div class="feature-element__action">
115
- <a href="<?php echo admin_url('admin.php?page=ec-store&return-url=') . rawurlencode(self::get_relative_page_url());?>" class="feature-element__button btn btn-primary btn-medium"><?php _e('Set Up Your Store', 'ecwid-shopping-cart'); ?></a>
116
  </div>
117
  </div>
118
 
119
  <div class="feature-element__content" data-ec-state="no-pages">
120
  <div class="feature-element__text">
121
- <p><?php _e('Your store is not added to any page on your site. To let customers browse your store and place orders, create a page where the store will display.', 'ecwid-shopping-cart'); ?></p>
122
  </div>
123
  <div class="feature-element__action">
124
- <a class="feature-element__button btn btn-primary btn-medium" data-storefront-create-page="store"><?php _e('Create Store Page', 'ecwid-shopping-cart'); ?></a>
125
  </div>
126
  </div>
127
  </div>
@@ -136,4 +143,4 @@
136
  </div>
137
  </div>
138
  </div>
139
- </div>
1
  <div class="named-area">
2
  <div class="named-area__header">
3
  <div class="named-area__titles">
4
+ <div class="named-area__title"><?php esc_html_e( 'Store page on your site', 'ecwid-shopping-cart' ); ?></div>
5
 
6
  <div class="named-area__subtitle" data-ec-state="demo">
7
+ <?php esc_html_e( 'While your store is not connected, a demo store displays on your site. Check it to get the idea of how your store may look on the site.', 'ecwid-shopping-cart' ); ?>
8
  </div>
9
  <div class="named-area__subtitle" data-ec-state="no-pages">
10
+ <?php esc_html_e( 'To start selling, add a page to your site where the storefront will display.', 'ecwid-shopping-cart' ); ?>
11
  </div>
12
  </div>
13
  </div>
18
  <div class="feature-element__core">
19
  <div class="feature-element__data">
20
 
21
+ <div class="feature-element__title" data-ec-state="publish draft"><?php esc_html_e( 'Your store page', 'ecwid-shopping-cart' ); ?></div>
22
  <div class="feature-element__title" data-ec-state="demo">
23
+ <?php
24
+ echo esc_html(
25
+ sprintf(
26
+ __( 'Connect your %s store', 'ecwid-shopping-cart' ),
27
+ Ecwid_Config::get_brand()
28
+ )
29
  );
30
  ?>
31
  </div>
32
+ <div class="feature-element__title" data-ec-state="no-pages"><?php esc_html_e( 'Add a store page', 'ecwid-shopping-cart' ); ?></div>
33
 
34
  <div class="feature-element__status" data-ec-state="publish draft">
35
  <span class="feature-element__status-title success" data-ec-state="publish">
36
+ <?php esc_html_e( 'Status', 'ecwid-shopping-cart' ); ?>:
37
  </span>
38
  <span class="feature-element__status-title error" data-ec-state="draft">
39
+ <?php esc_html_e( 'Status', 'ecwid-shopping-cart' ); ?>:
40
  </span>
41
 
42
  <div class="feature-element__status-dropdown-container">
45
 
46
  <div class="dropdown-menu__link">
47
  <a class="iconable-link">
48
+ <div class="iconable-link__text" data-ec-state="publish"><?php esc_html_e( 'Published', 'ecwid-shopping-cart' ); ?></div>
49
+ <div class="iconable-link__text" data-ec-state="draft"><?php esc_html_e( 'Draft', 'ecwid-shopping-cart' ); ?></div>
50
  &zwj;
51
  <span class="iconable-link__icon">
52
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 28" focusable="false"><path d="M3.3 9.5l5.6 5.1 6-5.1c.8-.7 1.9-.7 2.6 0 .8.7.8 1.8 0 2.5l-7.2 6.4c-.5.4-1 .6-1.4.6s-1-.2-1.3-.5L.7 12.1c-.8-.7-.8-1.8 0-2.5.6-.8 1.9-.8 2.6-.1z"></path></svg>
56
 
57
  <div class="list-dropdown list-dropdown-medium" style="display: none;" aria-hidden="true">
58
  <ul data-ec-state="publish">
59
+ <?php self::render_dropdown_list_items( self::get_dropdown_items( 'publish', $page_data ) ); ?>
60
  </ul>
61
 
62
  <ul data-ec-state="draft">
63
+ <?php self::render_dropdown_list_items( self::get_dropdown_items( 'draft', $page_data ) ); ?>
64
  </ul>
65
  </div>
66
  </div>
67
 
68
  <a class="iconable-link text-default simple-svg-loader" style="display: none;" aria-hidden="true">
69
+ <div class="iconable-link__text"><?php echo esc_html__( ucfirst( $page_status ) ); ?></div>
70
  &zwj;
71
  <span class="iconable-link__icon">
72
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" focusable="false"><path d="M14,27C6.83,27,1,21.17,1,14c0-1.56,0.27-3.08,0.81-4.52C2.1,8.7,2.96,8.31,3.74,8.59c0.78,0.29,1.17,1.15,0.88,1.93 C4.21,11.63,4,12.8,4,14c0,5.51,4.49,10,10,10c5.51,0,10-4.49,10-10c0-5.51-4.49-10-10-10c-0.83,0-1.5-0.67-1.5-1.5S13.17,1,14,1 c7.17,0,13,5.83,13,13C27,21.17,21.17,27,14,27z"></path></svg>
76
  </div>
77
 
78
  <div class="feature-element__status" data-ec-state="demo">
79
+ <a class="iconable-link iconable-link--append" href="<?php echo esc_url( $page_link ); ?>" target="_blank">
80
+ <span class="iconable-link__text"><?php esc_html_e( 'View demo store page', 'ecwid-shopping-cart' ); ?></span>
81
  <span class="iconable-link__icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28"><path d="M25.5 15.39c-.83 0-1.5.67-1.5 1.5v4.41c0 1.49-1.21 2.71-2.71 2.71H6.71A2.72 2.72 0 0 1 4 21.29V6.71C4 5.21 5.21 4 6.71 4h4.45c.83 0 1.5-.67 1.5-1.5S11.99 1 11.16 1H6.71C3.56 1 1 3.56 1 6.71v14.58C1 24.44 3.56 27 6.71 27h14.58c3.15 0 5.71-2.56 5.71-5.71v-4.41c0-.82-.67-1.49-1.5-1.49z"></path><path d="M25.05 1h-7.37c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5h4.2l-9.94 9.94a1.49 1.49 0 0 0 0 2.12c.29.29.68.44 1.06.44s.77-.15 1.06-.44L24 6.12v4.2c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5V2.95C27 1.87 26.13 1 25.05 1z"></path></svg></span>
82
  </a>
83
  </div>
86
  <div class="feature-element__content" data-ec-state="publish">
87
  <div class="feature-element__text">
88
  <?php
89
+ esc_html_e( 'Your store page is published. Customers can browse your store at ', 'ecwid-shopping-cart' );
90
+
91
+ echo wp_kses_post( sprintf( '<a href="%s" target="_blank" data-ec-store-link="1">%s</a>', $page_link, urldecode( $page_link ) ) );
92
  ?>
93
  </div>
94
  <div class="feature-element__action">
95
+ <a href="<?php echo esc_url( $page_link ); ?>" class="feature-element__button btn btn-default btn-medium" target="_blank"><?php esc_html_e( 'View Store Page', 'ecwid-shopping-cart' ); ?></a>
96
  </div>
97
  </div>
98
 
99
  <div class="feature-element__content" data-ec-state="draft">
100
  <div class="feature-element__text">
101
+ <p><?php esc_html_e( 'Your store page is currently in draft. Once you are ready, publish it to let customers browse the store and place orders.', 'ecwid-shopping-cart' ); ?></p>
102
  </div>
103
  <div class="feature-element__action">
104
+ <a class="feature-element__button btn btn-primary btn-medium" data-storefront-status="1"><?php esc_html_e( 'Publish Store Page', 'ecwid-shopping-cart' ); ?></a>
105
  </div>
106
  </div>
107
 
108
  <div class="feature-element__content" data-ec-state="demo">
109
  <div class="feature-element__text">
110
+ <p>
111
+ <?php
112
+ echo esc_html(
113
+ sprintf(
114
+ __( 'To show your storefront instead of the demo store, connect your existing %s account or create a new one.', 'ecwid-shopping-cart' ),
115
+ Ecwid_Config::get_brand()
116
+ )
117
  );
118
+ ?>
119
+ </p>
120
  </div>
121
  <div class="feature-element__action">
122
+ <a href="<?php echo esc_url( admin_url( 'admin.php?page=ec-store&return-url=' ) . rawurlencode( self::get_relative_page_url() ) ); ?>" class="feature-element__button btn btn-primary btn-medium"><?php esc_html_e( 'Set Up Your Store', 'ecwid-shopping-cart' ); ?></a>
123
  </div>
124
  </div>
125
 
126
  <div class="feature-element__content" data-ec-state="no-pages">
127
  <div class="feature-element__text">
128
+ <p><?php esc_html_e( 'Your store is not added to any page on your site. To let customers browse your store and place orders, create a page where the store will display.', 'ecwid-shopping-cart' ); ?></p>
129
  </div>
130
  <div class="feature-element__action">
131
+ <a class="feature-element__button btn btn-primary btn-medium" data-storefront-create-page="store"><?php esc_html_e( 'Create Store Page', 'ecwid-shopping-cart' ); ?></a>
132
  </div>
133
  </div>
134
  </div>
143
  </div>
144
  </div>
145
  </div>
146
+ </div>
templates/admin/storefront/draft-message.php CHANGED
@@ -1,3 +1,3 @@
1
  <div class="text-default warning" data-ec-state="draft">
2
- <b><?php _e( 'Publish the page to use this option', 'ecwid-shopping-cart' );?></b>
3
- </div>
1
  <div class="text-default warning" data-ec-state="draft">
2
+ <b><?php esc_html_e( 'Publish the page to use this option', 'ecwid-shopping-cart' ); ?></b>
3
+ </div>
templates/admin/storefront/main.php CHANGED
@@ -1,13 +1,13 @@
1
- <div id="ec-storefront-settings" class="settings-page ec-ui-framework-page" data-ec-storefront-status="<?php echo $page_status; ?>" >
2
  <div class="settings-page__header">
3
  <div class="settings-page__titles settings-page__titles--left">
4
- <h1 class="settings-page__title"><?php _e('Your Storefront', 'ecwid-shopping-cart'); ?></h1>
5
  <div class="settings-page__subtitle"></div>
6
  </div>
7
 
8
  <?php
9
- if( isset($need_show_draft_warning) && $need_show_draft_warning ) {
10
- ?>
11
  <div class="a-card a-card--compact a-card--warning" data-ec-state="draft">
12
  <div class="a-card__paddings">
13
  <div class="iconable-block iconable-block--hide-in-mobile iconable-block--warning">
@@ -17,16 +17,16 @@
17
  <div class="iconable-block__content">
18
  <div class="cta-block">
19
  <div class="cta-block__central">
20
- <div class="cta-block__title"><?php _e('The store is not visible on your site', 'ecwid-shopping-cart'); ?></div>
21
- <div class="cta-block__content"><?php _e('Customers can’t see your store page because it’s in draft. Publish the page to make it available for your customers.', 'ecwid-shopping-cart'); ?></div>
22
  </div>
23
  </div>
24
  </div>
25
  </div>
26
  </div>
27
  </div>
28
- <?php
29
- }
30
  ?>
31
 
32
  <?php require self::$templates_dir . '/area-status.php'; ?>
@@ -42,4 +42,3 @@
42
  </div>
43
 
44
  </div>
45
-
1
+ <div id="ec-storefront-settings" class="settings-page ec-ui-framework-page" data-ec-storefront-status="<?php echo esc_attr( $page_status ); ?>" >
2
  <div class="settings-page__header">
3
  <div class="settings-page__titles settings-page__titles--left">
4
+ <h1 class="settings-page__title"><?php esc_html_e( 'Your Storefront', 'ecwid-shopping-cart' ); ?></h1>
5
  <div class="settings-page__subtitle"></div>
6
  </div>
7
 
8
  <?php
9
+ if ( isset( $need_show_draft_warning ) && $need_show_draft_warning ) {
10
+ ?>
11
  <div class="a-card a-card--compact a-card--warning" data-ec-state="draft">
12
  <div class="a-card__paddings">
13
  <div class="iconable-block iconable-block--hide-in-mobile iconable-block--warning">
17
  <div class="iconable-block__content">
18
  <div class="cta-block">
19
  <div class="cta-block__central">
20
+ <div class="cta-block__title"><?php esc_html_e( 'The store is not visible on your site', 'ecwid-shopping-cart' ); ?></div>
21
+ <div class="cta-block__content"><?php esc_html_e( 'Customers can’t see your store page because it’s in draft. Publish the page to make it available for your customers.', 'ecwid-shopping-cart' ); ?></div>
22
  </div>
23
  </div>
24
  </div>
25
  </div>
26
  </div>
27
  </div>
28
+ <?php
29
+ }//end if
30
  ?>
31
 
32
  <?php require self::$templates_dir . '/area-status.php'; ?>
42
  </div>
43
 
44
  </div>
 
templates/admin/welcome-connect.php CHANGED
@@ -1,12 +1,13 @@
1
  <div class="ec-form">
2
  <div class="ec-button">
3
- <form action="<?php echo $connect_url; ?>" method="post">
4
- <button type="submit" class="btn btn--large btn--orange"><?php _e( 'Connect Your Store', 'ecwid-shopping-cart' ); ?></button>
5
  </form>
6
  </div>
7
- <?php
8
- if ( !Ecwid_Config::is_no_reg_wl() && !$this->_is_registration_blocked_locale() ) { ?>
9
- <a target="_blank" href="<?php echo esc_attr(ecwid_get_register_link()); ?>"><?php _e( 'Create store', 'ecwid-shopping-cart' ); ?>&nbsp;&rsaquo;</a>
 
10
  <?php } ?>
11
  </div>
12
 
1
  <div class="ec-form">
2
  <div class="ec-button">
3
+ <form action="<?php echo esc_url( $connect_url ); ?>" method="post">
4
+ <button type="submit" class="btn btn--large btn--orange"><?php esc_html_e( 'Connect Your Store', 'ecwid-shopping-cart' ); ?></button>
5
  </form>
6
  </div>
7
+ <?php
8
+ if ( ! Ecwid_Config::is_no_reg_wl() && ! $this->_is_registration_blocked_locale() ) {
9
+ ?>
10
+ <a target="_blank" href="<?php echo esc_attr( ecwid_get_register_link() ); ?>"><?php esc_html_e( 'Create store', 'ecwid-shopping-cart' ); ?>&nbsp;&rsaquo;</a>
11
  <?php } ?>
12
  </div>
13
 
templates/admin/welcome-connection-message.php CHANGED
@@ -1,38 +1,35 @@
1
  <?php
2
- if( !$connection_error ) {
3
 
4
  $note = sprintf(
5
  __( 'To display your store on this site, you need to allow WordPress to access your %1$s products. Please press connect to provide permission.', 'ecwid-shopping-cart' ),
6
  Ecwid_Config::get_brand()
7
  );
8
 
9
- if( $state == 'connect' ) {
10
- echo $this->get_welcome_page_note( $note );
11
  }
12
-
13
  } else {
14
 
15
  $error_note = __( 'Connection error - after clicking button you need to login and provide permissions to use our plugin. Please, try again.', 'ecwid-shopping-cart' );
16
-
17
  $oauth_error = $ecwid_oauth->get_error();
18
 
19
- if( !empty($oauth_error) ) {
20
- if ($ecwid_oauth->get_error() == 'other') {
21
 
22
  $error_note = sprintf( __( 'Looks like your site does not support remote POST requests that are required for %s API to work. Please, contact your hosting provider to enable cURL.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() );
23
  } else {
24
 
25
  $error_note = sprintf( __( 'To sell using %1$s, you must allow WordPress to access the %1$s plugin. The connect button will direct you to your %1$s account where you can provide permission.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() );
26
  }
27
- } else if( !ecwid_test_oauth() ) {
28
  $error_note = sprintf( __( 'Looks like your site does not support remote POST requests that are required for %s API to work. Please, contact your hosting provider to enable cURL.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() );
29
  }
30
 
31
- echo $this->get_welcome_page_note( $error_note, 'ec-connection-error' );
32
- }
33
 
34
- if( $ecwid_oauth->get_reconnect_message() ) {
35
- echo $this->get_welcome_page_note( $ecwid_oauth->get_reconnect_message() );
36
  }
37
-
38
- ?>
1
  <?php
2
+ if ( ! $connection_error ) {
3
 
4
  $note = sprintf(
5
  __( 'To display your store on this site, you need to allow WordPress to access your %1$s products. Please press connect to provide permission.', 'ecwid-shopping-cart' ),
6
  Ecwid_Config::get_brand()
7
  );
8
 
9
+ if ( $state == 'connect' ) {
10
+ echo wp_kses_post( $this->get_welcome_page_note( $note ) );
11
  }
 
12
  } else {
13
 
14
  $error_note = __( 'Connection error - after clicking button you need to login and provide permissions to use our plugin. Please, try again.', 'ecwid-shopping-cart' );
15
+
16
  $oauth_error = $ecwid_oauth->get_error();
17
 
18
+ if ( ! empty( $oauth_error ) ) {
19
+ if ( $ecwid_oauth->get_error() == 'other' ) {
20
 
21
  $error_note = sprintf( __( 'Looks like your site does not support remote POST requests that are required for %s API to work. Please, contact your hosting provider to enable cURL.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() );
22
  } else {
23
 
24
  $error_note = sprintf( __( 'To sell using %1$s, you must allow WordPress to access the %1$s plugin. The connect button will direct you to your %1$s account where you can provide permission.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() );
25
  }
26
+ } elseif ( ! ecwid_test_oauth() ) {
27
  $error_note = sprintf( __( 'Looks like your site does not support remote POST requests that are required for %s API to work. Please, contact your hosting provider to enable cURL.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() );
28
  }
29
 
30
+ echo wp_kses_post( $this->get_welcome_page_note( $error_note, 'ec-connection-error' ) );
31
+ }//end if
32
 
33
+ if ( $ecwid_oauth->get_reconnect_message() ) {
34
+ echo wp_kses_post( $this->get_welcome_page_note( $ecwid_oauth->get_reconnect_message() ) );
35
  }
 
 
templates/admin/welcome-create.php CHANGED
@@ -1,20 +1,20 @@
1
  <div class="ec-form">
2
- <?php if(!$this->_is_registration_blocked_locale()) {?>
3
  <div class="ec-button">
4
- <button type="button" class="ec-create-store-button btn btn--large btn--orange"><?php _e( 'Create Store', 'ecwid-shopping-cart' ); ?></button>
5
  </div>
6
- <a href="<?php echo $connect_url; ?>" class="ec-connect-store"><?php _e( 'Connect your store', 'ecwid-shopping-cart' ); ?>&nbsp;&rsaquo;</a>
7
- <?php } else {?>
8
  <div class="ec-button">
9
- <form action="<?php echo $connect_url; ?>" method="post">
10
- <button type="submit" class="btn btn--large btn--orange"><?php _e( 'Connect your store', 'ecwid-shopping-cart' ); ?></button>
11
  </form>
12
  </div>
13
- <?php }?>
14
  </div>
15
 
16
  <div class="ec-note ec-create-store-success-note">
17
- <?php _e('Your store has been created. Preparing your store dashboard ...', 'ecwid-shopping-cart'); ?>
18
  </div>
19
 
20
  <?php
1
  <div class="ec-form">
2
+ <?php if ( ! $this->_is_registration_blocked_locale() ) { ?>
3
  <div class="ec-button">
4
+ <button type="button" class="ec-create-store-button btn btn--large btn--orange"><?php esc_html_e( 'Create Store', 'ecwid-shopping-cart' ); ?></button>
5
  </div>
6
+ <a href="<?php echo esc_url( $connect_url ); ?>" class="ec-connect-store"><?php esc_html_e( 'Connect your store', 'ecwid-shopping-cart' ); ?>&nbsp;&rsaquo;</a>
7
+ <?php } else { ?>
8
  <div class="ec-button">
9
+ <form action="<?php echo esc_url( $connect_url ); ?>" method="post">
10
+ <button type="submit" class="btn btn--large btn--orange"><?php esc_html_e( 'Connect your store', 'ecwid-shopping-cart' ); ?></button>
11
  </form>
12
  </div>
13
+ <?php } ?>
14
  </div>
15
 
16
  <div class="ec-note ec-create-store-success-note">
17
+ <?php esc_html_e( 'Your store has been created. Preparing your store dashboard ...', 'ecwid-shopping-cart' ); ?>
18
  </div>
19
 
20
  <?php
templates/admin/welcome-no_oauth.php CHANGED
@@ -1,18 +1,22 @@
1
  <div class="form-block">
2
  <div class="form-block__input">
3
- <input type="input" id="ecwid-store-id" class="form-block__element" placeholder="<?php _e( 'Enter your Store ID', 'ecwid-shopping-cart' ); ?>" value="" size="32" />
4
  </div>
5
  <div class="form-block__group-append">
6
- <button id="ecwid-connect-no-oauth" data-href="admin-post.php?action=ec_connect" class="btn btn--orange btn--medium btn--no-animate form-block__btn form-block__element" type="button"><?php _e( 'Connect', 'ecwid-shopping-cart' ); ?></button>
7
  </div>
8
  </div>
9
 
10
  <div class="ec-note">
11
- <?php echo sprintf(
12
- __( 'Store ID is a unique identifier of your %1$s account. You can find it in your %1$s control panel on the <a %2$s>Dashboard page</a>.', 'ecwid-shopping-cart' ),
13
- Ecwid_Config::get_brand(),
14
- 'href="https://' . Ecwid_Config::get_cpanel_domain() . '/cp/CP.html?partner=wporg#dashboard" target="_blank"'
15
- ); ?>
 
 
 
 
16
  </div>
17
 
18
  <?php
1
  <div class="form-block">
2
  <div class="form-block__input">
3
+ <input type="input" id="ecwid-store-id" class="form-block__element" placeholder="<?php esc_attr_e( 'Enter your Store ID', 'ecwid-shopping-cart' ); ?>" value="" size="32" />
4
  </div>
5
  <div class="form-block__group-append">
6
+ <button id="ecwid-connect-no-oauth" data-href="admin-post.php?action=ec_connect" class="btn btn--orange btn--medium btn--no-animate form-block__btn form-block__element" type="button"><?php esc_html_e( 'Connect', 'ecwid-shopping-cart' ); ?></button>
7
  </div>
8
  </div>
9
 
10
  <div class="ec-note">
11
+ <?php
12
+ echo wp_kses_post(
13
+ sprintf(
14
+ __( 'Store ID is a unique identifier of your %1$s account. You can find it in your %1$s control panel on the <a %2$s>Dashboard page</a>.', 'ecwid-shopping-cart' ),
15
+ Ecwid_Config::get_brand(),
16
+ 'href="https://' . Ecwid_Config::get_cpanel_domain() . '/cp/CP.html?partner=wporg#dashboard" target="_blank"'
17
+ )
18
+ );
19
+ ?>
20
  </div>
21
 
22
  <?php
templates/admin/welcome-page.php CHANGED
@@ -3,81 +3,97 @@
3
  <div class="ec-content">
4
  <div class="ec-logo">
5
  <?php
6
- if( !Ecwid_Config::is_wl() ) {
7
  ecwid_embed_svg( 'ec-logo' );
8
  }
9
  ?>
10
  </div>
11
  <h2>
12
- <?php _e( 'Add an Online Store to Your Website', 'ecwid-shopping-cart' ); ?>
13
  </h2>
14
 
15
- <?php if( $state == 'create' || $state == 'connect' ) { ?>
16
 
17
  <div class="ec-subheading">
18
  <p>
19
- <?php echo sprintf(
20
- __( 'Create a new store or connect an existing one, if you already have an %s account. The plugin will guide you through store setup and help publish it on your website.', 'ecwid-shopping-cart' ),
21
- Ecwid_Config::get_brand()
22
- ); ?>
 
 
 
 
23
  </p>
24
  </div>
25
 
26
  <?php } ?>
27
 
28
- <?php if( $state == 'no_oauth' ) { ?>
29
  <div class="ec-subheading">
30
  <p>
31
- <?php if( $this->_is_registration_blocked_locale() ) {
32
- echo sprintf(
33
- __( 'To add your store to your website, put your %1$s Store ID in the field below.', 'ecwid-shopping-cart' ),
34
- Ecwid_Config::get_brand()
 
 
 
35
  );
36
  } else {
37
- echo sprintf(
38
- __( 'To add your store to your website, put your %1$s Store ID in the field below. If you don\'t have an %1$s account yet, create one for free on the <a %2$s>%1$s website</a>.', 'ecwid-shopping-cart' ),
39
- Ecwid_Config::get_brand(),
40
- 'href="' . esc_attr(ecwid_get_register_link()) . '" target="_blank"'
 
 
41
  );
42
- } ?>
 
43
  </p>
44
  </div>
45
- <?php } ?>
 
 
46
 
47
 
48
- <?php if( $this->_is_registration_blocked_locale() ) { ?>
49
  <div class="ec-subheading">
50
  <p>
51
- <?php echo $this->get_welcome_page_note( __('Unfortunately, creating a new account is currently unavailable for your country. You can still connect an existing account.', 'ecwid-shopping-cart'), 'ec-connection-error' ); ?>
52
  </p>
53
  </div>
54
  <?php } ?>
55
 
56
 
57
  <?php
58
- if( $state == 'create' ) {
59
  require_once ECWID_ADMIN_TEMPLATES_DIR . '/welcome-create.php';
60
  }
61
 
62
- if( $state == 'connect' ) {
63
  require_once ECWID_ADMIN_TEMPLATES_DIR . '/welcome-connect.php';
64
  }
65
 
66
- if( $state == 'no_oauth' ) {
67
  require_once ECWID_ADMIN_TEMPLATES_DIR . '/welcome-no_oauth.php';
68
  }
69
  ?>
70
 
71
  </div>
72
 
73
- <?php if( !Ecwid_Config::is_wl() ) { ?>
74
  <div class="ec-poweredby">
75
- <?php echo sprintf(
76
- __( 'Provided by <a %s>%s</a>', 'ecwid-shopping-cart' ),
77
- 'href="https://www.ecwid.com?partner=wporg" target="_blank"',
78
- 'ecwid.com'
79
- ); ?>
 
 
 
 
80
  </div>
81
  <?php } ?>
82
  </div>
83
- </div>
3
  <div class="ec-content">
4
  <div class="ec-logo">
5
  <?php
6
+ if ( ! Ecwid_Config::is_wl() ) {
7
  ecwid_embed_svg( 'ec-logo' );
8
  }
9
  ?>
10
  </div>
11
  <h2>
12
+ <?php esc_html_e( 'Add an Online Store to Your Website', 'ecwid-shopping-cart' ); ?>
13
  </h2>
14
 
15
+ <?php if ( $state == 'create' || $state == 'connect' ) { ?>
16
 
17
  <div class="ec-subheading">
18
  <p>
19
+ <?php
20
+ echo esc_html(
21
+ sprintf(
22
+ __( 'Create a new store or connect an existing one, if you already have an %s account. The plugin will guide you through store setup and help publish it on your website.', 'ecwid-shopping-cart' ),
23
+ Ecwid_Config::get_brand()
24
+ )
25
+ );
26
+ ?>
27
  </p>
28
  </div>
29
 
30
  <?php } ?>
31
 
32
+ <?php if ( $state == 'no_oauth' ) { ?>
33
  <div class="ec-subheading">
34
  <p>
35
+ <?php
36
+ if ( $this->_is_registration_blocked_locale() ) {
37
+ echo esc_html(
38
+ sprintf(
39
+ __( 'To add your store to your website, put your %1$s Store ID in the field below.', 'ecwid-shopping-cart' ),
40
+ Ecwid_Config::get_brand()
41
+ )
42
  );
43
  } else {
44
+ echo wp_kses_post(
45
+ sprintf(
46
+ __( 'To add your store to your website, put your %1$s Store ID in the field below. If you don\'t have an %1$s account yet, create one for free on the <a %2$s>%1$s website</a>.', 'ecwid-shopping-cart' ),
47
+ Ecwid_Config::get_brand(),
48
+ 'href="' . esc_attr( ecwid_get_register_link() ) . '" target="_blank"'
49
+ )
50
  );
51
+ }
52
+ ?>
53
  </p>
54
  </div>
55
+ <?php
56
+ }//end if
57
+ ?>
58
 
59
 
60
+ <?php if ( $this->_is_registration_blocked_locale() ) { ?>
61
  <div class="ec-subheading">
62
  <p>
63
+ <?php echo wp_kses_post( $this->get_welcome_page_note( __( 'Unfortunately, creating a new account is currently unavailable for your country. You can still connect an existing account.', 'ecwid-shopping-cart' ), 'ec-connection-error' ) ); ?>
64
  </p>
65
  </div>
66
  <?php } ?>
67
 
68
 
69
  <?php
70
+ if ( $state == 'create' ) {
71
  require_once ECWID_ADMIN_TEMPLATES_DIR . '/welcome-create.php';
72
  }
73
 
74
+ if ( $state == 'connect' ) {
75
  require_once ECWID_ADMIN_TEMPLATES_DIR . '/welcome-connect.php';
76
  }
77
 
78
+ if ( $state == 'no_oauth' ) {
79
  require_once ECWID_ADMIN_TEMPLATES_DIR . '/welcome-no_oauth.php';
80
  }
81
  ?>
82
 
83
  </div>
84
 
85
+ <?php if ( ! Ecwid_Config::is_wl() ) { ?>
86
  <div class="ec-poweredby">
87
+ <?php
88
+ echo wp_kses_post(
89
+ sprintf(
90
+ __( 'Provided by <a %1$s>%2$s</a>', 'ecwid-shopping-cart' ),
91
+ 'href="https://www.ecwid.com?partner=wporg" target="_blank"',
92
+ 'ecwid.com'
93
+ )
94
+ );
95
+ ?>
96
  </div>
97
  <?php } ?>
98
  </div>
99
+ </div>
templates/admin/welcome-terms-privacy.php CHANGED
@@ -1,11 +1,14 @@
1
- <?php if( !Ecwid_Config::is_wl() ) { ?>
2
  <div class="ec-note" style="padding-top: 16px;">
3
  <?php
4
- echo sprintf(
5
- __( 'By continuing, you agree to the <a %s>Terms of Service</a> and <a %s>Privacy Policy</a>.', 'ecwid-shopping-cart' ),
6
- 'href="http://www.ecwid.com/terms-of-service" target="_blank"',
7
- 'href="https://www.ecwid.com/privacy-policy" target="_blank"'
 
 
 
8
  );
9
  ?>
10
  </div>
11
- <?php } ?>
1
+ <?php if ( ! Ecwid_Config::is_wl() ) { ?>
2
  <div class="ec-note" style="padding-top: 16px;">
3
  <?php
4
+ echo wp_kses_post(
5
+ sprintf(
6
+ /* translators: links on terms and privacy policy */
7
+ __( 'By continuing, you agree to the <a %1$s>Terms of Service</a> and <a %2$s>Privacy Policy</a>.', 'ecwid-shopping-cart' ),
8
+ 'href="http://www.ecwid.com/terms-of-service" target="_blank"',
9
+ 'href="https://www.ecwid.com/privacy-policy" target="_blank"'
10
+ )
11
  );
12
  ?>
13
  </div>
14
+ <?php } ?>
templates/advanced-settings.php CHANGED
@@ -1,14 +1,14 @@
1
- <h2><?php printf( __( '%s — Advanced settings', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></h2>
2
 
3
  <div class="wrap">
4
  <form class="pure-form pure-form-aligned ecwid-settings advanced-settings" method="POST" action="options.php">
5
 
6
 
7
- <?php settings_fields('ecwid_options_page'); ?>
8
  <input type="hidden" name="settings_section" value="advanced" />
9
 
10
  <fieldset>
11
-
12
  <div class="pure-control-group checkbox">
13
  <div class="label">
14
  <label for="ecwid_is_sso_enabled" class="premium-feature">
@@ -22,82 +22,82 @@
22
  <?php endif; ?>
23
  <?php if ( $is_sso_checkbox_disabled ) : ?>
24
  disabled="disabled"
25
- <?php endif; ?>
26
  />
27
- <?php _e('Customer Single Sign-On', 'ecwid-shopping-cart'); ?>
28
- <?php ecwid_embed_svg('star'); ?>
29
  </label>
30
 
31
  <div class="note">
32
- <?php printf( __( 'Single Sign-On allows your customers to have a single login for your WordPress site and your %s. When someone logs in to your site, they will automatically be logged in to their customer account in your store as well with no need to enter their email/password again.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
33
  </div>
34
- <?php if (!ecwid_is_paid_account()): ?>
35
  <div class="upgrade-note">
36
  <a
37
  class="button ecwid-button button-green" target="_blank"
38
- href="<?php echo Ecwid_Admin::get_dashboard_url(); ?>&ec-page=<?php echo rawurlencode( Ecwid_Admin_Main_Page::PAGE_HASH_UPGRADE ); ?>">
39
- <?php _e( 'Upgrade to get this feature', 'ecwid-shopping-cart' ); ?>
40
  </a>
41
  <div class="note grayed-links">
42
- <?php printf( __( 'Please subscribe to a paid plan to get this feature.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
43
  </div>
44
  </div>
45
  <?php endif; ?>
46
- <?php if ( !$is_sso_enabled && ecwid_is_paid_account() && !get_option('ecwid_sso_secret_key') && !$has_create_customers_scope): ?>
47
  <div class="note">
48
- <?php printf( __( 'To allow %s automatically log in customers to your store, please provide it with a permission to use the customer data in the store. <a %s>Please use this link to do that</a>', 'ecwid-shopping-cart'), Ecwid_Config::get_brand(), 'href="' . $reconnect_link . '"'); ?>
49
  </div>
50
  <?php endif; ?>
51
 
52
- <?php if ( !get_option('users_can_register' ) ): ?>
53
  <div class="note">
54
- <?php echo sprintf(__('To make sure your customer can actually log in to your site and store, enable registration in the <a %s>site settings</a>', 'ecwid-shopping-cart'), 'href="options-general.php"'); ?>
55
  </div>
56
  <?php endif; ?>
57
  </div>
58
  </div>
59
 
60
- <hr />
61
 
62
- <?php if ( Ecwid_Products::is_enabled() ): ?>
63
- <div class="pure-control-group checkbox">
64
- <div class="label">
65
- <label for="<?php echo Ecwid_Products::OPTION_ENABLED; ?>">
66
 
67
- <input
68
- id="<?php echo Ecwid_Products::OPTION_ENABLED; ?>"
69
- name="<?php echo Ecwid_Products::OPTION_ENABLED; ?>"
70
- type="checkbox"
71
- <?php if ( Ecwid_Products::is_enabled() ): ?>
72
- checked="checked"
73
- <?php endif; ?>
74
- value="Y"
75
- <?php if ( !Ecwid_Products::is_feature_available() ): ?>
76
- disabled="disabled"
77
- <?php endif; ?>
78
- />
79
- <?php _e('Integration with search on your site', 'ecwid-shopping-cart'); ?>
80
- </label>
81
 
82
- <div class="note">
83
- <?php echo sprintf( __( '%s stores your products data in a secure cloud storage. The product pages are displayed on the fly when a customer browses your store. So, basically, the products are not stored on the site, that\'s why the site search doesn\'t find product pages while looking through site pages and posts. This option enables a local storage mode: the products will be stored both in the cloud and on your site. The site search results will list product pages as well as regular pages/posts of your site.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
84
- </div>
85
- </div>
86
- </div>
87
-
88
- <?php ecwid_sync_do_page(); ?>
89
 
90
- <?php endif;?>
91
 
92
  </fieldset>
93
 
94
  <fieldset>
95
 
96
  <div class="pure-control-group" style="margin-top: 30px">
97
- <button type="submit" class="<?php echo ECWID_MAIN_BUTTON_CLASS; ?>">
98
- <?php _e('Save changes', 'ecwid-shopping-cart'); ?>
99
  </button>
100
  </div>
101
  </fieldset>
102
  </form>
103
- </div>
1
+ <h2><?php echo esc_html( sprintf( __( '%s — Advanced settings', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?></h2>
2
 
3
  <div class="wrap">
4
  <form class="pure-form pure-form-aligned ecwid-settings advanced-settings" method="POST" action="options.php">
5
 
6
 
7
+ <?php settings_fields( 'ecwid_options_page' ); ?>
8
  <input type="hidden" name="settings_section" value="advanced" />
9
 
10
  <fieldset>
11
+
12
  <div class="pure-control-group checkbox">
13
  <div class="label">
14
  <label for="ecwid_is_sso_enabled" class="premium-feature">
22
  <?php endif; ?>
23
  <?php if ( $is_sso_checkbox_disabled ) : ?>
24
  disabled="disabled"
25
+ <?php endif; ?>
26
  />
27
+ <?php esc_html_e( 'Customer Single Sign-On', 'ecwid-shopping-cart' ); ?>
28
+ <?php ecwid_embed_svg( 'star' ); ?>
29
  </label>
30
 
31
  <div class="note">
32
+ <?php echo esc_html( sprintf( __( 'Single Sign-On allows your customers to have a single login for your WordPress site and your %s. When someone logs in to your site, they will automatically be logged in to their customer account in your store as well with no need to enter their email/password again.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
33
  </div>
34
+ <?php if ( ! ecwid_is_paid_account() ) : ?>
35
  <div class="upgrade-note">
36
  <a
37
  class="button ecwid-button button-green" target="_blank"
38
+ href="<?php echo esc_url( Ecwid_Admin::get_dashboard_url() ); ?>&ec-page=<?php echo rawurlencode( Ecwid_Admin_Main_Page::PAGE_HASH_UPGRADE ); ?>">
39
+ <?php esc_html_e( 'Upgrade to get this feature', 'ecwid-shopping-cart' ); ?>
40
  </a>
41
  <div class="note grayed-links">
42
+ <?php echo esc_html( sprintf( __( 'Please subscribe to a paid plan to get this feature.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
43
  </div>
44
  </div>
45
  <?php endif; ?>
46
+ <?php if ( ! $is_sso_enabled && ecwid_is_paid_account() && ! get_option( 'ecwid_sso_secret_key' ) && ! $has_create_customers_scope ) : ?>
47
  <div class="note">
48
+ <?php echo wp_kses_post( sprintf( __( 'To allow %1$s automatically log in customers to your store, please provide it with a permission to use the customer data in the store. <a %2$s>Please use this link to do that</a>', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand(), 'href="' . $reconnect_link . '"' ) ); ?>
49
  </div>
50
  <?php endif; ?>
51
 
52
+ <?php if ( ! get_option( 'users_can_register' ) ) : ?>
53
  <div class="note">
54
+ <?php echo wp_kses_post( sprintf( __( 'To make sure your customer can actually log in to your site and store, enable registration in the <a %s>site settings</a>', 'ecwid-shopping-cart' ), 'href="options-general.php"' ) ); ?>
55
  </div>
56
  <?php endif; ?>
57
  </div>
58
  </div>
59
 
60
+ <hr />
61
 
62
+ <?php if ( Ecwid_Products::is_enabled() ) : ?>
63
+ <div class="pure-control-group checkbox">
64
+ <div class="label">
65
+ <label for="<?php echo esc_attr( Ecwid_Products::OPTION_ENABLED ); ?>">
66
 
67
+ <input
68
+ id="<?php echo esc_attr( Ecwid_Products::OPTION_ENABLED ); ?>"
69
+ name="<?php echo esc_attr( Ecwid_Products::OPTION_ENABLED ); ?>"
70
+ type="checkbox"
71
+ <?php if ( Ecwid_Products::is_enabled() ) : ?>
72
+ checked="checked"
73
+ <?php endif; ?>
74
+ value="Y"
75
+ <?php if ( ! Ecwid_Products::is_feature_available() ) : ?>
76
+ disabled="disabled"
77
+ <?php endif; ?>
78
+ />
79
+ <?php esc_html_e( 'Integration with search on your site', 'ecwid-shopping-cart' ); ?>
80
+ </label>
81
 
82
+ <div class="note">
83
+ <?php echo esc_html( sprintf( __( '%s stores your products data in a secure cloud storage. The product pages are displayed on the fly when a customer browses your store. So, basically, the products are not stored on the site, that\'s why the site search doesn\'t find product pages while looking through site pages and posts. This option enables a local storage mode: the products will be stored both in the cloud and on your site. The site search results will list product pages as well as regular pages/posts of your site.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
84
+ </div>
85
+ </div>
86
+ </div>
87
+
88
+ <?php ecwid_sync_do_page(); ?>
89
 
90
+ <?php endif; ?>
91
 
92
  </fieldset>
93
 
94
  <fieldset>
95
 
96
  <div class="pure-control-group" style="margin-top: 30px">
97
+ <button type="submit" class="<?php echo esc_attr( ECWID_MAIN_BUTTON_CLASS ); ?>">
98
+ <?php esc_html_e( 'Save changes', 'ecwid-shopping-cart' ); ?>
99
  </button>
100
  </div>
101
  </fieldset>
102
  </form>
103
+ </div>
templates/dashboard-blog-posts.tpl.php CHANGED
@@ -1,23 +1,23 @@
1
  <div class="template-container">
2
  <div class="ecwid-blog-post">
3
- <div class="ecwid-blog-post-image-container">
4
- <a class="ecwid-blog-post-link" target="_blank"><div class="ecwid-blog-post-image"></div></a>
5
- </div>
6
- <div class="ecwid-blog-post-text-container">
7
- <a class="ecwid-blog-post-title ecwid-blog-post-link" target="_blank"></a>
8
- <p class="ecwid-blog-post-excerpt"></p>
9
- </div>
10
  </div>
11
  </div>
12
  <div class="ecwid-blog-posts"></div>
13
  <div class="ecwid-blog-footer">
14
- <a href="<?php _e( 'https://www.ecwid.com/blog', 'ecwid-shopping-cart' ); ?>">
15
- <?php echo sprintf( __( '%s Blog', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
16
- <span aria-hidden="true" class="dashicons dashicons-external"></span>
17
- </a>
18
- |
19
- <a href="<?php _e( 'https://support.ecwid.com/hc/en-us', 'ecwid-shopping-cart' ); ?>">
20
- <?php echo _e( 'Knowledge Base', 'ecwid-shopping-cart' ); ?>
21
- <span aria-hidden="true" class="dashicons dashicons-external"></span>
22
- </a>
23
  </div>
1
  <div class="template-container">
2
  <div class="ecwid-blog-post">
3
+ <div class="ecwid-blog-post-image-container">
4
+ <a class="ecwid-blog-post-link" target="_blank"><div class="ecwid-blog-post-image"></div></a>
5
+ </div>
6
+ <div class="ecwid-blog-post-text-container">
7
+ <a class="ecwid-blog-post-title ecwid-blog-post-link" target="_blank"></a>
8
+ <p class="ecwid-blog-post-excerpt"></p>
9
+ </div>
10
  </div>
11
  </div>
12
  <div class="ecwid-blog-posts"></div>
13
  <div class="ecwid-blog-footer">
14
+ <a href="<?php esc_html_e( 'https://www.ecwid.com/blog', 'ecwid-shopping-cart' ); ?>">
15
+ <?php echo esc_html( sprintf( __( '%s Blog', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
16
+ <span aria-hidden="true" class="dashicons dashicons-external"></span>
17
+ </a>
18
+ |
19
+ <a href="<?php esc_html_e( 'https://support.ecwid.com/hc/en-us', 'ecwid-shopping-cart' ); ?>">
20
+ <?php echo esc_html_e( 'Knowledge Base', 'ecwid-shopping-cart' ); ?>
21
+ <span aria-hidden="true" class="dashicons dashicons-external"></span>
22
+ </a>
23
  </div>
templates/ecwid-admin.php CHANGED
@@ -2,11 +2,11 @@
2
  jQuery(document.body).addClass('ecwid-admin-iframe ecwid-no-padding');
3
 
4
  jQuery(document).ready(function() {
5
- jQuery('#ecwid-frame').attr('src', '<?php echo $iframe_src; ?>');
6
  ecwidSetPopupCentering('#ecwid-frame');
7
 
8
  jQuery.ajax({
9
- url: ajaxurl + '?action=<?php echo Ecwid_Store_Page::WARMUP_ACTION; ?>'
10
  });
11
  });
12
  //]]>
@@ -16,7 +16,7 @@
16
  <?php
17
  if ( isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'ec-storefront-settings', 'ec-store-developers' ) ) ) {
18
  echo '#ecwid-frame { display: none; } ';
19
- echo sprintf( '#%s { display: block; }', sanitize_text_field( wp_unslash( $_GET['page'] ) ) );
20
  }
21
  ?>
22
  .ec-ui-framework-page { display: none; }
2
  jQuery(document.body).addClass('ecwid-admin-iframe ecwid-no-padding');
3
 
4
  jQuery(document).ready(function() {
5
+ jQuery('#ecwid-frame').attr('src', '<?php echo $iframe_src; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>');
6
  ecwidSetPopupCentering('#ecwid-frame');
7
 
8
  jQuery.ajax({
9
+ url: ajaxurl + '?action=<?php echo esc_attr( Ecwid_Store_Page::WARMUP_ACTION ); ?>'
10
  });
11
  });
12
  //]]>
16
  <?php
17
  if ( isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'ec-storefront-settings', 'ec-store-developers' ) ) ) {
18
  echo '#ecwid-frame { display: none; } ';
19
+ echo esc_html( sprintf( '#%s { display: block; }', sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) );
20
  }
21
  ?>
22
  .ec-ui-framework-page { display: none; }
templates/help.php CHANGED
@@ -8,60 +8,54 @@
8
  <div class="ecwid-help main-container">
9
 
10
  <div class="block-search block-search-index">
11
- <h2><?php _e( 'How can we help you?', 'ecwid-shopping-cart' ); ?></h2>
12
 
13
  <div class="hds-container">
14
  <div class="hds-wrapper">
15
- <form class="hds-form" method="get" target="_blank" data-action="<?php _e( 'https://support.ecwid.com/hc/en-us/search', 'ecwid-shopping-cart' ); ?>" onsubmit="help-page searchquerysubmited">
16
  <div class="input-wrapper input-prepend">
17
- <input type="text" class="form-control q" value="" id="q" placeholder="<?php _e( 'E.g. How to set up shipping', 'ecwid-shopping-cart' ); ?> " autocomplete="off"/>
18
  <span class="hds-loader"></span>
19
  <button type="submit" class="hds-submit btn" id="hds-submit" onClick="">
20
  <span class="icon-search"></span>
21
- <span class="btn-text"><?php _e( 'Search the Knowledge Base', 'ecwid-shopping-cart' ); ?> </span>
22
  </button>
23
  </div>
24
  </form>
25
  </div>
26
  </div>
27
  <div class="block-search block-search-kb-link">
28
- <?php echo sprintf( __( 'or <a %s>Browse the Help Center', 'ecwid-shopping-cart' ), 'href="https://support.ecwid.com/"' ); ?>
29
  </div>
30
  </div>
31
 
32
  <div class="block-faq">
33
- <h2><?php _e( 'Frequently Asked Questions', 'ecwid-shopping-cart' ); ?> </h2>
34
  <div class="block-faq-wrap">
35
  <ul class="block-faq-list">
36
- <?php
37
- foreach ( $faqs as $idx => $faq ) :
38
- if ( $idx % 2 == 0 ) :
39
- ?>
40
- <li class="index-article
41
- <?php
42
- if ( $idx >= $col_size ) {
43
- echo ' index-article--hidden';}
44
- ?>
45
  ">
46
  <a class="index-article-title" href="#" onclick="return false;">
47
- <i class="icon-down"></i><?php echo $faq->title; ?>
48
  </a>
49
  <div class="index-article-body">
50
- <?php echo $faq->body; ?>
51
  </div>
52
  </li>
53
 
54
- <?php
55
- endif;
56
- endforeach;
57
- ?>
58
  </ul>
59
 
60
  <ul class="block-faq-list">
61
- <?php
62
- foreach ( $faqs as $idx => $faq ) :
63
- if ( $idx % 2 == 1 ) :
64
- ?>
65
  <li class="index-article
66
  <?php
67
  if ( $idx >= $col_size ) {
@@ -69,16 +63,14 @@ endforeach;
69
  ?>
70
  ">
71
  <a class="index-article-title" href="#" onclick="return false;">
72
- <i class="icon-down"></i><?php echo $faq->title; ?>
73
  </a>
74
  <div class="index-article-body">
75
- <?php echo $faq->body; ?>
76
  </div>
77
  </li>
78
- <?php
79
- endif;
80
- endforeach;
81
- ?>
82
  </ul>
83
 
84
  </div>
@@ -86,7 +78,7 @@ endforeach;
86
  <div class="block-topics-link">
87
 
88
  <a href="#" class="horizontal-icolink">
89
- <?php _e( 'See more', 'ecwid-shopping-cart' ); ?>
90
  <i class="icon-arr-right"></i>
91
  </a>
92
 
@@ -195,8 +187,8 @@ endforeach;
195
  <ul>
196
  <li>
197
  <div class="block-help-item">
198
- <a href="<?php esc_html_e( Ecwid_Config::get_contact_us_url(), 'ecwid-shopping-cart' ); ?>" target="_blank"><?php _e( 'Contact us', 'ecwid-shopping-cart' ); ?> </a>
199
- <p><?php _e( 'Still have questions about Ecwid? Let us know!', 'ecwid-shopping-cart' ); ?> </p>
200
  </div>
201
  </li>
202
  </ul>
@@ -205,27 +197,28 @@ endforeach;
205
 
206
  <?php if ( isset( $_SERVER['REMOTE_ADDR'] ) && ! in_array( $_SERVER['REMOTE_ADDR'], array( '127.0.0.1', '::1' ) ) ) : ?>
207
  <div class="block-contact">
208
- <h2><?php _e( 'Send a message to our support team', 'ecwid-shopping-cart' ); ?> </h2>
209
 
210
  <div class="contact-form">
211
  <form action="admin-post.php" enctype="multipart/form-data" class="new_email" id="new_email" method="post" novalidate="novalidate">
212
  <input type="hidden" name="action" value="ecwid_contact_us" />
213
- <input type="hidden" name="_wpnonce" id="wp-nonce" value="<?php echo wp_create_nonce( Ecwid_Help_Page::CONTACT_US_ACTION_NAME ); ?>" />
214
  <input id="email_subject" maxlength="100" name="email[subject]" type="text" class="form-control" value="
215
  <?php
216
  if ( ! empty( $_GET['contact_us_subject'] ) ) {
217
- echo __( sanitize_text_field( wp_unslash( $_GET['contact_us_subject'] ) ) );}
 
 
 
 
 
 
 
218
  ?>
219
- " placeholder="<?php _e( 'Subject', 'ecwid-shopping-cart' ); ?> ">
220
- <textarea id="email_body" name="email[body]" class="form-control" placeholder="<?php _e( 'Type in your message here', 'ecwid-shopping-cart' ); ?> ">
221
- <?php
222
- if ( ! empty( $_GET['contact_us_message'] ) ) {
223
- echo sanitize_text_field( wp_unslash( $_GET['contact_us_message'] ) );}
224
- ?>
225
  </textarea>
226
  <div class="btn-container">
227
  <button id="contact-ecwid-support" class="btn btn-medium btn-aqua" type="submit">
228
- <span class="btn-text"><?php _e( 'Send Message', 'ecwid-shopping-cart' ); ?></span>
229
  <div class="loader">
230
  <div class="ecwid-spinner spin-right">
231
  <svg width="60px" height="60px" viewBox="0 0 60 60" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -236,15 +229,15 @@ endforeach;
236
  </div>
237
  </div>
238
  </button>
239
- <div class="send-error"><?php _e( 'Send message failed', 'ecwid-shopping-cart' ); ?></div>
240
  </div>
241
  </form>
242
  </div>
243
  </div>
244
  <div class="block-sent">
245
- <h2><?php _e( 'Your email has been sent', 'ecwid-shopping-cart' ); ?></h2>
246
- <p><?php _e( ' Thank you very much for contacting us! We will get back to you shortly.', 'ecwid-shopping-cart' ); ?></p>
247
- <p><a id="show-ecwid-contact-again" href="#"><?php _e( 'You can send a new request here.', 'ecwid-shopping-cart' ); ?></a></p>
248
 
249
  </div>
250
  <?php endif; ?>
@@ -288,7 +281,7 @@ endforeach;
288
  jQuery('.block-contact .btn').addClass('btn-loading');
289
  jQuery('.block-contact .form-control').addClass('submitted');
290
 
291
- $result = jQuery.ajax(ajaxurl + '?action=<?php echo Ecwid_Help_Page::CONTACT_US_ACTION_NAME; ?>', {
292
  'method': 'POST',
293
  'data': {
294
  'subject' : jQuery('#email_subject').val(),
8
  <div class="ecwid-help main-container">
9
 
10
  <div class="block-search block-search-index">
11
+ <h2><?php esc_html_e( 'How can we help you?', 'ecwid-shopping-cart' ); ?></h2>
12
 
13
  <div class="hds-container">
14
  <div class="hds-wrapper">
15
+ <form class="hds-form" method="get" target="_blank" data-action="<?php esc_html_e( 'https://support.ecwid.com/hc/en-us/search', 'ecwid-shopping-cart' ); ?>" onsubmit="help-page searchquerysubmited">
16
  <div class="input-wrapper input-prepend">
17
+ <input type="text" class="form-control q" value="" id="q" placeholder="<?php esc_html_e( 'E.g. How to set up shipping', 'ecwid-shopping-cart' ); ?> " autocomplete="off"/>
18
  <span class="hds-loader"></span>
19
  <button type="submit" class="hds-submit btn" id="hds-submit" onClick="">
20
  <span class="icon-search"></span>
21
+ <span class="btn-text"><?php esc_html_e( 'Search the Knowledge Base', 'ecwid-shopping-cart' ); ?> </span>
22
  </button>
23
  </div>
24
  </form>
25
  </div>
26
  </div>
27
  <div class="block-search block-search-kb-link">
28
+ <?php echo wp_kses_post( sprintf( __( 'or <a %s>Browse the Help Center', 'ecwid-shopping-cart' ), 'href="https://support.ecwid.com/"' ) ); ?>
29
  </div>
30
  </div>
31
 
32
  <div class="block-faq">
33
+ <h2><?php esc_html_e( 'Frequently Asked Questions', 'ecwid-shopping-cart' ); ?> </h2>
34
  <div class="block-faq-wrap">
35
  <ul class="block-faq-list">
36
+ <?php foreach ( $faqs as $idx => $faq ) { ?>
37
+ <?php if ( $idx % 2 == 0 ) { ?>
38
+ <li class="index-article
39
+ <?php
40
+ if ( $idx >= $col_size ) {
41
+ echo ' index-article--hidden';}
42
+ ?>
 
 
43
  ">
44
  <a class="index-article-title" href="#" onclick="return false;">
45
+ <i class="icon-down"></i><?php echo esc_html( $faq->title ); ?>
46
  </a>
47
  <div class="index-article-body">
48
+ <?php echo wp_kses_post( $faq->body ); ?>
49
  </div>
50
  </li>
51
 
52
+ <?php } ?>
53
+ <?php } ?>
 
 
54
  </ul>
55
 
56
  <ul class="block-faq-list">
57
+ <?php foreach ( $faqs as $idx => $faq ) { ?>
58
+ <?php if ( $idx % 2 == 1 ) { ?>
 
 
59
  <li class="index-article
60
  <?php
61
  if ( $idx >= $col_size ) {
63
  ?>
64
  ">
65
  <a class="index-article-title" href="#" onclick="return false;">
66
+ <i class="icon-down"></i><?php echo esc_html( $faq->title ); ?>
67
  </a>
68
  <div class="index-article-body">
69
+ <?php echo wp_kses_post( $faq->body ); ?>
70
  </div>
71
  </li>
72
+ <?php } ?>
73
+ <?php } ?>
 
 
74
  </ul>
75
 
76
  </div>
78
  <div class="block-topics-link">
79
 
80
  <a href="#" class="horizontal-icolink">
81
+ <?php esc_html_e( 'See more', 'ecwid-shopping-cart' ); ?>
82
  <i class="icon-arr-right"></i>
83
  </a>
84
 
187
  <ul>
188
  <li>
189
  <div class="block-help-item">
190
+ <a href="<?php esc_html_e( Ecwid_Config::get_contact_us_url(), 'ecwid-shopping-cart' ); ?>" target="_blank"><?php esc_html_e( 'Contact us', 'ecwid-shopping-cart' ); ?> </a>
191
+ <p><?php esc_html_e( 'Still have questions about Ecwid? Let us know!', 'ecwid-shopping-cart' ); ?> </p>
192
  </div>
193
  </li>
194
  </ul>
197
 
198
  <?php if ( isset( $_SERVER['REMOTE_ADDR'] ) && ! in_array( $_SERVER['REMOTE_ADDR'], array( '127.0.0.1', '::1' ) ) ) : ?>
199
  <div class="block-contact">
200
+ <h2><?php esc_html_e( 'Send a message to our support team', 'ecwid-shopping-cart' ); ?> </h2>
201
 
202
  <div class="contact-form">
203
  <form action="admin-post.php" enctype="multipart/form-data" class="new_email" id="new_email" method="post" novalidate="novalidate">
204
  <input type="hidden" name="action" value="ecwid_contact_us" />
205
+ <input type="hidden" name="_wpnonce" id="wp-nonce" value="<?php echo esc_attr( wp_create_nonce( Ecwid_Help_Page::CONTACT_US_ACTION_NAME ) ); ?>" />
206
  <input id="email_subject" maxlength="100" name="email[subject]" type="text" class="form-control" value="
207
  <?php
208
  if ( ! empty( $_GET['contact_us_subject'] ) ) {
209
+ echo esc_html( sanitize_text_field( wp_unslash( $_GET['contact_us_subject'] ) ) );}
210
+ ?>
211
+ " placeholder="<?php esc_html_e( 'Subject', 'ecwid-shopping-cart' ); ?> ">
212
+ <textarea id="email_body" name="email[body]" class="form-control" placeholder="<?php esc_html_e( 'Type in your message here', 'ecwid-shopping-cart' ); ?>">
213
+ <?php
214
+ if ( ! empty( $_GET['contact_us_message'] ) ) {
215
+ echo esc_textarea( sanitize_text_field( wp_unslash( $_GET['contact_us_message'] ) ) );
216
+ }
217
  ?>
 
 
 
 
 
 
218
  </textarea>
219
  <div class="btn-container">
220
  <button id="contact-ecwid-support" class="btn btn-medium btn-aqua" type="submit">
221
+ <span class="btn-text"><?php esc_html_e( 'Send Message', 'ecwid-shopping-cart' ); ?></span>
222
  <div class="loader">
223
  <div class="ecwid-spinner spin-right">
224
  <svg width="60px" height="60px" viewBox="0 0 60 60" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
229
  </div>
230
  </div>
231
  </button>
232
+ <div class="send-error"><?php esc_html_e( 'Send message failed', 'ecwid-shopping-cart' ); ?></div>
233
  </div>
234
  </form>
235
  </div>
236
  </div>
237
  <div class="block-sent">
238
+ <h2><?php esc_html_e( 'Your email has been sent', 'ecwid-shopping-cart' ); ?></h2>
239
+ <p><?php esc_html_e( ' Thank you very much for contacting us! We will get back to you shortly.', 'ecwid-shopping-cart' ); ?></p>
240
+ <p><a id="show-ecwid-contact-again" href="#"><?php esc_html_e( 'You can send a new request here.', 'ecwid-shopping-cart' ); ?></a></p>
241
 
242
  </div>
243
  <?php endif; ?>
281
  jQuery('.block-contact .btn').addClass('btn-loading');
282
  jQuery('.block-contact .form-control').addClass('submitted');
283
 
284
+ $result = jQuery.ajax(ajaxurl + '?action=<?php echo esc_attr( Ecwid_Help_Page::CONTACT_US_ACTION_NAME ); ?>', {
285
  'method': 'POST',
286
  'data': {
287
  'subject' : jQuery('#email_subject').val(),
templates/importer/import-no-token.tpl.php CHANGED
@@ -1,8 +1,8 @@
1
  <div class="feature-element__content">
2
  <div class="feature-element__text">
3
- <p><?php _e('Click the connect button to get rights to update the product catalog', 'ecwid-shopping-cart'); ?></p>
4
  </div>
5
  <div class="feature-element__action">
6
- <a class="btn btn-primary btn-medium" id="reconnect-button" href="admin.php?page=<?php echo self::PAGE_SLUG_WOO; ?>&action=reconnect"><?php _e( 'Connect', 'ecwid-shopping-cart' ); ?></a>
7
  </div>
8
- </div>
1
  <div class="feature-element__content">
2
  <div class="feature-element__text">
3
+ <p><?php esc_html_e( 'Click the connect button to get rights to update the product catalog', 'ecwid-shopping-cart' ); ?></p>
4
  </div>
5
  <div class="feature-element__action">
6
+ <a class="btn btn-primary btn-medium" id="reconnect-button" href="admin.php?page=<?php echo esc_attr( self::PAGE_SLUG_WOO ); ?>&action=reconnect"><?php esc_html_e( 'Connect', 'ecwid-shopping-cart' ); ?></a>
7
  </div>
8
+ </div>
templates/importer/landing.tpl.php CHANGED
@@ -1,38 +1,44 @@
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() ): ?>
8
  <div class="card">
9
- <h2><?php _e( 'Import product catalog from WooCommerce', 'ecwid-shopping-cart' ); ?></h2>
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
 
31
- <p><?php _e( 'Ecwid allows you to upload your products in a form of CSV file. Learn more about this tool in the Ecwid Help Center', 'ecwid-shopping-cart'); ?></p>
32
- <p>
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>
1
+ <div class="wrap"><h1><?php echo esc_html( sprintf( __( 'Import products to your %s store', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?></h1>
2
 
3
  <p>
4
+ <?php echo esc_html( sprintf( __( '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() ) : ?>
8
  <div class="card">
9
+ <h2><?php esc_html_e( 'Import product catalog from WooCommerce', 'ecwid-shopping-cart' ); ?></h2>
10
+ <p>
11
+ <?php
12
+ echo esc_html(
13
+ sprintf(
14
+ __(
15
+ '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?',
16
+ 'ecwid-shopping-cart'
17
+ ),
18
+ Ecwid_Importer::count_woo_products(),
19
+ Ecwid_Importer::count_woo_categories(),
20
+ Ecwid_Config::get_brand()
21
+ )
22
+ );
23
+ ?>
24
+ </p>
25
+ <a href="admin.php?page=<?php echo esc_attr( self::PAGE_SLUG_WOO ); ?>">
26
+ <?php echo esc_html( sprintf( __( 'Import your WooCommerce catalog to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
27
+ </a>
28
+
29
+ <p><?php esc_html_e( '(You will be able to confirm the changes before the actual import)', 'ecwid-shopping-cart' ); ?></p>
30
  </div>
31
  <?php endif; ?>
32
+
33
+ <?php if ( ! Ecwid_Config::is_wl() ) : ?>
34
  <div class="card">
35
+ <h2><?php esc_html_e( 'Import product catalog from other sources', 'ecwid-shopping-cart' ); ?></h2>
36
 
37
+ <p><?php esc_html_e( 'Ecwid allows you to upload your products in a form of CSV file. Learn more about this tool in the Ecwid Help Center', 'ecwid-shopping-cart' ); ?></p>
38
+ <p>
39
+ <a href="<?php esc_html_e( 'https://support.ecwid.com/hc/en-us/articles/208079105-Importing-products', 'ecwid-shopping-cart' ); ?>"><?php esc_html_e( 'Learn more', 'ecwid-shopping-cart' ); ?></a>
40
+ </p>
41
  </div>
42
  <?php endif; ?>
43
 
44
+ </div>
templates/importer/woo-complete-alert.tpl.php CHANGED
@@ -12,48 +12,50 @@
12
  <div class="iconable-block__content">
13
  <div class="cta-block">
14
  <div class="cta-block__central">
15
- <div class="cta-block__title"><?php _e( 'Import completed', 'ecwid-shopping-cart' ); ?></div>
16
  <div class="cta-block__content">
17
- <?php
18
- echo sprintf( __( 'Imported <b>%s</b> products', 'ecwid-shopping-cart' ), '<span id="import-results-products">0</span>' );
19
  if ( ecwid_is_paid_account() ) {
20
- echo ", ";
21
- echo sprintf( __( '<b>%s</b> categories', 'ecwid-shopping-cart' ), '<span id="import-results-categories">0</span>' );
22
  }
23
  ?>
24
  </div>
25
 
26
  <div class="cta-block__content" data-ec-importer-alert="warning">
27
- <?php _e( 'Some of the items could not be imported.', 'ecwid-shopping-cart' ); ?>
28
 
29
  <span data-ec-importer-alert="limit">
30
  <?php
31
- echo sprintf(
32
- __( 'Part of the products have not been copied to %1$s, because you reached the products limit on your pricing plan in %1$s. If you want to import more products, please consider <nobr><a %2$s>upgrading your %1$s plan.</a></nobr>', 'ecwid-shopping-cart' ),
33
- Ecwid_Config::get_brand(),
34
- 'href="' . $this->_get_billing_page_url() .'"'
 
 
35
  );
36
- ?>
37
  </span>
38
  </div>
39
 
40
  <div class="cta-block__content" data-ec-importer-alert="warning">
41
- <?php
42
  echo sprintf(
43
- __( 'Download <a href="%s">import log</a>', 'ecwid-shopping-cart' ),
44
- 'admin-post.php?action=' . Ecwid_Import_Page::ACTION_GET_WOO_IMPORT_LOG
45
  );
46
  ?>
47
  </div>
48
 
49
  </div>
50
  <div class="cta-block__cta">
51
- <a class="btn btn-primary btn-medium" href="admin.php?page=<?php echo Ecwid_Admin::ADMIN_SLUG; ?>-admin-products">
52
- <?php echo sprintf( __('Go to Your %s Products', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
53
  </a>
54
  </div>
55
  </div>
56
  </div>
57
  </div>
58
  </div>
59
- </div>
12
  <div class="iconable-block__content">
13
  <div class="cta-block">
14
  <div class="cta-block__central">
15
+ <div class="cta-block__title"><?php esc_html_e( 'Import completed', 'ecwid-shopping-cart' ); ?></div>
16
  <div class="cta-block__content">
17
+ <?php
18
+ echo wp_kses_post( sprintf( __( 'Imported <b>%s</b> products', 'ecwid-shopping-cart' ), '<span id="import-results-products">0</span>' ) );
19
  if ( ecwid_is_paid_account() ) {
20
+ echo ', ';
21
+ echo wp_kses_post( sprintf( __( '<b>%s</b> categories', 'ecwid-shopping-cart' ), '<span id="import-results-categories">0</span>' ) );
22
  }
23
  ?>
24
  </div>
25
 
26
  <div class="cta-block__content" data-ec-importer-alert="warning">
27
+ <?php esc_html_e( 'Some of the items could not be imported.', 'ecwid-shopping-cart' ); ?>
28
 
29
  <span data-ec-importer-alert="limit">
30
  <?php
31
+ echo wp_kses_post(
32
+ sprintf(
33
+ __( 'Part of the products have not been copied to %1$s, because you reached the products limit on your pricing plan in %1$s. If you want to import more products, please consider <nobr><a %2$s>upgrading your %1$s plan.</a></nobr>', 'ecwid-shopping-cart' ),
34
+ Ecwid_Config::get_brand(),
35
+ 'href="' . esc_url( $this->_get_billing_page_url() ) . '"'
36
+ )
37
  );
38
+ ?>
39
  </span>
40
  </div>
41
 
42
  <div class="cta-block__content" data-ec-importer-alert="warning">
43
+ <?php
44
  echo sprintf(
45
+ wp_kses_post( __( 'Download <a href="%s">import log</a>', 'ecwid-shopping-cart' ) ),
46
+ 'admin-post.php?action=' . esc_attr( Ecwid_Import_Page::ACTION_GET_WOO_IMPORT_LOG )
47
  );
48
  ?>
49
  </div>
50
 
51
  </div>
52
  <div class="cta-block__cta">
53
+ <a class="btn btn-primary btn-medium" href="admin.php?page=<?php echo esc_attr( Ecwid_Admin::ADMIN_SLUG ); ?>-admin-products">
54
+ <?php echo esc_html( sprintf( __( 'Go to Your %s Products', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?>
55
  </a>
56
  </div>
57
  </div>
58
  </div>
59
  </div>
60
  </div>
61
+ </div>
templates/importer/woo-main.tpl.php CHANGED
@@ -1,12 +1,12 @@
1
  <div class="settings-page">
2
  <div class="settings-page__header">
3
  <div class="settings-page__titles settings-page__titles--left">
4
- <h1 class="settings-page__title"><?php echo sprintf( __( 'Import Your Products From Woocommerce to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></h1>
5
  <div class="settings-page__subtitle"></div>
6
  </div>
7
 
8
  <?php
9
- if( $this->_is_token_ok() ) {
10
  require __DIR__ . '/woo-complete-alert.tpl.php';
11
  }
12
  ?>
@@ -15,8 +15,8 @@
15
  <div class="named-area">
16
  <div class="named-area__header">
17
  <div class="named-area__titles">
18
- <div class="named-area__title"><?php _e( 'Update your catalog', 'ecwid-shopping-cart' ); ?></div>
19
- <div class="named-area__subtitle"><?php echo sprintf( __( 'This import will copy your WooCommerce products and categories to your %s store.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></div>
20
  </div>
21
  </div>
22
  <div class="named-area__body">
@@ -29,26 +29,26 @@
29
  <div class="feature-element__core">
30
  <div class="feature-element__data">
31
 
32
- <div class="feature-element__title" data-ec-importer-state="default"><?php echo sprintf( __( 'Import your products from Woocommerce to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></div>
33
 
34
- <div class="feature-element__title" data-ec-importer-state="process"><?php _e( 'Import is in Progress', 'ecwid-shopping-cart' ); ?></div>
35
 
36
- <div class="feature-element__title" data-ec-importer-state="complete"><?php echo sprintf( __( 'Import your products from WooCommerce to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></div>
37
 
38
  <?php
39
- if( !$this->_is_token_ok() ) {
40
  require __DIR__ . '/import-no-token.tpl.php';
41
  }
42
  ?>
43
 
44
- <?php if( $this->_is_token_ok() ){?>
45
 
46
  <div class="feature-element__status" data-ec-importer-state="complete">
47
  <span class="feature-element__status-title success">
48
- <?php
49
  echo sprintf(
50
- __( 'Import completed. <a href="%s">Run again.</a>', 'ecwid-shopping-cart' ),
51
- admin_url( 'admin.php?page=' . Ecwid_Import_Page::PAGE_SLUG_WOO )
52
  );
53
  ?>
54
  </span>
@@ -57,20 +57,28 @@
57
  <div class="feature-element__status" data-ec-importer-state="process">
58
  <div class="canonical-status canonical-status--has-icon canonical-status--loading canonical-status--prepend-icon canonical-status--warning">
59
  <div class="canonical-status__text">
60
- <?php _e( 'Copying products and categories.', 'ecwid-shopping-cart' ); ?>
61
- <?php echo sprintf(
62
- __( 'Importing %s of %s items', 'ecwid-shopping-cart' ),
63
- '<span id="import-progress-current">0</span>',
64
- '<span id="import-progress-total">' . (Ecwid_Importer::count_woo_products() + Ecwid_Importer::count_woo_categories()) . '</span>' );
 
 
 
 
65
  ?>
66
  </div>
67
 
68
  <div class="canonical-status__text" data-ec-importer-process-images style="display: none;">
69
- <?php _e( 'Copying images.', 'ecwid-shopping-cart' ); ?>
70
- <?php echo sprintf(
71
- __( 'Importing %s of %s items', 'ecwid-shopping-cart' ),
72
- '<span id="import-images-progress-current">0</span>',
73
- '<span id="import-images-progress-total">0</span>' );
 
 
 
 
74
  ?>
75
  </div>
76
 
@@ -89,13 +97,16 @@
89
  <div class="feature-element__text">
90
  <p>
91
  <?php
92
- _e( 'Import creates new products and update the existing products with matching SKUs.', 'ecwid-shopping-cart' );
93
  ?>
94
 
95
  <?php
96
- if ( !Ecwid_Config::is_wl() ) {
97
- echo sprintf( __( 'Please mind the maximum number of products and categories you can have in your Ecwid store. This import tool will automatically stop when the store products limit is reached. To check the current store limit or increase it, please see the <nobr><a %s target="_blank">"Billing & Plans"</a></nobr> page in your Ecwid store control panel.', 'ecwid-shopping-cart'),
98
- 'href="admin.php?page=ec-store-admin-billing"'
 
 
 
99
  );
100
  }
101
  ?>
@@ -104,16 +115,18 @@
104
 
105
  <div class="feature-element__action" data-ec-importer-state="default">
106
  <button type="button" class="btn btn-primary btn-medium" id="ec-importer-woo-go">
107
- <span><?php _e( 'Start Import', 'ecwid-shopping-cart' ); ?></span>
108
  </button>
109
  </div>
110
  </div>
111
 
112
- <?php }?>
 
 
113
 
114
  </div>
115
  <div class="feature-element__picture">
116
- <img src="<?php echo( esc_attr( ECWID_PLUGIN_URL )); ?>templates/importer/import-picture-feature.png" alt="" />
117
  </div>
118
  </div>
119
  </div>
@@ -121,7 +134,7 @@
121
  </div>
122
 
123
  <?php
124
- if( $this->_is_token_ok() ) {
125
  require __DIR__ . '/woo-summary.tpl.php';
126
  }
127
  ?>
1
  <div class="settings-page">
2
  <div class="settings-page__header">
3
  <div class="settings-page__titles settings-page__titles--left">
4
+ <h1 class="settings-page__title"><?php echo esc_html( sprintf( __( 'Import Your Products From Woocommerce to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?></h1>
5
  <div class="settings-page__subtitle"></div>
6
  </div>
7
 
8
  <?php
9
+ if ( $this->_is_token_ok() ) {
10
  require __DIR__ . '/woo-complete-alert.tpl.php';
11
  }
12
  ?>
15
  <div class="named-area">
16
  <div class="named-area__header">
17
  <div class="named-area__titles">
18
+ <div class="named-area__title"><?php esc_html_e( 'Update your catalog', 'ecwid-shopping-cart' ); ?></div>
19
+ <div class="named-area__subtitle"><?php echo esc_html__( sprintf( __( 'This import will copy your WooCommerce products and categories to your %s store.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?></div>
20
  </div>
21
  </div>
22
  <div class="named-area__body">
29
  <div class="feature-element__core">
30
  <div class="feature-element__data">
31
 
32
+ <div class="feature-element__title" data-ec-importer-state="default"><?php echo esc_html( sprintf( __( 'Import your products from Woocommerce to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?></div>
33
 
34
+ <div class="feature-element__title" data-ec-importer-state="process"><?php esc_html_e( 'Import is in Progress', 'ecwid-shopping-cart' ); ?></div>
35
 
36
+ <div class="feature-element__title" data-ec-importer-state="complete"><?php echo esc_html( sprintf( __( 'Import your products from WooCommerce to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?></div>
37
 
38
  <?php
39
+ if ( ! $this->_is_token_ok() ) {
40
  require __DIR__ . '/import-no-token.tpl.php';
41
  }
42
  ?>
43
 
44
+ <?php if ( $this->_is_token_ok() ) { ?>
45
 
46
  <div class="feature-element__status" data-ec-importer-state="complete">
47
  <span class="feature-element__status-title success">
48
+ <?php
49
  echo sprintf(
50
+ __( 'Import completed. <a href="%s">Run again.</a>', 'ecwid-shopping-cart' ), //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
51
+ esc_url( admin_url( 'admin.php?page=' . Ecwid_Import_Page::PAGE_SLUG_WOO ) )
52
  );
53
  ?>
54
  </span>
57
  <div class="feature-element__status" data-ec-importer-state="process">
58
  <div class="canonical-status canonical-status--has-icon canonical-status--loading canonical-status--prepend-icon canonical-status--warning">
59
  <div class="canonical-status__text">
60
+ <?php esc_html_e( 'Copying products and categories.', 'ecwid-shopping-cart' ); ?>
61
+ <?php
62
+ echo wp_kses_post(
63
+ sprintf(
64
+ __( 'Importing %1$s of %2$s items', 'ecwid-shopping-cart' ),
65
+ '<span id="import-progress-current">0</span>',
66
+ '<span id="import-progress-total">' . ( Ecwid_Importer::count_woo_products() + Ecwid_Importer::count_woo_categories() ) . '</span>'
67
+ )
68
+ );
69
  ?>
70
  </div>
71
 
72
  <div class="canonical-status__text" data-ec-importer-process-images style="display: none;">
73
+ <?php esc_html_e( 'Copying images.', 'ecwid-shopping-cart' ); ?>
74
+ <?php
75
+ echo wp_kses_post(
76
+ sprintf(
77
+ __( 'Importing %1$s of %2$s items', 'ecwid-shopping-cart' ),
78
+ '<span id="import-images-progress-current">0</span>',
79
+ '<span id="import-images-progress-total">0</span>'
80
+ )
81
+ );
82
  ?>
83
  </div>
84
 
97
  <div class="feature-element__text">
98
  <p>
99
  <?php
100
+ esc_html_e( 'Import creates new products and update the existing products with matching SKUs.', 'ecwid-shopping-cart' );
101
  ?>
102
 
103
  <?php
104
+ if ( ! Ecwid_Config::is_wl() ) {
105
+ echo wp_kses_post(
106
+ sprintf(
107
+ __( 'Please mind the maximum number of products and categories you can have in your Ecwid store. This import tool will automatically stop when the store products limit is reached. To check the current store limit or increase it, please see the <nobr><a %s target="_blank">"Billing & Plans"</a></nobr> page in your Ecwid store control panel.', 'ecwid-shopping-cart' ),
108
+ 'href="admin.php?page=ec-store-admin-billing"'
109
+ )
110
  );
111
  }
112
  ?>
115
 
116
  <div class="feature-element__action" data-ec-importer-state="default">
117
  <button type="button" class="btn btn-primary btn-medium" id="ec-importer-woo-go">
118
+ <span><?php esc_html_e( 'Start Import', 'ecwid-shopping-cart' ); ?></span>
119
  </button>
120
  </div>
121
  </div>
122
 
123
+ <?php
124
+ }//end if
125
+ ?>
126
 
127
  </div>
128
  <div class="feature-element__picture">
129
+ <img src="<?php echo( esc_attr( ECWID_PLUGIN_URL ) ); ?>templates/importer/import-picture-feature.png" alt="" />
130
  </div>
131
  </div>
132
  </div>
134
  </div>
135
 
136
  <?php
137
+ if ( $this->_is_token_ok() ) {
138
  require __DIR__ . '/woo-summary.tpl.php';
139
  }
140
  ?>
templates/importer/woo-summary.tpl.php CHANGED
@@ -3,45 +3,55 @@
3
 
4
  <ul class="titled-items-list">
5
  <li class="titled-items-list__item titled-item">
6
- <div class="titled-item__title"><?php _e( 'Import summary', 'ecwid-shopping-cart' ); ?></div>
7
  <div class="titled-item__content">
8
  &mdash;
9
  <?php
10
- _e( 'Your WooCommerce store has ', 'ecwid-shopping-cart' );
11
- echo $this->_get_products_categories_message(
12
- Ecwid_Importer::count_woo_products(),
13
- Ecwid_Importer::count_woo_categories()
14
- );
15
- ?>
 
 
16
  </div>
17
  <div class="titled-item__content">
18
  &mdash;
19
  <?php
20
- printf(
21
- __( 'Your %s store has ', 'ecwid-shopping-cart' ),
22
- Ecwid_Config::get_brand()
 
 
 
 
 
 
 
 
23
  );
24
- echo $this->_get_products_categories_message(
25
- Ecwid_Importer::count_ecwid_products(),
26
- Ecwid_Importer::count_ecwid_categories()
27
- );
28
- ?>
29
  </div>
30
  <div class="titled-item__content">
31
  &mdash;
32
  <?php
33
- echo sprintf(
34
- __( 'After import, your %s store will have ', 'ecwid-shopping-cart' ),
35
- Ecwid_Config::get_brand()
 
 
36
  );
37
- echo $this->_get_products_categories_message(
38
- Ecwid_Importer::count_ecwid_products() + Ecwid_Importer::count_woo_products(),
39
- Ecwid_Importer::count_ecwid_categories() + Ecwid_Importer::count_woo_categories()
 
 
40
  );
41
- ?>
42
  </div>
43
  </li>
44
  </ul>
45
 
46
  </div>
47
- </div>
3
 
4
  <ul class="titled-items-list">
5
  <li class="titled-items-list__item titled-item">
6
+ <div class="titled-item__title"><?php esc_html_e( 'Import summary', 'ecwid-shopping-cart' ); ?></div>
7
  <div class="titled-item__content">
8
  &mdash;
9
  <?php
10
+ esc_html_e( 'Your WooCommerce store has ', 'ecwid-shopping-cart' );
11
+ echo esc_html(
12
+ $this->_get_products_categories_message(
13
+ Ecwid_Importer::count_woo_products(),
14
+ Ecwid_Importer::count_woo_categories()
15
+ )
16
+ );
17
+ ?>
18
  </div>
19
  <div class="titled-item__content">
20
  &mdash;
21
  <?php
22
+ echo esc_html(
23
+ sprintf(
24
+ __( 'Your %s store has ', 'ecwid-shopping-cart' ),
25
+ Ecwid_Config::get_brand()
26
+ )
27
+ );
28
+ echo esc_html(
29
+ $this->_get_products_categories_message(
30
+ Ecwid_Importer::count_ecwid_products(),
31
+ Ecwid_Importer::count_ecwid_categories()
32
+ )
33
  );
34
+ ?>
 
 
 
 
35
  </div>
36
  <div class="titled-item__content">
37
  &mdash;
38
  <?php
39
+ echo esc_html(
40
+ sprintf(
41
+ __( 'After import, your %s store will have ', 'ecwid-shopping-cart' ),
42
+ Ecwid_Config::get_brand()
43
+ )
44
  );
45
+ echo esc_html(
46
+ $this->_get_products_categories_message(
47
+ Ecwid_Importer::count_ecwid_products() + Ecwid_Importer::count_woo_products(),
48
+ Ecwid_Importer::count_ecwid_categories() + Ecwid_Importer::count_woo_categories()
49
+ )
50
  );
51
+ ?>
52
  </div>
53
  </li>
54
  </ul>
55
 
56
  </div>
57
+ </div>
templates/popup/deactivate.php CHANGED
@@ -1,26 +1,32 @@
1
- <h3><?php _e( 'If you have a moment, please let us know why you are deactivating:', 'ecwid-shopping-cart' ); ?></h3>
2
 
3
  <ul class="reasons-list">
4
- <?php foreach ( $reasons as $key => $reason ): ?>
5
- <li class="reasons-list-item" data-option-key="<?php echo $key; ?>">
6
  <label>
7
  <span>
8
- <input type="radio" name="reason" value="<?php echo $key; ?>" data-text="<?php esc_attr_e( $reason['text'] ); ?>"/>
9
  </span>
10
  <span>
11
- <?php echo $reason['text']; ?>
12
  </span>
13
  </label>
14
- <?php if ( @$reason['has_message'] ): ?>
15
  <div class="message">
16
- <textarea name="message[<?php echo $key; ?>]" placeholder="<?php echo $reason['message_hint']; ?>"><?php if($reason['code'] == 'theme'){ echo $reason['message_hint']; } ?></textarea>
 
 
 
 
 
 
17
 
18
  <div class="ec-deactivate-notice">
19
  <?php
20
  echo sprintf(
21
- __('You can <a %1$s>contact %2$s support</a> and let us help you with the problem you are facing, instead of removing the plugin.', 'ecwid-shopping-cart'),
22
- sprintf( 'href="%s" target="_blank"', $support_link ),
23
- Ecwid_Config::get_brand()
24
  );
25
  ?>
26
  </div>
@@ -29,4 +35,4 @@
29
  <?php endif; ?>
30
  </li>
31
  <?php endforeach; ?>
32
- </ul>
1
+ <h3><?php esc_html_e( 'If you have a moment, please let us know why you are deactivating:', 'ecwid-shopping-cart' ); ?></h3>
2
 
3
  <ul class="reasons-list">
4
+ <?php foreach ( $reasons as $key => $reason ) : ?>
5
+ <li class="reasons-list-item" data-option-key="<?php echo esc_attr( $key ); ?>">
6
  <label>
7
  <span>
8
+ <input type="radio" name="reason" value="<?php echo esc_attr( $key ); ?>" data-text="<?php esc_attr_e( $reason['text'] ); ?>"/>
9
  </span>
10
  <span>
11
+ <?php echo esc_html( $reason['text'] ); ?>
12
  </span>
13
  </label>
14
+ <?php if ( isset( $reason['has_message'] ) && $reason['has_message'] ) : ?>
15
  <div class="message">
16
+ <?php
17
+ $message_hint = '';
18
+ if ( $reason['code'] === 'theme' ) {
19
+ $message_hint = $reason['message_hint'];
20
+ }
21
+ ?>
22
+ <textarea name="message[<?php echo esc_attr( $key ); ?>]" placeholder="<?php echo esc_attr( $reason['message_hint'] ); ?>"><?php echo esc_textarea( $message_hint ); ?></textarea>
23
 
24
  <div class="ec-deactivate-notice">
25
  <?php
26
  echo sprintf(
27
+ __( 'You can <a %1$s>contact %2$s support</a> and let us help you with the problem you are facing, instead of removing the plugin.', 'ecwid-shopping-cart' ), //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
28
+ 'href="' . esc_url( $support_link ) . '" target="_blank"',
29
+ esc_html( Ecwid_Config::get_brand() )
30
  );
31
  ?>
32
  </div>
35
  <?php endif; ?>
36
  </li>
37
  <?php endforeach; ?>
38
+ </ul>
templates/popup/footer.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php foreach ( $this->_get_footer_buttons() as $button ): ?>
2
- <button class="button <?php echo $button->class; ?>"><?php echo $button->title; ?></button>
3
  <?php endforeach; ?>
1
+ <?php foreach ( $this->_get_footer_buttons() as $button ) : ?>
2
+ <button class="button <?php echo esc_attr( $button->class ); ?>"><?php echo esc_html( $button->title ); ?></button>
3
  <?php endforeach; ?>
templates/popup/header.php CHANGED
@@ -1 +1 @@
1
- <h3><?php echo $this->_get_header(); ?></h3>
1
+ <h3><?php echo esc_html( $this->_get_header() ); ?></h3>
templates/product-popup.php CHANGED
@@ -1,84 +1,84 @@
1
  <script type="text/template" id="tmpl-product-in-list">
2
 
3
- <tr id="product-{{ data.id }}">
4
- <td class="product-thumb column-product-thumb has-row-actions" data-colname="Product">
5
- <div><img data-src="{{ data.image_url }}" alt=""></div>
6
- </td>
7
- <td class="product-name column-product-name has-row-actions column-primary" data-colname="Product Name">
8
- <div>{{ data.name }}</div>
9
- </td>
10
- <td class="sku column-sku has-row-actions" data-colname="SKU">
11
- <div>{{ data.sku }}</div>
12
- </td>
13
- </tr>
14
  </script>
15
 
16
  <script type="text/template" id="tmpl-products-list">
17
- <table class="wp-list-table widefat fixed striped products">
18
- <thead>
19
- <tr>
20
- <td id="cb" class="manage-column column-cb check-column"></td>
21
- <th scope="col" id="name" class="manage-column column-name column-primary sortable">
22
- <a href="">
23
- <span><?php _e( 'Name', 'ecwid-shopping-cart' ); ?></span>
24
- <span class="sorting-indicator"></span>
25
- </a>
26
- </th>
27
- <th scope="col" id="sku" class="manage-column column-sku sortable">
28
- <a href="">
29
- <span><?php _e( 'SKU', 'ecwid-shopping-cart' ); ?></span>
30
- <span class="sorting-indicator"></span>
31
- </a>
32
- </th>
33
- </tr>
34
- </thead>
35
- <tbody>
36
 
37
- </tbody>
38
- </table>
39
 
40
  </script>
41
 
42
  <script type="text/template" id="tmpl-add-product-form">
43
- <form action="">
44
- <p class="products-search">
45
- <span class="search-input">
46
- <label class="screen-reader-text" for="product-search-input">
47
- <?php _e( 'Search', 'ecwid-shopping-cart' ); ?>
48
- </label>
49
- <input type="search" id="product-search-input" name="s" value="" placeholder="<?php _e( 'Title or SKU', 'ecwid-shopping-cart' ); ?>">
50
- </span>
51
- <span class="search-button">
52
- <button type="submit" id="search-submit" class="button">
53
- <span class="button-text"><?php _e( 'Search', 'ecwid-shopping-cart' ); ?></span>
54
- <img class="searching-icon" src="<?php echo(esc_attr(ECWID_PLUGIN_URL)); ?>/images/download.gif" />
55
- </button>
56
- <!--input type="submit" id="search-submit" class="button" value="<?php _e( 'Search', 'ecwid-shopping-cart' ); ?>"-->
57
- </span>
58
- </p>
59
- </form>
60
 
61
- {{{ data.tableHTML }}}
62
 
63
- <div class="tablenav bottom">
64
- <div class="tablenav-pages">
65
- <span class="displaying-num">{{ data.total_items }}</span>
66
- <span class="pagination-links">
67
- {{{ data.prev_pages }}}
68
- <span class="paging-input">
69
- <label for="current-page-selector" class="screen-reader-text"><?php _e( 'Current Page', 'ecwid-shopping-cart' ); ?></label>
70
- <span class="tablenav-paging-text">{{ data.page }} of <span class="total-pages">{{ data.total_pages }}</span></span></span>
71
- {{{ data.next_pages }}}
72
 
73
- </span>
74
- </div>
75
- </div>
76
  </script>
77
 
78
  <script type="text/template" id="tmpl-pagination-button-enabled">
79
  <a class="{{ data.name }}-page" href="" data-page="{{ data.page }}">
80
- <span class="screen-reader-text">{{ data.label }}<?php _e( 'Next page', 'ecwid-shopping-cart' ); ?></span>
81
- <span aria-hidden="true">{{ data.symbol }}</span>
82
  </a>
83
 
84
  </script>
@@ -88,169 +88,169 @@
88
  </script>
89
 
90
  <script type="text/template" id="tmpl-no-products">
91
- <tr class="empty">
92
- <td colspan="3">
93
- <div class="empty-page">
94
- <div class="empty-page__title"><?php _e( 'Nothing found for <span class="empty-page__term">"{{ data.term }}"</span>', 'ecwid-shopping-cart' ); ?></div>
95
- <div class="empty-page__suggestions">
96
- <?php _e( 'Try another search.', 'ecwid-shopping-cart' ); ?>
97
- <a href="#" id="ecwid-reset-search"><?php _e( 'Browse all products.', 'ecwid-shopping-cart' ); ?></a>
98
- </div>
99
- </div>
100
- </td>
101
- </tr>
102
  </script>
103
 
104
  <script type="text/template" id="tmpl-checkbox-option">
105
- <label class="checkbox-option">
106
- <span>
107
- <input type="checkbox" checked="checked" name="{{ data.name }}" {{{ data.additionalAttributes }}}>
108
- </span>
109
- <span class="label">
110
- {{ data.label }}
111
- </span>
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">
133
- <a class="media-modal-close" href="#" title="Close"><span class="media-modal-icon"></span></a>
134
- <div class="media-frame wp-core-ui">
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>
149
 
150
- <div class="media-frame-title customize">
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
 
160
- <div class="media-frame-content ecwid-add-product customize">
161
- <div class="store-settings-wrapper ecwid-search ecwid-minicart ecwid-categories" data-ecwid-widget-hover="">
162
- <div class="widget-settings display-options">
163
- <h3><?php _e( 'Choose product properties to display in widget', 'ecwid-shopping-cart' ); ?></h3>
164
- <div class="widget-settings__left"></div>
165
- <div class="widget-settings__right"></div>
166
- <script type="text/javascript">
167
- jQuery(document).ready(function() {
168
- ecwidRenderCheckboxOption.section = 'display-options';
169
 
170
- ecwidRenderCheckboxOption({
171
- 'section': 'display-options',
172
- 'name': 'picture',
173
- 'label': '<?php _e( 'Picture', 'ecwid-shopping-cart' ); ?>'
174
- });
175
- ecwidRenderCheckboxOption({
176
- 'section': 'display-options',
177
- 'name': 'options',
178
- 'label': '<?php _e( 'Options', 'ecwid-shopping-cart' ); ?>'
179
- });
180
- ecwidRenderCheckboxOption({
181
- 'section': 'display-options',
182
- 'name': 'title',
183
- 'label': '<?php _e( 'Title', 'ecwid-shopping-cart' ); ?>'
184
- });
185
- ecwidRenderCheckboxOption({
186
- 'section': 'display-options',
187
- 'name': 'quantity',
188
- 'label': '<?php _e( 'Quantity', 'ecwid-shopping-cart' ); ?>',
189
- 'displayOptionName': 'qty'
190
- });
191
- ecwidRenderCheckboxOption({
192
- 'section': 'display-options',
193
- 'name': 'price',
194
- 'label': '<?php _e( 'Price', 'ecwid-shopping-cart' ); ?>'
195
- });
196
- ecwidRenderCheckboxOption({
197
- 'section': 'display-options',
198
- 'name': 'addtobag',
199
- 'label': '<?php _e( '«Buy now» button', 'ecwid-shopping-cart' ); ?>'
200
- });
201
- });
202
- </script>
203
 
204
- </div>
205
- <div class="widget-settings shortcode-attributes">
206
- <h3><?php _e( 'Appearance', 'ecwid-shopping-cart' ); ?></h3>
 
 
 
 
 
 
207
 
208
- <div class="widget-settings__left"></div>
209
- <div class="widget-settings__right"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
 
211
- <script type="text/javascript">
212
- jQuery(document).ready(function() {
213
- ecwidRenderCheckboxOption.nextTarget = 'left';
214
- ecwidRenderCheckboxOption.section = 'shortcode-attributes';
215
 
216
- ecwidRenderCheckboxOption({
217
- 'section': 'shortcode-attributes',
218
- 'name': 'show_border',
219
- 'label': '<?php _e( 'Add border', 'ecwid-shopping-cart' ); ?>'
220
- });
221
- ecwidRenderCheckboxOption({
222
- 'section': 'shortcode-attributes',
223
- 'name': 'show_price_on_button',
224
- 'label': '<?php _e( 'Show price inside the "Buy now" button', 'ecwid-shopping-cart' ); ?>'
225
- });
226
- ecwidRenderCheckboxOption({
227
- 'section': 'shortcode-attributes',
228
- 'name': 'center_align',
229
- 'label': '<?php _e( 'Center align on a page', 'ecwid-shopping-cart' ); ?>'
230
- });
231
 
232
- });
233
- </script>
234
- </div>
235
- </div>
236
- </div>
237
 
238
- <div class="media-frame-toolbar">
239
- <div class="media-toolbar">
240
- <div class="media-toolbar-primary add-product">
241
- <a target="_blank" class="toolbar-link customize-appearance" data-content="customize" href="#"><?php _e( 'customize appearance', 'ecwid-shopping-cart' ); ?></a>
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>
253
- </div>
254
- </div>
255
- <div class="media-modal-backdrop"></div>
256
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <script type="text/template" id="tmpl-product-in-list">
2
 
3
+ <tr id="product-{{ data.id }}">
4
+ <td class="product-thumb column-product-thumb has-row-actions" data-colname="Product">
5
+ <div><img data-src="{{ data.image_url }}" alt=""></div>
6
+ </td>
7
+ <td class="product-name column-product-name has-row-actions column-primary" data-colname="Product Name">
8
+ <div>{{ data.name }}</div>
9
+ </td>
10
+ <td class="sku column-sku has-row-actions" data-colname="SKU">
11
+ <div>{{ data.sku }}</div>
12
+ </td>
13
+ </tr>
14
  </script>
15
 
16
  <script type="text/template" id="tmpl-products-list">
17
+ <table class="wp-list-table widefat fixed striped products">
18
+ <thead>
19
+ <tr>
20
+ <td id="cb" class="manage-column column-cb check-column"></td>
21
+ <th scope="col" id="name" class="manage-column column-name column-primary sortable">
22
+ <a href="">
23
+ <span><?php esc_html_e( 'Name', 'ecwid-shopping-cart' ); ?></span>
24
+ <span class="sorting-indicator"></span>
25
+ </a>
26
+ </th>
27
+ <th scope="col" id="sku" class="manage-column column-sku sortable">
28
+ <a href="">
29
+ <span><?php esc_html_e( 'SKU', 'ecwid-shopping-cart' ); ?></span>
30
+ <span class="sorting-indicator"></span>
31
+ </a>
32
+ </th>
33
+ </tr>
34
+ </thead>
35
+ <tbody>
36
 
37
+ </tbody>
38
+ </table>
39
 
40
  </script>
41
 
42
  <script type="text/template" id="tmpl-add-product-form">
43
+ <form action="">
44
+ <p class="products-search">
45
+ <span class="search-input">
46
+ <label class="screen-reader-text" for="product-search-input">
47
+ <?php esc_html_e( 'Search', 'ecwid-shopping-cart' ); ?>
48
+ </label>
49
+ <input type="search" id="product-search-input" name="s" value="" placeholder="<?php esc_html_e( 'Title or SKU', 'ecwid-shopping-cart' ); ?>">
50
+ </span>
51
+ <span class="search-button">
52
+ <button type="submit" id="search-submit" class="button">
53
+ <span class="button-text"><?php esc_html_e( 'Search', 'ecwid-shopping-cart' ); ?></span>
54
+ <img class="searching-icon" src="<?php echo( esc_attr( ECWID_PLUGIN_URL ) ); ?>/images/download.gif" />
55
+ </button>
56
+ <!--input type="submit" id="search-submit" class="button" value="<?php esc_html_e( 'Search', 'ecwid-shopping-cart' ); ?>"-->
57
+ </span>
58
+ </p>
59
+ </form>
60
 
61
+ {{{ data.tableHTML }}}
62
 
63
+ <div class="tablenav bottom">
64
+ <div class="tablenav-pages">
65
+ <span class="displaying-num">{{ data.total_items }}</span>
66
+ <span class="pagination-links">
67
+ {{{ data.prev_pages }}}
68
+ <span class="paging-input">
69
+ <label for="current-page-selector" class="screen-reader-text"><?php esc_html_e( 'Current Page', 'ecwid-shopping-cart' ); ?></label>
70
+ <span class="tablenav-paging-text">{{ data.page }} of <span class="total-pages">{{ data.total_pages }}</span></span></span>
71
+ {{{ data.next_pages }}}
72
 
73
+ </span>
74
+ </div>
75
+ </div>
76
  </script>
77
 
78
  <script type="text/template" id="tmpl-pagination-button-enabled">
79
  <a class="{{ data.name }}-page" href="" data-page="{{ data.page }}">
80
+ <span class="screen-reader-text">{{ data.label }}<?php esc_html_e( 'Next page', 'ecwid-shopping-cart' ); ?></span>
81
+ <span aria-hidden="true">{{ data.symbol }}</span>
82
  </a>
83
 
84
  </script>
88
  </script>
89
 
90
  <script type="text/template" id="tmpl-no-products">
91
+ <tr class="empty">
92
+ <td colspan="3">
93
+ <div class="empty-page">
94
+ <div class="empty-page__title"><?php esc_html_e( 'Nothing found for <span class="empty-page__term">"{{ data.term }}"</span>', 'ecwid-shopping-cart' ); ?></div>
95
+ <div class="empty-page__suggestions">
96
+ <?php esc_html_e( 'Try another search.', 'ecwid-shopping-cart' ); ?>
97
+ <a href="#" id="ecwid-reset-search"><?php esc_html_e( 'Browse all products.', 'ecwid-shopping-cart' ); ?></a>
98
+ </div>
99
+ </div>
100
+ </td>
101
+ </tr>
102
  </script>
103
 
104
  <script type="text/template" id="tmpl-checkbox-option">
105
+ <label class="checkbox-option">
106
+ <span>
107
+ <input type="checkbox" checked="checked" name="{{ data.name }}" {{{ data.additionalAttributes }}}>
108
+ </span>
109
+ <span class="label">
110
+ {{ data.label }}
111
+ </span>
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 esc_html_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">
133
+ <a class="media-modal-close" href="#" title="Close"><span class="media-modal-icon"></span></a>
134
+ <div class="media-frame wp-core-ui">
135
+ <div class="media-frame-menu">
136
+ <div class="media-menu">
137
+ <a href="#" class="media-menu-item active" data-content="add-product"><?php esc_html_e( 'Choose Product', 'ecwid-shopping-cart' ); ?></a>
138
+ <a href="#" class="media-menu-item" data-content="selected-product"><?php esc_html_e( 'Selected Product', 'ecwid-shopping-cart' ); ?></a>
139
+ <a href="#" class="media-menu-item" data-content="customize"><?php esc_html_e( 'Customize widget', 'ecwid-shopping-cart' ); ?></a>
140
+ </div>
141
+ </div>
142
+ <div class="media-frame-title selected-product">
143
+ <h1><?php esc_html_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 esc_html_e( 'Choose Product', 'ecwid-shopping-cart' ); ?><span class="dashicons dashicons-arrow-down"></span></h1>
148
+ </div>
149
 
150
+ <div class="media-frame-title customize">
151
+ <h1><?php esc_html_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
 
160
+ <div class="media-frame-content ecwid-add-product customize">
161
+ <div class="store-settings-wrapper ecwid-search ecwid-minicart ecwid-categories" data-ecwid-widget-hover="">
162
+ <div class="widget-settings display-options">
163
+ <h3><?php esc_html_e( 'Choose product properties to display in widget', 'ecwid-shopping-cart' ); ?></h3>
164
+ <div class="widget-settings__left"></div>
165
+ <div class="widget-settings__right"></div>
166
+ <script type="text/javascript">
167
+ jQuery(document).ready(function() {
168
+ ecwidRenderCheckboxOption.section = 'display-options';
169
 
170
+ ecwidRenderCheckboxOption({
171
+ 'section': 'display-options',
172
+ 'name': 'picture',
173
+ 'label': '<?php esc_html_e( 'Picture', 'ecwid-shopping-cart' ); ?>'
174
+ });
175
+ ecwidRenderCheckboxOption({
176
+ 'section': 'display-options',
177
+ 'name': 'options',
178
+ 'label': '<?php esc_html_e( 'Options', 'ecwid-shopping-cart' ); ?>'
179
+ });
180
+ ecwidRenderCheckboxOption({
181
+ 'section': 'display-options',
182
+ 'name': 'title',
183
+ 'label': '<?php esc_html_e( 'Title', 'ecwid-shopping-cart' ); ?>'
184
+ });
185
+ ecwidRenderCheckboxOption({
186
+ 'section': 'display-options',
187
+ 'name': 'quantity',
188
+ 'label': '<?php esc_html_e( 'Quantity', 'ecwid-shopping-cart' ); ?>',
189
+ 'displayOptionName': 'qty'
190
+ });
191
+ ecwidRenderCheckboxOption({
192
+ 'section': 'display-options',
193
+ 'name': 'price',
194
+ 'label': '<?php esc_html_e( 'Price', 'ecwid-shopping-cart' ); ?>'
195
+ });
196
+ ecwidRenderCheckboxOption({
197
+ 'section': 'display-options',
198
+ 'name': 'addtobag',
199
+ 'label': '<?php esc_html_e( '«Buy now» button', 'ecwid-shopping-cart' ); ?>'
200
+ });
201
+ });
202
+ </script>
203
 
204
+ </div>
205
+ <div class="widget-settings shortcode-attributes">
206
+ <h3><?php esc_html_e( 'Appearance', 'ecwid-shopping-cart' ); ?></h3>
 
207
 
208
+ <div class="widget-settings__left"></div>
209
+ <div class="widget-settings__right"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
210
 
211
+ <script type="text/javascript">
212
+ jQuery(document).ready(function() {
213
+ ecwidRenderCheckboxOption.nextTarget = 'left';
214
+ ecwidRenderCheckboxOption.section = 'shortcode-attributes';
 
215
 
216
+ ecwidRenderCheckboxOption({
217
+ 'section': 'shortcode-attributes',
218
+ 'name': 'show_border',
219
+ 'label': '<?php esc_html_e( 'Add border', 'ecwid-shopping-cart' ); ?>'
220
+ });
221
+ ecwidRenderCheckboxOption({
222
+ 'section': 'shortcode-attributes',
223
+ 'name': 'show_price_on_button',
224
+ 'label': '<?php esc_html_e( 'Show price inside the "Buy now" button', 'ecwid-shopping-cart' ); ?>'
225
+ });
226
+ ecwidRenderCheckboxOption({
227
+ 'section': 'shortcode-attributes',
228
+ 'name': 'center_align',
229
+ 'label': '<?php esc_html_e( 'Center align on a page', 'ecwid-shopping-cart' ); ?>'
230
+ });
231
+
232
+ });
233
+ </script>
234
+ </div>
235
+ </div>
236
+ </div>
237
+
238
+ <div class="media-frame-toolbar">
239
+ <div class="media-toolbar">
240
+ <div class="media-toolbar-primary add-product">
241
+ <a target="_blank" class="toolbar-link customize-appearance" data-content="customize" href="#"><?php esc_html_e( 'customize appearance', 'ecwid-shopping-cart' ); ?></a>
242
+ <a target="_blank" class="toolbar-link add-product" data-content="add-product" style="display: none" href="#"><?php esc_html_e( 'select product', 'ecwid-shopping-cart' ); ?></a>
243
+ <a href="#" class="button media-button button-primary button-large media-button-select"><?php esc_html_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 esc_html_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 esc_html_e( 'selected product', 'ecwid-shopping-cart' ); ?></a>
248
+ <a href="#" class="button media-button button-primary button-large media-button-update"><?php esc_html_e( 'Update', 'ecwid-shopping-cart' ); ?></a>
249
+ </div>
250
+ </div>
251
+ </div>
252
+ </div>
253
+ </div>
254
+ </div>
255
+ <div class="media-modal-backdrop"></div>
256
+ </div>
templates/product.php CHANGED
@@ -1,3 +1,3 @@
1
  <?php
2
  $content = "<script>xProductBrowser('defaultProductId=$ecwid_id');</script>";
3
- echo ecwid_wrap_shortcode_content( $content, 'product', array() );
1
  <?php
2
  $content = "<script>xProductBrowser('defaultProductId=$ecwid_id');</script>";
3
+ echo ecwid_wrap_shortcode_content( $content, 'product', array() ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
templates/reconnect-sso.php CHANGED
@@ -1,21 +1,21 @@
1
  <div class="wrap ecwid-admin ecwid-connect ecwid-reconnect-allow-sso">
2
  <div class="ec-store-box">
3
- <?php require ECWID_PLUGIN_DIR . 'templates/admin-head.php'; ?>
4
 
5
  <div class="main-wrap">
6
  <div class="column">
7
- <h4><?php _e('Your store Control Panel. Right here in WordPress.', 'ecwid-shopping-cart'); ?></h4>
8
- <p class="note"><?php _e('Manage products, track sales, adjust settings - <nobr>All without</nobr> leaving this page.', 'ecwid-shopping-cart'); ?></p>
9
  <div class="connect-button">
10
- <a href="admin-post.php?action=ec_connect&reconnect"><?php _e( 'Re-connect to Enable Control Panel', 'ecwid-shopping-cart' ); ?></a>
11
  </div>
12
  </div>
13
 
14
  <div class="column">
15
- <img src="<?php echo(esc_attr(ECWID_PLUGIN_URL)); ?>/images/new-feature.png" />
16
  </div>
17
  </div>
18
 
19
  </div>
20
  <?php require_once ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
21
- </div>
1
  <div class="wrap ecwid-admin ecwid-connect ecwid-reconnect-allow-sso">
2
  <div class="ec-store-box">
3
+ <?php require ECWID_PLUGIN_DIR . 'templates/admin-head.php'; ?>
4
 
5
  <div class="main-wrap">
6
  <div class="column">
7
+ <h4><?php esc_html_e( 'Your store Control Panel. Right here in WordPress.', 'ecwid-shopping-cart' ); ?></h4>
8
+ <p class="note"><?php echo wp_kses_post( __( 'Manage products, track sales, adjust settings - <nobr>All without</nobr> leaving this page.', 'ecwid-shopping-cart' ) ); ?></p>
9
  <div class="connect-button">
10
+ <a href="admin-post.php?action=ec_connect&reconnect"><?php esc_html_e( 'Re-connect to Enable Control Panel', 'ecwid-shopping-cart' ); ?></a>
11
  </div>
12
  </div>
13
 
14
  <div class="column">
15
+ <img src="<?php echo esc_attr( ECWID_PLUGIN_URL ); ?>/images/new-feature.png" />
16
  </div>
17
  </div>
18
 
19
  </div>
20
  <?php require_once ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
21
+ </div>
templates/shortcode-stub-store.tpl.php CHANGED
@@ -1,37 +1,37 @@
1
  <div class="ec-store-generic-block ec-store-block">
2
- <div class="ec-store-block-header">
3
- <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1"><g id="Typography" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="gutenberg-widgets-icons" transform="translate(-234.000000, -324.000000)" fill="#979797" fill-rule="nonzero"><g id="store-icon" transform="translate(234.000000, 324.000000)"><path d="M9,20.4893188 L7,20.4893188 L7,14 C7,13.4477153 7.44771525,13 8,13 L16,13 C16.5522847,13 17,13.4477153 17,14 L17,20.4893188 C16.260376,20.4893188 15.5929565,20.4893188 15,20.4893188 L15,15 L9,15 L9,20.4893188 Z" id="Rectangle-3"></path><path d="M20,10 L22,10 L22,21.0006104 C22,21.5528951 21.5522847,22.0006104 21,22.0006104 L3,22.0006104 C2.44771525,22.0006104 2,21.5528951 2,21.0006104 L2,10 L4,10 L4,20.0006104 L20,20.0006104 L20,10 Z" id="Rectangle-3"></path><path d="M2,6.5 C2,7.88071187 3.11928813,9 4.5,9 C5.18185515,9 5.81786053,8.72707728 6.28575907,8.24959145 L7,7.52071565 L7.71424093,8.24959145 C8.18213947,8.72707728 8.81814485,9 9.5,9 C10.1818552,9 10.8178605,8.72707728 11.2857591,8.24959145 L12,7.52071565 L12.7142409,8.24959145 C13.1821395,8.72707728 13.8181448,9 14.5,9 C15.1818552,9 15.8178605,8.72707728 16.2857591,8.24959145 L17,7.52071565 L17.7142409,8.24959145 C18.1821395,8.72707728 18.8181448,9 19.5,9 C20.8807119,9 22,7.88071187 22,6.5 C22,5.81342077 21.7917279,4.97737648 21.3637104,4 L2.63518632,4 C2.20791709,4.97255801 2,5.80837301 2,6.5 Z M4.5,11 C2.01471863,11 4.4408921e-16,8.98528137 0,6.5 C0,5.33310646 0.374574518,4.02209564 1.10468286,2.55457075 L1.38058736,2 L22.6207487,2 L22.8961752,2.55629959 C23.6256977,4.02977127 24,5.33982925 24,6.5 C24,8.98528137 21.9852814,11 19.5,11 C18.5937006,11 17.7289225,10.73006 17,10.2422809 C16.2710775,10.73006 15.4062994,11 14.5,11 C13.5937006,11 12.7289225,10.73006 12,10.2422809 C11.2710775,10.73006 10.4062994,11 9.5,11 C8.59370056,11 7.72892246,10.73006 7,10.2422809 C6.27107754,10.73006 5.40629944,11 4.5,11 Z" id="Combined-Shape"></path></g></g></g></svg>
4
- <?php _e( 'Store Home Page', 'ecwid-shopping-cart' ); ?>
5
- </div>
6
- <div class="ec-store-block-content">
7
- <div class="ec-store-products">
8
- <div class="ec-store-product-block">
9
- <div class="ec-store-product ec-store-product-m_sneaker"></div>
10
- <div class="ec-store-stub-sample"></div>
11
- </div>
12
- <div class="ec-store-product-block">
13
- <div class="ec-store-product ec-store-product-p_shirt"></div>
14
- <div class="ec-store-stub-sample"></div>
15
- </div>
16
- <div class="ec-store-product-block">
17
- <div class="ec-store-product ec-store-product-g_hat"></div>
18
- <div class="ec-store-stub-sample"></div>
19
- </div>
20
- </div>
21
- <div class="ec-store-products">
22
- <div class="ec-store-product-block">
23
- <div class="ec-store-product ec-store-product-b_watch"></div>
24
- <div class="ec-store-stub-sample"></div>
25
- </div>
26
- <div class="ec-store-product-block">
27
- <div class="ec-store-product ec-store-product-y_bag"></div>
28
- <div class="ec-store-stub-sample"></div>
29
- </div>
30
- <div class="ec-store-product-block">
31
- <div class="ec-store-product ec-store-product-p_sneaker"></div>
32
- <div class="ec-store-stub-sample"></div>
33
- </div>
34
- </div>
35
- </div>
36
- <div><?php _e( 'Your store will be shown here', 'ecwid-shopping-cart' ); ?></div>
37
- </div>
1
  <div class="ec-store-generic-block ec-store-block">
2
+ <div class="ec-store-block-header">
3
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1"><g id="Typography" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="gutenberg-widgets-icons" transform="translate(-234.000000, -324.000000)" fill="#979797" fill-rule="nonzero"><g id="store-icon" transform="translate(234.000000, 324.000000)"><path d="M9,20.4893188 L7,20.4893188 L7,14 C7,13.4477153 7.44771525,13 8,13 L16,13 C16.5522847,13 17,13.4477153 17,14 L17,20.4893188 C16.260376,20.4893188 15.5929565,20.4893188 15,20.4893188 L15,15 L9,15 L9,20.4893188 Z" id="Rectangle-3"></path><path d="M20,10 L22,10 L22,21.0006104 C22,21.5528951 21.5522847,22.0006104 21,22.0006104 L3,22.0006104 C2.44771525,22.0006104 2,21.5528951 2,21.0006104 L2,10 L4,10 L4,20.0006104 L20,20.0006104 L20,10 Z" id="Rectangle-3"></path><path d="M2,6.5 C2,7.88071187 3.11928813,9 4.5,9 C5.18185515,9 5.81786053,8.72707728 6.28575907,8.24959145 L7,7.52071565 L7.71424093,8.24959145 C8.18213947,8.72707728 8.81814485,9 9.5,9 C10.1818552,9 10.8178605,8.72707728 11.2857591,8.24959145 L12,7.52071565 L12.7142409,8.24959145 C13.1821395,8.72707728 13.8181448,9 14.5,9 C15.1818552,9 15.8178605,8.72707728 16.2857591,8.24959145 L17,7.52071565 L17.7142409,8.24959145 C18.1821395,8.72707728 18.8181448,9 19.5,9 C20.8807119,9 22,7.88071187 22,6.5 C22,5.81342077 21.7917279,4.97737648 21.3637104,4 L2.63518632,4 C2.20791709,4.97255801 2,5.80837301 2,6.5 Z M4.5,11 C2.01471863,11 4.4408921e-16,8.98528137 0,6.5 C0,5.33310646 0.374574518,4.02209564 1.10468286,2.55457075 L1.38058736,2 L22.6207487,2 L22.8961752,2.55629959 C23.6256977,4.02977127 24,5.33982925 24,6.5 C24,8.98528137 21.9852814,11 19.5,11 C18.5937006,11 17.7289225,10.73006 17,10.2422809 C16.2710775,10.73006 15.4062994,11 14.5,11 C13.5937006,11 12.7289225,10.73006 12,10.2422809 C11.2710775,10.73006 10.4062994,11 9.5,11 C8.59370056,11 7.72892246,10.73006 7,10.2422809 C6.27107754,10.73006 5.40629944,11 4.5,11 Z" id="Combined-Shape"></path></g></g></g></svg>
4
+ <?php esc_html_e( 'Store Home Page', 'ecwid-shopping-cart' ); ?>
5
+ </div>
6
+ <div class="ec-store-block-content">
7
+ <div class="ec-store-products">
8
+ <div class="ec-store-product-block">
9
+ <div class="ec-store-product ec-store-product-m_sneaker"></div>
10
+ <div class="ec-store-stub-sample"></div>
11
+ </div>
12
+ <div class="ec-store-product-block">
13
+ <div class="ec-store-product ec-store-product-p_shirt"></div>
14
+ <div class="ec-store-stub-sample"></div>
15
+ </div>
16
+ <div class="ec-store-product-block">
17
+ <div class="ec-store-product ec-store-product-g_hat"></div>
18
+ <div class="ec-store-stub-sample"></div>
19
+ </div>
20
+ </div>
21
+ <div class="ec-store-products">
22
+ <div class="ec-store-product-block">
23
+ <div class="ec-store-product ec-store-product-b_watch"></div>
24
+ <div class="ec-store-stub-sample"></div>
25
+ </div>
26
+ <div class="ec-store-product-block">
27
+ <div class="ec-store-product ec-store-product-y_bag"></div>
28
+ <div class="ec-store-stub-sample"></div>
29
+ </div>
30
+ <div class="ec-store-product-block">
31
+ <div class="ec-store-product ec-store-product-p_sneaker"></div>
32
+ <div class="ec-store-stub-sample"></div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ <div><?php esc_html_e( 'Your store will be shown here', 'ecwid-shopping-cart' ); ?></div>
37
+ </div>
templates/shortcode-stub.tpl.php CHANGED
@@ -1,20 +1,20 @@
1
  <div class="ecwid-shortcode-stub">
2
  <div class="ecwid-shortcode-stub-header"><svg aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" class="dashicon" width="20" height="20" viewBox="0 0 20 20"><path 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
3
- 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
4
- 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
5
- 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
6
- 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
7
- 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
8
- 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
9
- 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
10
- 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
11
- 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
12
- 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
13
- 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
14
- 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
15
- 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
16
- S4.96,15.5,4.6,15.5z"></path></svg>
17
 
18
- <?php echo $message; ?>
19
  </div>
20
- </div>
1
  <div class="ecwid-shortcode-stub">
2
  <div class="ecwid-shortcode-stub-header"><svg aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" class="dashicon" width="20" height="20" viewBox="0 0 20 20"><path 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
3
+ 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
4
+ 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
5
+ 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
6
+ 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
7
+ 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
8
+ 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
9
+ 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
10
+ 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
11
+ 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
12
+ 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
13
+ 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
14
+ 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
15
+ 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
16
+ S4.96,15.5,4.6,15.5z"></path></svg>
17
 
18
+ <?php echo wp_kses_post( $message ); ?>
19
  </div>
20
+ </div>
templates/store-popup.php CHANGED
@@ -1,268 +1,305 @@
1
  <script data-cfasync="false" type="text/javascript">
2
- var ecwid_store_svg = '<?php echo get_site_url('', 'index.php?file=ecwid_store_svg.svg'); ?>';
3
  </script>
4
  <div id="ecwid-store-popup-content">
5
  <div class="media-modal wp-core-ui">
6
  <div class="media-modal-content">
7
- <a class="media-modal-close" href="#" title="Close"><span class="media-modal-icon"></span></a>
8
- <div class="media-frame wp-core-ui hide-router">
9
- <div class="media-frame-menu">
10
- <div class="media-menu">
11
- <a href="#" class="media-menu-item" data-content="add-store"><?php _e('Add Store', 'ecwid-shopping-cart'); ?></a>
12
- <a href="#" class="media-menu-item" data-content="store-settings"><?php _e('Store elements', 'ecwid-shopping-cart'); ?></a>
13
- <?php if (ecwid_is_legacy_appearance_used()): ?>
14
- <a href="#" class="media-menu-item" data-content="appearance"><?php _e('Appearance', 'ecwid-shopping-cart'); ?></a>
15
  <?php endif; ?>
16
- </div>
17
- </div>
18
 
19
- <div class="media-frame-title add-store">
20
- <h1>
21
- <?php _e('Add Store', 'ecwid-shopping-cart'); ?><span class="dashicons dashicons-arrow-down"></span>
22
- </h1>
23
- </div>
24
 
25
- <div class="media-frame-title store-settings">
26
- <h1>
27
- <?php _e('Store elements', 'ecwid-shopping-cart'); ?><span class="dashicons dashicons-arrow-down"></span>
28
- </h1>
29
- </div>
30
 
31
- <?php if (ecwid_is_legacy_appearance_used()): ?>
32
- <div class="media-frame-title appearance">
33
- <h1>
34
- <?php _e('Appearance', 'ecwid-shopping-cart'); ?><span class="dashicons dashicons-arrow-down"></span>
35
- </h1>
36
- </div>
37
  <?php endif; ?>
38
 
39
- <div class="media-frame-content ecwid-store-editor store-settings">
40
 
41
- <div class="store-settings-wrapper">
42
- <div class="store-settings-preview">
43
- <?php ecwid_embed_svg('add-store'); ?>
44
- <label for="show_search" class="ecwid-search" data-ecwid-widget="search"></label>
45
- <label for="show_categories" class="ecwid-categories" data-ecwid-widget="categories"></label>
46
- <?php if ( !get_option( 'ecwid_hide_old_minicart' ) ): ?>
47
- <label for="show_minicart" class="ecwid-minicart" data-ecwid-widget="minicart"></label>
48
- <?php endif; ?>
49
- </div>
50
 
51
- <div class="store-settings">
52
- <h3><?php _e('Choose widgets to show', 'ecwid-shopping-cart'); ?></h3>
53
- <p class="note"><?php _e('Product catalog will be shown automatically', 'ecwid-shopping-cart'); ?></p>
54
 
55
- <div class="pure-control-group">
56
- <label data-ecwid-widget="search">
57
- <input type="checkbox" name="show_search" id="show_search" />
58
- <?php _e('Show search', 'ecwid-shopping-cart'); ?>
59
- </label>
60
- </div>
61
-
62
- <?php if ( !get_option( 'ecwid_hide_old_minicart' ) ): ?>
63
- <div class="pure-control-group">
64
- <label data-ecwid-widget="minicart">
65
- <input type="checkbox" name="show_minicart" id="show_minicart" />
66
- <?php _e('Show minicart', 'ecwid-shopping-cart'); ?>
67
- </label>
68
- </div>
69
- <?php endif; ?>
70
 
71
- <div class="pure-control-group">
72
- <label data-ecwid-widget="categories">
73
- <input type="checkbox" name="show_categories" id="show_categories" />
74
- <?php _e('Show categories', 'ecwid-shopping-cart'); ?>
75
- </label>
76
- </div>
77
 
78
- <div class="note">
79
- <?php echo sprintf(
80
- __('Additionally, you can add store controls to your website\'s toolbar using <a %s>WordPress native widgets</a>', 'ecwid-shopping-cart'),
81
- ' target="_blank" href="widgets.php?from-ec-store=' . (isset($_GET['post']) ? sanitize_text_field(wp_unslash($_GET['post'])) : 'new') . '"'
 
 
 
82
  );
83
  ?>
84
- </div>
85
 
86
- <div class="pure-control-group params-list default-category-id">
87
 
88
- <?php if ($categories): ?>
89
- <label for="ecwid_default_category_id">
90
- <?php _e('Category shown by default', 'ecwid-shopping-cart'); ?>
91
- </label>
92
 
93
 
94
- <div class="value">
95
 
96
- <select name="default_category_id" id="ecwid_default_category_id">
97
- <option value="0"<?php if (!get_option('ecwid_default_category_id')): ?> selected="selected"<?php endif; ?>>
98
- <?php _e('Store root category', 'ecwid-shopping-cart'); ?>
99
- </option>
100
- <?php foreach ($categories as $category): ?>
101
- <option
102
- value="<?php echo esc_attr($category->id); ?>"
103
- <?php if ($category->id == get_option('ecwid_default_category_id')): ?>
104
- selected="selected"
 
 
 
 
105
  <?php endif; ?>
106
- >
107
- <?php echo esc_html($category->path); ?>
108
- </option>
109
  <?php endforeach; ?>
110
- </select>
111
- </div>
112
 
113
  <?php endif; ?>
114
- </div>
115
- </div>
116
- </div>
117
- </div>
118
 
119
- <?php if (ecwid_is_legacy_appearance_used()): ?>
120
- <div class="media-frame-content ecwid-store-editor appearance">
121
 
122
- <div class="pure-control-group pb-views">
123
- <label class="products-per-page-label"><?php _e('Number of products per page', 'ecwid-shopping-cart'); ?></label>
124
- <div class="ecwid-pb-view-size grid active" tabindex="1">
125
- <div class="title"><?php _e('Grid view', 'ecwid-shopping-cart'); ?></div>
126
- <div class="main-area">
127
- <?php ecwid_embed_svg('grid'); ?>
128
- </div>
129
- <div class="right">
130
- <div class="ruler"></div>
131
- <input
132
- type="text"
133
- size="2"
134
- name="grid_rows"
135
- class="number"
136
- value="<?php echo esc_attr(get_option('ecwid_pb_productspercolumn_grid')); ?>"
137
- />
138
- </div>
139
- <div class="bottom">
140
- <div class="ruler"></div>
141
- <input
142
- type="text"
143
- size="2"
144
- name="grid_columns"
145
- class="number"
146
- value="<?php echo esc_attr(get_option('ecwid_pb_productsperrow_grid')); ?>"
147
- />
148
- </div>
149
- </div>
150
 
151
- <div class="ecwid-pb-view-size list" tabindex="1">
152
- <div class="title"><?php _e('List view', 'ecwid-shopping-cart'); ?></div>
153
- <div class="main-area">
154
- <?php ecwid_embed_svg('list'); ?>
155
- </div>
156
- <div class="right">
157
- <div class="ruler"></div>
158
- <input
159
- type="text"
160
- size="2"
161
- name="list_rows"
162
- class="number"
163
- value="<?php echo esc_attr(get_option('ecwid_pb_productsperpage_list')); ?>" />
164
- </div>
165
- </div>
166
 
167
 
168
- <div class="ecwid-pb-view-size table" tabindex="1">
169
- <div class="title"><?php _e('Table view', 'ecwid-shopping-cart'); ?></div>
170
- <div class="main-area">
171
- <?php ecwid_embed_svg('table'); ?>
172
- </div>
173
- <div class="right">
174
- <div class="ruler"></div>
175
- <input
176
- type="text"
177
- size="2"
178
- name="table_rows"
179
- class="number"
180
- value="<?php echo esc_attr(get_option('ecwid_pb_productsperpage_table')); ?>"
181
- />
182
- </div>
183
- </div>
184
- <p class="note pb-note"><?php printf( __( 'Here you can control how many products will be displayed per page. These options define maximum values. If there is not enough space to show all product columns, %s will adapt the number of columns to hold all products.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></p>
185
- </div>
186
 
187
- <hr class="after-pb" />
188
 
189
- <div class="pure-control-group params-list">
190
- <label for="ecwid_pb_categoriesperrow">
191
- <?php _e('Number of categories per row', 'ecwid-shopping-cart'); ?>
192
- </label>
193
- <input
194
- id="ecwid_pb_categoriesperrow"
195
- name="categories_per_row"
196
- type="text"
197
- class="number"
198
- value="<?php echo esc_attr(get_option('ecwid_pb_categoriesperrow')); ?>"
199
- />
200
- </div>
201
 
202
- <div class="pure-control-group params-list">
203
- <label for="ecwid_pb_defaultview">
204
- <?php _e('Default view mode on product pages', 'ecwid-shopping-cart'); ?>
205
- </label>
206
- <select id="ecwid_pb_defaultview" name="category_view">
207
- <option value="grid" <?php if(get_option('ecwid_pb_defaultview') == 'grid') echo 'selected="selected"' ?> >
208
- <?php _e('Grid', 'ecwid-shopping-cart'); ?>
209
- </option>
210
- <option value="list" <?php if(get_option('ecwid_pb_defaultview') == 'list') echo 'selected="selected"' ?> >
211
- <?php _e('List', 'ecwid-shopping-cart'); ?>
212
- </option>
213
- <option value="table" <?php if(get_option('ecwid_pb_defaultview') == 'table') echo 'selected="selected"' ?> >
214
- <?php _e('Table', 'ecwid-shopping-cart'); ?>
215
- </option>
216
- </select>
217
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
 
219
- <div class="pure-control-group params-list">
220
- <label for="ecwid_pb_searchview">
221
- <?php _e('Default view mode on search results', 'ecwid-shopping-cart'); ?>
222
- </label>
223
 
224
- <select id="ecwid_pb_searchview" name="search_view">
225
- <option value="grid" <?php if(get_option('ecwid_pb_searchview') == 'grid') echo 'selected="selected"' ?> >
226
- <?php _e('Grid', 'ecwid-shopping-cart'); ?>
227
- </option>
228
- <option value="list" <?php if(get_option('ecwid_pb_searchview') == 'list') echo 'selected="selected"' ?> >
229
- <?php _e('List', 'ecwid-shopping-cart'); ?>
230
- </option>
231
- <option value="table" <?php if(get_option('ecwid_pb_searchview') == 'table') echo 'selected="selected"' ?> >
232
- <?php _e('Table', 'ecwid-shopping-cart'); ?>
233
- </option>
234
- </select>
235
- </div>
236
- </div>
237
-
238
- <?php endif; ?>
239
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  <div class="media-frame-toolbar">
241
  <div class="media-toolbar">
242
  <div class="media-toolbar-secondary">
243
- <?php if ( !ecwid_is_demo_store() ): ?>
244
- <div class="store-id"><?php _e('Store ID', 'ecwid-shopping-cart'); ?>: <?php echo esc_attr(get_ecwid_store_id()); ?></div>
245
- <?php else: ?>
246
- <div class="store-id"><?php _e('Demo store', 'ecwid-shopping-cart'); ?></div>
247
  <?php endif; ?>
248
- <div class="setting-link">
249
- <a target="_blank" href="<?php echo Ecwid_Admin::get_dashboard_url(); ?>"><?php _e('Open store dashboard', 'ecwid-shopping-cart'); ?>
250
- </div>
251
- </div>
252
- <div class="media-toolbar-primary add-store">
253
- <a href="#" class="button media-button button-primary button-large media-button-select"><?php _e('Insert into page'); ?></a>
254
- </div>
255
- <div class="media-toolbar-primary store-settings">
256
- <a href="#" class="button media-button button-primary button-large media-button-select"><?php _e('Update'); ?></a>
257
- </div>
258
- </div>
259
- </div>
260
- </div> </div>
261
  </div>
262
  <div class="media-modal-backdrop"></div>
263
  </div>
264
- <?php if ( get_option( 'ecwid_hide_old_minicart' ) ): ?>
265
  <script>
266
- jQuery('.ecwid-store-editor path.minicart').hide();
267
  </script>
268
- <?php endif; ?>
1
  <script data-cfasync="false" type="text/javascript">
2
+ var ecwid_store_svg = '<?php echo esc_url( get_site_url( '', 'index.php?file=ecwid_store_svg.svg' ) ); ?>';
3
  </script>
4
  <div id="ecwid-store-popup-content">
5
  <div class="media-modal wp-core-ui">
6
  <div class="media-modal-content">
7
+ <a class="media-modal-close" href="#" title="Close"><span class="media-modal-icon"></span></a>
8
+ <div class="media-frame wp-core-ui hide-router">
9
+ <div class="media-frame-menu">
10
+ <div class="media-menu">
11
+ <a href="#" class="media-menu-item" data-content="add-store"><?php esc_html_e( 'Add Store', 'ecwid-shopping-cart' ); ?></a>
12
+ <a href="#" class="media-menu-item" data-content="store-settings"><?php esc_html_e( 'Store elements', 'ecwid-shopping-cart' ); ?></a>
13
+ <?php if ( ecwid_is_legacy_appearance_used() ) : ?>
14
+ <a href="#" class="media-menu-item" data-content="appearance"><?php esc_html_e( 'Appearance', 'ecwid-shopping-cart' ); ?></a>
15
  <?php endif; ?>
16
+ </div>
17
+ </div>
18
 
19
+ <div class="media-frame-title add-store">
20
+ <h1>
21
+ <?php esc_html_e( 'Add Store', 'ecwid-shopping-cart' ); ?><span class="dashicons dashicons-arrow-down"></span>
22
+ </h1>
23
+ </div>
24
 
25
+ <div class="media-frame-title store-settings">
26
+ <h1>
27
+ <?php esc_html_e( 'Store elements', 'ecwid-shopping-cart' ); ?><span class="dashicons dashicons-arrow-down"></span>
28
+ </h1>
29
+ </div>
30
 
31
+ <?php if ( ecwid_is_legacy_appearance_used() ) : ?>
32
+ <div class="media-frame-title appearance">
33
+ <h1>
34
+ <?php esc_html_e( 'Appearance', 'ecwid-shopping-cart' ); ?><span class="dashicons dashicons-arrow-down"></span>
35
+ </h1>
36
+ </div>
37
  <?php endif; ?>
38
 
39
+ <div class="media-frame-content ecwid-store-editor store-settings">
40
 
41
+ <div class="store-settings-wrapper">
42
+ <div class="store-settings-preview">
43
+ <?php ecwid_embed_svg( 'add-store' ); ?>
44
+ <label for="show_search" class="ecwid-search" data-ecwid-widget="search"></label>
45
+ <label for="show_categories" class="ecwid-categories" data-ecwid-widget="categories"></label>
46
+ <?php if ( ! get_option( 'ecwid_hide_old_minicart' ) ) : ?>
47
+ <label for="show_minicart" class="ecwid-minicart" data-ecwid-widget="minicart"></label>
48
+ <?php endif; ?>
49
+ </div>
50
 
51
+ <div class="store-settings">
52
+ <h3><?php esc_html_e( 'Choose widgets to show', 'ecwid-shopping-cart' ); ?></h3>
53
+ <p class="note"><?php esc_html_e( 'Product catalog will be shown automatically', 'ecwid-shopping-cart' ); ?></p>
54
 
55
+ <div class="pure-control-group">
56
+ <label data-ecwid-widget="search">
57
+ <input type="checkbox" name="show_search" id="show_search" />
58
+ <?php esc_html_e( 'Show search', 'ecwid-shopping-cart' ); ?>
59
+ </label>
60
+ </div>
61
+
62
+ <?php if ( ! get_option( 'ecwid_hide_old_minicart' ) ) : ?>
63
+ <div class="pure-control-group">
64
+ <label data-ecwid-widget="minicart">
65
+ <input type="checkbox" name="show_minicart" id="show_minicart" />
66
+ <?php esc_html_e( 'Show minicart', 'ecwid-shopping-cart' ); ?>
67
+ </label>
68
+ </div>
69
+ <?php endif; ?>
70
 
71
+ <div class="pure-control-group">
72
+ <label data-ecwid-widget="categories">
73
+ <input type="checkbox" name="show_categories" id="show_categories" />
74
+ <?php esc_html_e( 'Show categories', 'ecwid-shopping-cart' ); ?>
75
+ </label>
76
+ </div>
77
 
78
+ <div class="note">
79
+ <?php
80
+ echo wp_kses_post(
81
+ sprintf(
82
+ __( 'Additionally, you can add store controls to your website\'s toolbar using <a %s>WordPress native widgets</a>', 'ecwid-shopping-cart' ),
83
+ ' target="_blank" href="widgets.php?from-ec-store=' . ( isset( $_GET['post'] ) ? sanitize_text_field( wp_unslash( $_GET['post'] ) ) : 'new' ) . '"'
84
+ )
85
  );
86
  ?>
87
+ </div>
88
 
89
+ <div class="pure-control-group params-list default-category-id">
90
 
91
+ <?php if ( $categories ) : ?>
92
+ <label for="ecwid_default_category_id">
93
+ <?php esc_html_e( 'Category shown by default', 'ecwid-shopping-cart' ); ?>
94
+ </label>
95
 
96
 
97
+ <div class="value">
98
 
99
+ <select name="default_category_id" id="ecwid_default_category_id">
100
+ <option value="0"
101
+ <?php
102
+ if ( ! get_option( 'ecwid_default_category_id' ) ) :
103
+ ?>
104
+ selected="selected"<?php endif; ?>>
105
+ <?php esc_html_e( 'Store root category', 'ecwid-shopping-cart' ); ?>
106
+ </option>
107
+ <?php foreach ( $categories as $category ) : ?>
108
+ <option
109
+ value="<?php echo esc_attr( $category->id ); ?>"
110
+ <?php if ( $category->id == get_option( 'ecwid_default_category_id' ) ) : ?>
111
+ selected="selected"
112
  <?php endif; ?>
113
+ >
114
+ <?php echo esc_html( $category->path ); ?>
115
+ </option>
116
  <?php endforeach; ?>
117
+ </select>
118
+ </div>
119
 
120
  <?php endif; ?>
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </div>
125
 
126
+ <?php if ( ecwid_is_legacy_appearance_used() ) : ?>
127
+ <div class="media-frame-content ecwid-store-editor appearance">
128
 
129
+ <div class="pure-control-group pb-views">
130
+ <label class="products-per-page-label"><?php esc_html_e( 'Number of products per page', 'ecwid-shopping-cart' ); ?></label>
131
+ <div class="ecwid-pb-view-size grid active" tabindex="1">
132
+ <div class="title"><?php esc_html_e( 'Grid view', 'ecwid-shopping-cart' ); ?></div>
133
+ <div class="main-area">
134
+ <?php ecwid_embed_svg( 'grid' ); ?>
135
+ </div>
136
+ <div class="right">
137
+ <div class="ruler"></div>
138
+ <input
139
+ type="text"
140
+ size="2"
141
+ name="grid_rows"
142
+ class="number"
143
+ value="<?php echo esc_attr( get_option( 'ecwid_pb_productspercolumn_grid' ) ); ?>"
144
+ />
145
+ </div>
146
+ <div class="bottom">
147
+ <div class="ruler"></div>
148
+ <input
149
+ type="text"
150
+ size="2"
151
+ name="grid_columns"
152
+ class="number"
153
+ value="<?php echo esc_attr( get_option( 'ecwid_pb_productsperrow_grid' ) ); ?>"
154
+ />
155
+ </div>
156
+ </div>
157
 
158
+ <div class="ecwid-pb-view-size list" tabindex="1">
159
+ <div class="title"><?php esc_html_e( 'List view', 'ecwid-shopping-cart' ); ?></div>
160
+ <div class="main-area">
161
+ <?php ecwid_embed_svg( 'list' ); ?>
162
+ </div>
163
+ <div class="right">
164
+ <div class="ruler"></div>
165
+ <input
166
+ type="text"
167
+ size="2"
168
+ name="list_rows"
169
+ class="number"
170
+ value="<?php echo esc_attr( get_option( 'ecwid_pb_productsperpage_list' ) ); ?>" />
171
+ </div>
172
+ </div>
173
 
174
 
175
+ <div class="ecwid-pb-view-size table" tabindex="1">
176
+ <div class="title"><?php esc_html_e( 'Table view', 'ecwid-shopping-cart' ); ?></div>
177
+ <div class="main-area">
178
+ <?php ecwid_embed_svg( 'table' ); ?>
179
+ </div>
180
+ <div class="right">
181
+ <div class="ruler"></div>
182
+ <input
183
+ type="text"
184
+ size="2"
185
+ name="table_rows"
186
+ class="number"
187
+ value="<?php echo esc_attr( get_option( 'ecwid_pb_productsperpage_table' ) ); ?>"
188
+ />
189
+ </div>
190
+ </div>
191
+ <p class="note pb-note"><?php echo esc_html( sprintf( __( 'Here you can control how many products will be displayed per page. These options define maximum values. If there is not enough space to show all product columns, %s will adapt the number of columns to hold all products.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ) ); ?></p>
192
+ </div>
193
 
194
+ <hr class="after-pb" />
195
 
196
+ <div class="pure-control-group params-list">
197
+ <label for="ecwid_pb_categoriesperrow">
198
+ <?php esc_html_e( 'Number of categories per row', 'ecwid-shopping-cart' ); ?>
199
+ </label>
200
+ <input
201
+ id="ecwid_pb_categoriesperrow"
202
+ name="categories_per_row"
203
+ type="text"
204
+ class="number"
205
+ value="<?php echo esc_attr( get_option( 'ecwid_pb_categoriesperrow' ) ); ?>"
206
+ />
207
+ </div>
208
 
209
+ <div class="pure-control-group params-list">
210
+ <label for="ecwid_pb_defaultview">
211
+ <?php esc_html_e( 'Default view mode on product pages', 'ecwid-shopping-cart' ); ?>
212
+ </label>
213
+ <select id="ecwid_pb_defaultview" name="category_view">
214
+ <option value="grid"
215
+ <?php
216
+ if ( get_option( 'ecwid_pb_defaultview' ) == 'grid' ) {
217
+ echo 'selected="selected"';}
218
+ ?>
219
+ >
220
+ <?php esc_html_e( 'Grid', 'ecwid-shopping-cart' ); ?>
221
+ </option>
222
+ <option value="list"
223
+ <?php
224
+ if ( get_option( 'ecwid_pb_defaultview' ) == 'list' ) {
225
+ echo 'selected="selected"';}
226
+ ?>
227
+ >
228
+ <?php esc_html_e( 'List', 'ecwid-shopping-cart' ); ?>
229
+ </option>
230
+ <option value="table"
231
+ <?php
232
+ if ( get_option( 'ecwid_pb_defaultview' ) == 'table' ) {
233
+ echo 'selected="selected"';}
234
+ ?>
235
+ >
236
+ <?php esc_html_e( 'Table', 'ecwid-shopping-cart' ); ?>
237
+ </option>
238
+ </select>
239
+ </div>
240
 
241
+ <div class="pure-control-group params-list">
242
+ <label for="ecwid_pb_searchview">
243
+ <?php esc_html_e( 'Default view mode on search results', 'ecwid-shopping-cart' ); ?>
244
+ </label>
245
 
246
+ <select id="ecwid_pb_searchview" name="search_view">
247
+ <option value="grid"
248
+ <?php
249
+ if ( get_option( 'ecwid_pb_searchview' ) == 'grid' ) {
250
+ echo 'selected="selected"';}
251
+ ?>
252
+ >
253
+ <?php esc_html_e( 'Grid', 'ecwid-shopping-cart' ); ?>
254
+ </option>
255
+ <option value="list"
256
+ <?php
257
+ if ( get_option( 'ecwid_pb_searchview' ) == 'list' ) {
258
+ echo 'selected="selected"';}
259
+ ?>
260
+ >
261
+ <?php esc_html_e( 'List', 'ecwid-shopping-cart' ); ?>
262
+ </option>
263
+ <option value="table"
264
+ <?php
265
+ if ( get_option( 'ecwid_pb_searchview' ) == 'table' ) {
266
+ echo 'selected="selected"';}
267
+ ?>
268
+ >
269
+ <?php esc_html_e( 'Table', 'ecwid-shopping-cart' ); ?>
270
+ </option>
271
+ </select>
272
+ </div>
273
+ </div>
274
+
275
+ <?php endif; ?>
276
+
277
  <div class="media-frame-toolbar">
278
  <div class="media-toolbar">
279
  <div class="media-toolbar-secondary">
280
+ <?php if ( ! ecwid_is_demo_store() ) : ?>
281
+ <div class="store-id"><?php esc_html_e( 'Store ID', 'ecwid-shopping-cart' ); ?>: <?php echo esc_attr( get_ecwid_store_id() ); ?></div>
282
+ <?php else : ?>
283
+ <div class="store-id"><?php esc_html_e( 'Demo store', 'ecwid-shopping-cart' ); ?></div>
284
  <?php endif; ?>
285
+ <div class="setting-link">
286
+ <a target="_blank" href="<?php echo esc_url( Ecwid_Admin::get_dashboard_url() ); ?>"><?php esc_html_e( 'Open store dashboard', 'ecwid-shopping-cart' ); ?>
287
+ </div>
288
+ </div>
289
+ <div class="media-toolbar-primary add-store">
290
+ <a href="#" class="button media-button button-primary button-large media-button-select"><?php esc_html_e( 'Insert into page' ); ?></a>
291
+ </div>
292
+ <div class="media-toolbar-primary store-settings">
293
+ <a href="#" class="button media-button button-primary button-large media-button-select"><?php esc_html_e( 'Update' ); ?></a>
294
+ </div>
295
+ </div>
296
+ </div>
297
+ </div> </div>
298
  </div>
299
  <div class="media-modal-backdrop"></div>
300
  </div>
301
+ <?php if ( get_option( 'ecwid_hide_old_minicart' ) ) : ?>
302
  <script>
303
+ jQuery('.ecwid-store-editor path.minicart').hide();
304
  </script>
305
+ <?php endif; ?>
templates/store-svg.php CHANGED
@@ -1,17 +1,16 @@
1
  <?php
2
- echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
3
- echo '<?xml-stylesheet type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.9.2" ?>';
4
  ?><!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
5
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
6
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
7
- viewBox="0 0 500 220" enable-background="new 0 0 500 220" xml:space="preserve">
8
 
9
- <text x="250" y="93" text-anchor="middle" fill="#050303" font-family="Open Sans,Helvetica Neue,sans-serif" font-size="20"><?php _e('Your store will be shown here!', 'ecwid-shopping-cart'); ?></text>
10
  <text x="250" y="115" text-anchor="middle" fill="#999999" font-family="Open Sans,Helvetica Neue,sans-serif" font-size="14">
11
- <?php if ( ecwid_is_demo_store() ): ?>
12
- <?php _e('Demo Store', 'ecwid-shopping-cart'); ?>
13
- <?php else: ?>
14
- <?php _e('Store ID', 'ecwid-shopping-cart'); ?>: <?php echo esc_attr(get_ecwid_store_id()); ?>
15
  <?php endif; ?>
16
  </text>
17
 
1
  <?php
2
+ echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
3
+ echo '<?xml-stylesheet type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.9.2" ?>';
4
  ?><!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
5
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
6
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 500 220" enable-background="new 0 0 500 220" xml:space="preserve">
 
7
 
8
+ <text x="250" y="93" text-anchor="middle" fill="#050303" font-family="Open Sans,Helvetica Neue,sans-serif" font-size="20"><?php esc_html_e( 'Your store will be shown here!', 'ecwid-shopping-cart' ); ?></text>
9
  <text x="250" y="115" text-anchor="middle" fill="#999999" font-family="Open Sans,Helvetica Neue,sans-serif" font-size="14">
10
+ <?php if ( ecwid_is_demo_store() ) : ?>
11
+ <?php esc_html_e( 'Demo Store', 'ecwid-shopping-cart' ); ?>
12
+ <?php else : ?>
13
+ <?php esc_html_e( 'Store ID', 'ecwid-shopping-cart' ); ?>: <?php echo esc_attr( get_ecwid_store_id() ); ?>
14
  <?php endif; ?>
15
  </text>
16
 
templates/sync.php CHANGED
@@ -1,7 +1,8 @@
1
- <div id="sync-container" class="state-initial"<?php if (!get_option('ecwid_local_base_enabled', false)) echo ' style="display:none"'; ?>>
 
2
  <?php
3
  $prods = new Ecwid_Products();
4
- $api = new Ecwid_Api_V3(get_ecwid_store_id());
5
  ?>
6
 
7
  <script>
@@ -10,16 +11,16 @@ jQuery(document).ready(function() {
10
  jQuery('#sync-container').addClass('no-sse');
11
 
12
  jQuery('#ecwid_local_base_enabled').click(function() {
13
- jQuery('#sync-container').css('display', (jQuery(this).is(':checked')) ? '' : 'none');
14
  });
15
 
16
  jQuery('#sync-button').click(function() {
17
- sync_by_chunks();
18
 
19
  return false;
20
  });
21
 
22
- var updatedFrom = '<?php echo $estimation['last_update']; ?>';
23
 
24
  function do_no_sse_sync(mode, offset, limit, time) {
25
  jQuery.getJSON('admin-post.php?action=ecwid_sync_no_sse&mode=' + mode + '&offset=' + offset + '&limit=' + limit + '&time=' + updatedFrom, {}, process_no_sse_sync);
@@ -36,7 +37,7 @@ function process_no_sse_sync(data) {
36
  return do_no_sse_over();
37
  }
38
 
39
- update_no_sse_stuff(data);
40
 
41
  if (data.total == data.count + data.offset) {
42
  if (processed_updates > 0) {
@@ -50,15 +51,15 @@ function process_no_sse_sync(data) {
50
  }
51
  offset = parseInt(data.offset) + parseInt(data.limit);
52
  }
53
-
54
- do_no_sse_sync(mode, offset, limit, updatedFrom);
55
  }
56
 
57
  function update_no_sse_stuff(data) {
58
- var counters = ['deleted', 'skipped_deleted', 'deleted_disabled'];
59
- for (var i = 0; i < counters.length; i++) {
60
- increment_progress_counter(data[counters[i]], 'deleted');
61
- }
62
  var counters = ['created', 'updated'];
63
  for (var i = 0; i < counters.length; i++) {
64
  increment_progress_counter(data[counters[i]], 'updated');
@@ -66,9 +67,9 @@ function update_no_sse_stuff(data) {
66
  }
67
 
68
  function increment_progress_counter(increment = 1, counter_type) {
69
- debugger;
70
-
71
- if (increment == 0) {
72
  return;
73
  }
74
 
@@ -108,53 +109,61 @@ jQuery('#sync-button-slow').click(function() {
108
  });
109
  </script>
110
 
111
- <?php if ( !Ecwid_Api_V3::get_token() ): ?>
112
  <div>
113
- <?php _e( 'To enable this feature, the plugin needs a permission to read your store product information.', 'ecwid-shopping-cart' ); ?>
114
- <a href="<?php echo get_reconnect_link(); ?>"><?php _e( 'Provide access.', 'ecwid-shopping-cart' ); ?></a>
115
  </div>
116
- <?php else: ?>
117
 
118
  <div class="sync-block" id="sync-buttons">
119
- <a id="sync-button-slow"><?php _e('Synchronize products', 'ecwid-shopping-cart'); ?></a>
120
  </div>
121
  <div class="sync-block progress-indicator" id="updating">
122
  <div class="sync-icon">
123
- <?php ecwid_embed_svg('update'); ?>
124
  </div>
125
  <div>
126
- <?php _e('We\'re synchronizing your products. This may take a few minutes. Please do not reload the page.', 'ecwid-shopping-cart'); ?>
127
  </div>
128
  </div>
129
- <div class="sync-block" id="deleted-progress">
130
- <?php echo sprintf(__( 'Deleted products synchronized: %1$s out of %2$s', 'ecwid-shopping-cart' ),
131
- '<span id="count_deleted">0</span>',
132
- '<span id="total_deleted">' . ($estimation['total_deleted']) . '</span>'
133
- );
134
- ?>
 
 
 
 
135
  </div>
136
-
137
  <div class="sync-block" id="updated-progress">
138
- <?php echo sprintf(__( 'Products synchronized: %1$s out of %2$s', 'ecwid-shopping-cart' ),
 
 
 
139
  '<span id="count_updated">0</span>',
140
- '<span id="total_updated">' . ($estimation['total_updated']) . '</span>'
141
- );
 
142
  ?>
143
  </div>
144
  <div class="sync-block" id="complete">
145
- <?php _e( 'Products are successfully synchronized. The product pages are up to date.', 'ecwid-shopping-cart' ); ?>
146
  </div>
147
 
148
  <div class="sync-block" id="last-sync-date">
149
- <?php _e( 'Last update', 'ecwid-shopping-cart' ); ?>:
150
  <span id="sync-date">
151
- <?php if ( $estimation['last_update'] == 0 ): ?>
152
- <?php _e( 'Not synchronized yet', 'ecwid-shopping-cart' ); ?>
153
- <?php else: ?>
154
- <?php echo ecwid_format_date( $estimation['last_update'] ); ?>
155
- <?php endif; ?>
156
- </span>
157
  </div>
158
  <?php endif; ?>
159
 
160
- </div>
1
+ <div id="sync-container" class="state-initial" <?php if ( ! get_option( 'ecwid_local_base_enabled', false ) ) {
2
+ echo ' style="display:none"';} ?>>
3
  <?php
4
  $prods = new Ecwid_Products();
5
+ $api = new Ecwid_Api_V3( get_ecwid_store_id() );
6
  ?>
7
 
8
  <script>
11
  jQuery('#sync-container').addClass('no-sse');
12
 
13
  jQuery('#ecwid_local_base_enabled').click(function() {
14
+ jQuery('#sync-container').css('display', (jQuery(this).is(':checked')) ? '' : 'none');
15
  });
16
 
17
  jQuery('#sync-button').click(function() {
18
+ sync_by_chunks();
19
 
20
  return false;
21
  });
22
 
23
+ var updatedFrom = '<?php echo esc_js( $estimation['last_update'] ); ?>';
24
 
25
  function do_no_sse_sync(mode, offset, limit, time) {
26
  jQuery.getJSON('admin-post.php?action=ecwid_sync_no_sse&mode=' + mode + '&offset=' + offset + '&limit=' + limit + '&time=' + updatedFrom, {}, process_no_sse_sync);
37
  return do_no_sse_over();
38
  }
39
 
40
+ update_no_sse_stuff(data);
41
 
42
  if (data.total == data.count + data.offset) {
43
  if (processed_updates > 0) {
51
  }
52
  offset = parseInt(data.offset) + parseInt(data.limit);
53
  }
54
+
55
+ do_no_sse_sync(mode, offset, limit, updatedFrom);
56
  }
57
 
58
  function update_no_sse_stuff(data) {
59
+ var counters = ['deleted', 'skipped_deleted', 'deleted_disabled'];
60
+ for (var i = 0; i < counters.length; i++) {
61
+ increment_progress_counter(data[counters[i]], 'deleted');
62
+ }
63
  var counters = ['created', 'updated'];
64
  for (var i = 0; i < counters.length; i++) {
65
  increment_progress_counter(data[counters[i]], 'updated');
67
  }
68
 
69
  function increment_progress_counter(increment = 1, counter_type) {
70
+ debugger;
71
+
72
+ if (increment == 0) {
73
  return;
74
  }
75
 
109
  });
110
  </script>
111
 
112
+ <?php if ( ! Ecwid_Api_V3::get_token() ) : ?>
113
  <div>
114
+ <?php esc_html_e( 'To enable this feature, the plugin needs a permission to read your store product information.', 'ecwid-shopping-cart' ); ?>
115
+ <a href="<?php echo esc_url( get_reconnect_link() ); ?>"><?php esc_html_e( 'Provide access.', 'ecwid-shopping-cart' ); ?></a>
116
  </div>
117
+ <?php else : ?>
118
 
119
  <div class="sync-block" id="sync-buttons">
120
+ <a id="sync-button-slow"><?php esc_html_e( 'Synchronize products', 'ecwid-shopping-cart' ); ?></a>
121
  </div>
122
  <div class="sync-block progress-indicator" id="updating">
123
  <div class="sync-icon">
124
+ <?php ecwid_embed_svg( 'update' ); ?>
125
  </div>
126
  <div>
127
+ <?php esc_html_e( 'We\'re synchronizing your products. This may take a few minutes. Please do not reload the page.', 'ecwid-shopping-cart' ); ?>
128
  </div>
129
  </div>
130
+ <div class="sync-block">
131
+ <?php
132
+ echo wp_kses_post(
133
+ sprintf(
134
+ __( 'Deleted products synchronized: %1$s out of %2$s', 'ecwid-shopping-cart' ),
135
+ '<span id="count_deleted">0</span>',
136
+ '<span id="total_deleted">' . ( $estimation['total_deleted'] ) . '</span>'
137
+ )
138
+ );
139
+ ?>
140
  </div>
141
+
142
  <div class="sync-block" id="updated-progress">
143
+ <?php
144
+ echo wp_kses_post(
145
+ sprintf(
146
+ __( 'Products synchronized: %1$s out of %2$s', 'ecwid-shopping-cart' ),
147
  '<span id="count_updated">0</span>',
148
+ '<span id="total_updated">' . ( $estimation['total_updated'] ) . '</span>'
149
+ )
150
+ );
151
  ?>
152
  </div>
153
  <div class="sync-block" id="complete">
154
+ <?php esc_html_e( 'Products are successfully synchronized. The product pages are up to date.', 'ecwid-shopping-cart' ); ?>
155
  </div>
156
 
157
  <div class="sync-block" id="last-sync-date">
158
+ <?php esc_html_e( 'Last update', 'ecwid-shopping-cart' ); ?>:
159
  <span id="sync-date">
160
+ <?php if ( $estimation['last_update'] == 0 ) : ?>
161
+ <?php esc_html_e( 'Not synchronized yet', 'ecwid-shopping-cart' ); ?>
162
+ <?php else : ?>
163
+ <?php echo esc_html( ecwid_format_date( $estimation['last_update'] ) ); ?>
164
+ <?php endif; ?>
165
+ </span>
166
  </div>
167
  <?php endif; ?>
168
 
169
+ </div>
templates/widget-stub.tpl.php CHANGED
@@ -1,20 +1,20 @@
1
- <div class="ecwid-widget-stub <?php echo $classname;?>">
2
  <div class="ecwid-widget-stub-header"><svg aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" class="dashicon" width="20" height="20" viewBox="0 0 20 20"><path 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
3
- 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
4
- 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
5
- 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
6
- 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
7
- 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
8
- 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
9
- 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
10
- 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
11
- 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
12
- 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
13
- 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
14
- 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
15
- 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
16
- S4.96,15.5,4.6,15.5z"></path></svg>
17
 
18
- <?php echo $message; ?>
19
  </div>
20
- </div>
1
+ <div class="ecwid-widget-stub <?php echo esc_attr( $classname ); ?>">
2
  <div class="ecwid-widget-stub-header"><svg aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" class="dashicon" width="20" height="20" viewBox="0 0 20 20"><path 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
3
+ 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
4
+ 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
5
+ 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
6
+ 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
7
+ 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
8
+ 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
9
+ 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
10
+ 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
11
+ 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
12
+ 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
13
+ 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
14
+ 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
15
+ 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
16
+ S4.96,15.5,4.6,15.5z"></path></svg>
17
 
18
+ <?php echo wp_kses_post( $message ); ?>
19
  </div>
20
+ </div>
templates/wp-toolbox.tpl.php CHANGED
@@ -1,8 +1,8 @@
1
  <div class="wrap">
2
  <div class="card">
3
  <h2 class="title"><?php esc_html_e( 'Extensions for your Store', 'ecwid-shopping-cart' ); ?></h2>
4
- <p><?php _e( 'Take advantage of powerful apps and extensions designed to enhance your store.', 'ecwid-shopping-cart' ); ?></p>
5
- <a class="button button-primary" href="admin.php?page=<?php echo Ecwid_Admin::ADMIN_SLUG; ?>-admin-appmarket">Browse the App Market</a>
6
- <p></p>
7
- </div>
8
- </div>
1
  <div class="wrap">
2
  <div class="card">
3
  <h2 class="title"><?php esc_html_e( 'Extensions for your Store', 'ecwid-shopping-cart' ); ?></h2>
4
+ <p><?php esc_html_e( 'Take advantage of powerful apps and extensions designed to enhance your store.', 'ecwid-shopping-cart' ); ?></p>
5
+ <a class="button button-primary" href="admin.php?page=<?php echo esc_attr( Ecwid_Admin::ADMIN_SLUG ); ?>-admin-appmarket">Browse the App Market</a>
6
+ <p></p>
7
+ </div>
8
+ </div>