Ecwid Ecommerce Shopping Cart - Version 5.7

Version Description

  • New feature in the [ecwid] shortcode its now possible to specify the product that will be displayed by default when the store page is opened. If you want to feature some product from your online store on one of the site pages or if you sell a single product, you can specify it in the new default_product_id parameter in the ecwid shortcode to make it opened by default.
  • Speedup in the store navigation for your customers. We improved Ecwid e-commerce sidebar widgets and menus in the storefront, they now work without page reload when a visitor is already on the store page. After the customer opens your store page, all further browsing will be super fast, including switching between products, opening categories, visiting recently viewed products etc.
  • Fixed an issue with title and description meta tags being changed by the Yoast SEO plugin on store pages. If you have Yoast installed, you might notice this issue recently. Now your products and categories titles and descriptions will get to the page meta title/description tags with no problem. This should help Google index your catalog properly.
  • Ecwid is constantly updated with new cool ecommerce features and improvements. To see more updates and learn something new about selling online, see our blog.
Download this release

Release Info

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

Code changes from version 5.6.2 to 5.7

css/popup-deactivate.css ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .reasons-list-item .message {
2
+ display: none;
3
+ margin-top: 10px;
4
+ width: 100%;
5
+ }
6
+
7
+ .reasons-list-item .message textarea {
8
+ width: 100%;
9
+ }
10
+
11
+ .reasons-list-item.selected .message {
12
+ display: block;
13
+ }
14
+
15
+ .reasons-list {
16
+ margin-top: 20px;
17
+ }
18
+
19
+ .bottom-support-link {
20
+ text-align: right;
21
+ }
css/popup.css ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body.ecwid-popup-open {
2
+ overflow: hidden;
3
+ }
4
+
5
+ .ecwid-popup {
6
+ background: rgba(0,0,0,.7);
7
+ position: fixed;
8
+ overflow: auto;
9
+ height: 100%;
10
+ width: 100%;
11
+ top: 0;
12
+ z-index: 100000;
13
+ display: none;
14
+ }
15
+
16
+ .ecwid-popup.open {
17
+ display: block;
18
+ }
19
+
20
+ .ecwid-popup .ecwid-popup-window {
21
+ background: white;
22
+ position: absolute;
23
+ left: 50%;
24
+ margin-left: -298px;
25
+ top: 10%;
26
+ z-index: 100001;
27
+ width: 596px;
28
+ }
29
+
30
+ .ecwid-popup-header, .ecwid-popup-footer, .ecwid-popup-body {
31
+ padding: 15px;
32
+ box-sizing: border-box;
33
+ }
34
+
35
+ .ecwid-popup-header {
36
+ border-bottom: 1px solid lightgray;
37
+ width: 100%;
38
+ }
39
+
40
+ .ecwid-popup-header h3 {
41
+ text-transform: uppercase;
42
+ margin: 0px;
43
+ font-size: 18px;
44
+ }
45
+
46
+ .ecwid-popup-footer {
47
+ border-top: 1px solid lightgray;
48
+ width: 100%;
49
+ text-align: right;
50
+ }
51
+
52
+ .ecwid-popup-body {
53
+ padding: 20px;
54
+ }
55
+
56
+ .ecwid-popup-body h3 {
57
+ margin: 0px;
58
+ }
ecwid-shopping-cart.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.ecwid.com?source=wporg
5
  Description: Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
6
  Text Domain: ecwid-shopping-cart
7
  Author: Ecwid Team
8
- Version: 5.6.2
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
@@ -70,6 +70,7 @@ add_filter('plugins_loaded', 'ecwid_load_textdomain');
70
 
71
  if ( is_admin() ){
72
  add_action('admin_init', 'ecwid_settings_api_init');
 
73
  add_action('admin_init', 'ecwid_check_version');
74
  add_action('admin_init', 'ecwid_process_oauth_params');
75
  add_action('admin_notices', 'ecwid_show_admin_messages');
@@ -124,7 +125,9 @@ if (get_option('ecwid_last_oauth_fail_time') > 0) {
124
  }
125
 
126
  // Needs to be in both front-end and back-end to allow admin zone recognize the shortcode
127
- add_shortcode( Ecwid_Shortcode_Base::get_store_shortcode_name(), 'ecwid_shortcode' );
 
 
128
 
129
  $ecwid_script_rendered = false; // controls single script.js on page
130
 
@@ -292,6 +295,21 @@ function ecwid_redirect_canonical2($redir, $req) {
292
  return $redir;
293
  }
294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  function ecwid_enqueue_frontend() {
296
 
297
 
@@ -308,7 +326,10 @@ function ecwid_enqueue_frontend() {
308
  wp_enqueue_style('ecwid-css', ECWID_PLUGIN_URL . 'css/frontend.css',array(), get_option('ecwid_plugin_version'));
309
 
310
  wp_enqueue_script( 'ecwid-frontend-js', ECWID_PLUGIN_URL . 'js/frontend.js', array( 'jquery' ), get_option( 'ecwid_plugin_version' ) );
311
-
 
 
 
312
  if ( get_post() && get_post()->post_type == Ecwid_Products::POST_TYPE_PRODUCT ) {
313
  wp_enqueue_script( 'ecwid-post-product', ECWID_PLUGIN_URL . 'js/post-product.js', array(), get_option( 'ecwid_plugin_version' ), TRUE );
314
 
@@ -612,6 +633,8 @@ function ecwid_check_version()
612
  // Since 5.4.3?
613
  add_option( Ecwid_Widget_Floating_Shopping_Cart::OPTION_MOVE_INTO_BODY, '' );
614
 
 
 
615
  Ecwid_Config::load_from_ini();
616
 
617
  add_option( 'force_scriptjs_render', false );
@@ -915,20 +938,28 @@ function ecwid_content_has_productbrowser( $content ) {
915
 
916
  $result = has_shortcode( $content, 'ecwid_productbrowser' );
917
 
918
- if ( !$result && has_shortcode($content, Ecwid_Shortcode_Base::get_store_shortcode_name() ) ) {
919
- $shortcodes = ecwid_find_shortcodes( $content, Ecwid_Shortcode_Base::get_store_shortcode_name() );
920
- if ( $shortcodes ) foreach ( $shortcodes as $shortcode ) {
 
 
 
 
 
921
 
922
- $attributes = shortcode_parse_atts( $shortcode[3] );
923
 
924
- if ( isset( $attributes['widgets'] ) ) {
925
- $widgets = preg_split( '![^0-9^a-z^A-Z^-^_]!', $attributes['widgets'] );
926
- if ( is_array( $widgets ) && in_array('productbrowser', $widgets ) ) {
927
- $result = true;
 
928
  }
929
  }
930
  }
 
931
  }
 
932
 
933
  return $result;
934
  }
@@ -1098,6 +1129,13 @@ function ecwid_trim_description($description)
1098
  return $description;
1099
  }
1100
 
 
 
 
 
 
 
 
1101
 
1102
  function ecwid_ajax_hide_message($params)
1103
  {
@@ -1431,6 +1469,7 @@ function ecwid_shortcode($attributes)
1431
  'table' => $defaults['table_rows'],
1432
  'minicart_layout' => 'MiniAttachToProductBrowser',
1433
  'default_category_id' => 0,
 
1434
  'lang' => ''
1435
  )
1436
  , $attributes
@@ -1512,10 +1551,13 @@ function ecwid_ajax_get_product_info() {
1512
 
1513
  function ecwid_store_activate() {
1514
 
 
 
1515
  $my_post = array();
1516
  $defaults = ecwid_get_default_pb_size();
1517
 
1518
- $shortcode = Ecwid_Shortcode_Base::get_store_shortcode_name();
 
1519
  $content = <<<EOT
1520
  [$shortcode widgets="productbrowser minicart categories search" grid="$defaults[grid_rows],$defaults[grid_columns]" list="$defaults[list_rows]" table="$defaults[table_rows]" default_category_id="0" category_view="grid" search_view="grid" minicart_layout="MiniAttachToProductBrowser" ]
1521
  EOT;
@@ -1866,7 +1908,8 @@ function ecwid_common_admin_scripts() {
1866
  'reset_cats_cache' => __('Refresh categories list', 'ecwid-shopping-cart'),
1867
  'cache_updated' => __('Done', 'ecwid-shopping-cart'),
1868
  'reset_cache_message' => __('The store top-level categories are automatically added to this drop-down menu', 'ecwid-shopping-cart'),
1869
- 'store_shortcode' => Ecwid_Shortcode_Base::get_store_shortcode_name(),
 
1870
  'product_shortcode' => Ecwid_Shortcode_Product::get_shortcode_name(),
1871
  'legacy_appearance' => ecwid_is_legacy_appearance_used()
1872
  ));
5
  Description: Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
6
  Text Domain: ecwid-shopping-cart
7
  Author: Ecwid Team
8
+ Version: 5.7
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
70
 
71
  if ( is_admin() ){
72
  add_action('admin_init', 'ecwid_settings_api_init');
73
+
74
  add_action('admin_init', 'ecwid_check_version');
75
  add_action('admin_init', 'ecwid_process_oauth_params');
76
  add_action('admin_notices', 'ecwid_show_admin_messages');
125
  }
126
 
127
  // Needs to be in both front-end and back-end to allow admin zone recognize the shortcode
128
+ foreach (Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name) {
129
+ add_shortcode( $shortcode_name, 'ecwid_shortcode' );
130
+ }
131
 
132
  $ecwid_script_rendered = false; // controls single script.js on page
133
 
295
  return $redir;
296
  }
297
 
298
+ add_action( 'current_screen', 'ecwid_add_deactivation_popup' );
299
+
300
+ function ecwid_add_deactivation_popup()
301
+ {
302
+ if ( get_current_screen()->id == 'plugins' ) {
303
+ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-popup-deactivate.php';
304
+
305
+ $popup = new Ecwid_Popup_Deactivate();
306
+
307
+ if ( !$popup->is_disabled() ) {
308
+ Ecwid_Popup::add_popup( $popup );
309
+ }
310
+ }
311
+ }
312
+
313
  function ecwid_enqueue_frontend() {
314
 
315
 
326
  wp_enqueue_style('ecwid-css', ECWID_PLUGIN_URL . 'css/frontend.css',array(), get_option('ecwid_plugin_version'));
327
 
328
  wp_enqueue_script( 'ecwid-frontend-js', ECWID_PLUGIN_URL . 'js/frontend.js', array( 'jquery' ), get_option( 'ecwid_plugin_version' ) );
329
+ wp_localize_script( 'ecwid-frontend-js', 'ecwidParams', array(
330
+ 'useJsApiToOpenStorePages' => (bool)get_option( 'ecwid_use_js_api_to_open_store_pages', true )
331
+ ));
332
+
333
  if ( get_post() && get_post()->post_type == Ecwid_Products::POST_TYPE_PRODUCT ) {
334
  wp_enqueue_script( 'ecwid-post-product', ECWID_PLUGIN_URL . 'js/post-product.js', array(), get_option( 'ecwid_plugin_version' ), TRUE );
335
 
633
  // Since 5.4.3?
634
  add_option( Ecwid_Widget_Floating_Shopping_Cart::OPTION_MOVE_INTO_BODY, '' );
635
 
636
+ add_option( 'ecwid_use_js_api_to_open_store_pages', true );
637
+
638
  Ecwid_Config::load_from_ini();
639
 
640
  add_option( 'force_scriptjs_render', false );
938
 
939
  $result = has_shortcode( $content, 'ecwid_productbrowser' );
940
 
941
+ if ($result) {
942
+ return $result;
943
+ }
944
+
945
+ foreach ( Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name ) {
946
+ if ( has_shortcode($content, $shortcode_name ) ) {
947
+ $shortcodes = ecwid_find_shortcodes( $content, $shortcode_name );
948
+ if ( $shortcodes ) foreach ( $shortcodes as $shortcode ) {
949
 
950
+ $attributes = shortcode_parse_atts( $shortcode[3] );
951
 
952
+ if ( isset( $attributes['widgets'] ) ) {
953
+ $widgets = preg_split( '![^0-9^a-z^A-Z^-^_]!', $attributes['widgets'] );
954
+ if ( is_array( $widgets ) && in_array('productbrowser', $widgets ) ) {
955
+ $result = true;
956
+ }
957
  }
958
  }
959
  }
960
+
961
  }
962
+
963
 
964
  return $result;
965
  }
1129
  return $description;
1130
  }
1131
 
1132
+ add_action( 'wp_ajax_ecwid_deactivate_feedback', 'ecwid_ajax_deactivate_feedback' );
1133
+ function ecwid_ajax_deactivate_feedback()
1134
+ {
1135
+ require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-popup-deactivate.php';
1136
+ $popup = new Ecwid_Popup_Deactivate();
1137
+ $popup->ajax_deactivate_feedback();
1138
+ }
1139
 
1140
  function ecwid_ajax_hide_message($params)
1141
  {
1469
  'table' => $defaults['table_rows'],
1470
  'minicart_layout' => 'MiniAttachToProductBrowser',
1471
  'default_category_id' => 0,
1472
+ 'default_product_id' => 0,
1473
  'lang' => ''
1474
  )
1475
  , $attributes
1551
 
1552
  function ecwid_store_activate() {
1553
 
1554
+ Ecwid_Config::load_from_ini();
1555
+
1556
  $my_post = array();
1557
  $defaults = ecwid_get_default_pb_size();
1558
 
1559
+ $shortcode = Ecwid_Shortcode_Base::get_current_store_shortcode_name();
1560
+
1561
  $content = <<<EOT
1562
  [$shortcode widgets="productbrowser minicart categories search" grid="$defaults[grid_rows],$defaults[grid_columns]" list="$defaults[list_rows]" table="$defaults[table_rows]" default_category_id="0" category_view="grid" search_view="grid" minicart_layout="MiniAttachToProductBrowser" ]
1563
  EOT;
1908
  'reset_cats_cache' => __('Refresh categories list', 'ecwid-shopping-cart'),
1909
  'cache_updated' => __('Done', 'ecwid-shopping-cart'),
1910
  'reset_cache_message' => __('The store top-level categories are automatically added to this drop-down menu', 'ecwid-shopping-cart'),
1911
+ 'store_shortcodes' => Ecwid_Shortcode_Base::get_store_shortcode_names(),
1912
+ 'store_shortcode' => Ecwid_Shortcode_Base::get_current_store_shortcode_name(),
1913
  'product_shortcode' => Ecwid_Shortcode_Product::get_shortcode_name(),
1914
  'legacy_appearance' => ecwid_is_legacy_appearance_used()
1915
  ));
includes/class-ecwid-config.php CHANGED
@@ -54,6 +54,10 @@ class Ecwid_Config {
54
  return EcwidPlatform::get( self::OAUTH_AUTH_URL, 'https://' . self::get_cpanel_domain() . '/api/oauth/authorize' );
55
  }
56
 
 
 
 
 
57
  public static function get_oauth_appid() {
58
  return EcwidPlatform::get( self::OAUTH_APPID, Ecwid_Api_V3::CLIENT_ID );
59
  }
54
  return EcwidPlatform::get( self::OAUTH_AUTH_URL, 'https://' . self::get_cpanel_domain() . '/api/oauth/authorize' );
55
  }
56
 
57
+ public static function should_show_reconnect_in_footer() {
58
+ return !self::is_wl() || EcwidPlatform::get( self::OAUTH_AUTH_URL, false );
59
+ }
60
+
61
  public static function get_oauth_appid() {
62
  return EcwidPlatform::get( self::OAUTH_APPID, Ecwid_Api_V3::CLIENT_ID );
63
  }
includes/class-ecwid-help-page.php CHANGED
@@ -25,7 +25,7 @@ class Ecwid_Help_Page {
25
  if ( get_ecwid_store_id() != ECWID_DEMO_STORE_ID ) {
26
  $body_lines[] = 'Store ID: ' . get_ecwid_store_id();
27
  }
28
- $body_lines[] = 'Store URL: ' . Ecwid_Store_Page::get_store_page_url();
29
  $body_lines[] = 'Wp theme: ' . ecwid_get_theme_name();
30
  $body_lines[] = 'Ecwid plugin version: ' . get_option('ecwid_plugin_version');
31
  $body_lines[] = 'Wordpress version: ' . get_bloginfo('version');
25
  if ( get_ecwid_store_id() != ECWID_DEMO_STORE_ID ) {
26
  $body_lines[] = 'Store ID: ' . get_ecwid_store_id();
27
  }
28
+ $body_lines[] = 'Store URL: ' . Ecwid_Store_Page::get_store_url();
29
  $body_lines[] = 'Wp theme: ' . ecwid_get_theme_name();
30
  $body_lines[] = 'Ecwid plugin version: ' . get_option('ecwid_plugin_version');
31
  $body_lines[] = 'Wordpress version: ' . get_bloginfo('version');
includes/class-ecwid-integration-wpseo.php CHANGED
@@ -13,9 +13,9 @@ class Ecwid_Integration_WordPress_SEO_By_Yoast
13
  if (ecwid_is_paid_account() && ecwid_is_store_page_available()) {
14
  add_filter( 'wpseo_sitemap_index', array( $this, 'wpseo_hook_sitemap_index' ) );
15
  add_filter( 'wpseo_do_sitemap_ecwid', array( $this, 'wpseo_hook_do_sitemap' ) );
16
- if (array_key_exists('_escaped_fragment_', $_GET) || Ecwid_Seo_Links::is_product_browser_url()) {
17
  add_filter( 'wpseo_title', 'ecwid_seo_title' );
18
- add_filter( 'wpseo_metadesc', array( $this, 'wpseo_hook_description' ) );
19
  }
20
  }
21
 
@@ -123,14 +123,7 @@ XML;
123
 
124
  return $separator;
125
  }
126
-
127
- public function wpseo_hook_description($description) {
128
- if ( ecwid_is_applicable_escaped_fragment() )
129
- return '';
130
-
131
- return $description;
132
- }
133
-
134
  protected function _get_base_url( $page ) {
135
  if ( class_exists( 'WPSEO_Sitemaps_Router' ) && method_exists( 'WPSEO_Sitemaps_Router', 'get_base_url' ) ) {
136
  return WPSEO_Sitemaps_Router::get_base_url( $page );
13
  if (ecwid_is_paid_account() && ecwid_is_store_page_available()) {
14
  add_filter( 'wpseo_sitemap_index', array( $this, 'wpseo_hook_sitemap_index' ) );
15
  add_filter( 'wpseo_do_sitemap_ecwid', array( $this, 'wpseo_hook_do_sitemap' ) );
16
+ if ( ecwid_is_applicable_escaped_fragment() || Ecwid_Seo_Links::is_product_browser_url() ) {
17
  add_filter( 'wpseo_title', 'ecwid_seo_title' );
18
+ add_filter( 'wpseo_metadesc', '__return_false' );
19
  }
20
  }
21
 
123
 
124
  return $separator;
125
  }
126
+
 
 
 
 
 
 
 
127
  protected function _get_base_url( $page ) {
128
  if ( class_exists( 'WPSEO_Sitemaps_Router' ) && method_exists( 'WPSEO_Sitemaps_Router', 'get_base_url' ) ) {
129
  return WPSEO_Sitemaps_Router::get_base_url( $page );
includes/class-ecwid-message-manager.php CHANGED
@@ -193,7 +193,7 @@ TXT
193
  'on_activate' => array(
194
  'title' => sprintf( __( 'Greetings! Your %s plugin is now active.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ),
195
  'message' => __('Take a few simple steps to complete store setup', 'ecwid-shopping-cart'),
196
- 'primary_title' => sprintf( __( 'Set up %s', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ),
197
  'primary_url' => 'admin.php?page=ecwid',
198
  'hideable' => true,
199
  'default' => 'disabled'
193
  'on_activate' => array(
194
  'title' => sprintf( __( 'Greetings! Your %s plugin is now active.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ),
195
  'message' => __('Take a few simple steps to complete store setup', 'ecwid-shopping-cart'),
196
+ 'primary_title' => __( 'Set up your store', 'ecwid-shopping-cart'),
197
  'primary_url' => 'admin.php?page=ecwid',
198
  'hideable' => true,
199
  'default' => 'disabled'
includes/class-ecwid-nav-menus.php CHANGED
@@ -151,6 +151,9 @@ class Ecwid_Nav_Menus {
151
  ));
152
  }
153
 
 
 
 
154
  public function process_menu_items($items)
155
  {
156
  if ( is_admin() || empty($items) ) {
@@ -172,9 +175,9 @@ class Ecwid_Nav_Menus {
172
 
173
  $ecwid_menu_type = isset($types[$item->object]) ? $types[$item->object] : null;
174
 
175
- if ( $ecwid_menu_type && isset( $ecwid_menu_type['clean-url'] ) ) {
176
  $item->url = Ecwid_Store_Page::get_menu_item_url($ecwid_menu_type);
177
- $item->ecwid_page_type = $ecwid_menu_type['clean-url'];
178
  }
179
 
180
  if ($item->object == 'ecwid-store-with-categories' || $item->object == 'ecwid-store') {
@@ -211,8 +214,8 @@ class Ecwid_Nav_Menus {
211
  $post->description = '';
212
  $post->xfn = '';
213
  $post->object_id = 0;
214
- $post->ecwid_page_type = 'category';
215
- $post->ecwid_category_id = $category->id;
216
 
217
  $posts[] = $post;
218
  }
@@ -293,44 +296,44 @@ class Ecwid_Nav_Menus {
293
 
294
  $this->item_types = array(
295
  'ecwid-cart' => array(
296
- 'list-name' => __('Cart', 'ecwid-shopping-cart'),
297
- 'classes' => 'ecwid-cart',
298
- 'url' => 'cart',
299
- 'label' => __('Shopping Cart', 'ecwid-shopping-cart'),
300
- 'name' => 'cart',
301
- 'clean-url' => 'cart'
302
  ),
303
  'ecwid-product-search' => array(
304
- 'list-name' => __('Product Search', 'ecwid-shopping-cart'),
305
- 'classes' => 'ecwid-product-search',
306
- 'url' => 'search',
307
- 'label' => __('Product Search', 'ecwid-shopping-cart'),
308
- 'name' => 'search',
309
- 'clean-url' => 'search'
310
  ),
311
  'ecwid-my-account' => array(
312
- 'list-name' => __('My Account', 'ecwid-shopping-cart'),
313
- 'classes' => 'ecwid-my-account',
314
- 'url' => 'accountSettings',
315
- 'label' => __('My Account', 'ecwid-shopping-cart'),
316
- 'name' => 'account',
317
- 'clean-url' => 'account/orders'
318
  ),
319
  'ecwid-store' => array(
320
- 'list-name' => __('Store', 'ecwid-shopping-cart'),
321
- 'classes' => 'ecwid-store',
322
- 'url' => '',
323
- 'label' => __('Store', 'ecwid-shopping-cart'),
324
- 'name' => 'store',
325
- 'clean-url' => ''
326
  ),
327
  'ecwid-store-with-categories' => array(
328
- 'list-name' => __('Store with Categories Menu', 'ecwid-shopping-cart'),
329
- 'classes' => 'ecwid-store-with-categories',
330
- 'url' => '',
331
- 'label' => __('Store', 'ecwid-shopping-cart'),
332
- 'name' => 'store-with-categories',
333
- 'clean-url' => ''
334
  )
335
  );
336
 
151
  ));
152
  }
153
 
154
+ //- дефолтная категория
155
+ //- посмотреть несколько тем
156
+
157
  public function process_menu_items($items)
158
  {
159
  if ( is_admin() || empty($items) ) {
175
 
176
  $ecwid_menu_type = isset($types[$item->object]) ? $types[$item->object] : null;
177
 
178
+ if ( $ecwid_menu_type && isset( $ecwid_menu_type['ecwid-page'] ) ) {
179
  $item->url = Ecwid_Store_Page::get_menu_item_url($ecwid_menu_type);
180
+ $item->ecwid_page_type = $ecwid_menu_type['ecwid-page'];
181
  }
182
 
183
  if ($item->object == 'ecwid-store-with-categories' || $item->object == 'ecwid-store') {
214
  $post->description = '';
215
  $post->xfn = '';
216
  $post->object_id = 0;
217
+ // $post->ecwid_page_type = 'category';
218
+ // $post->ecwid_category_id = $category->id;
219
 
220
  $posts[] = $post;
221
  }
296
 
297
  $this->item_types = array(
298
  'ecwid-cart' => array(
299
+ 'list-name' => __('Cart', 'ecwid-shopping-cart'),
300
+ 'classes' => 'ecwid-cart',
301
+ 'url' => 'cart',
302
+ 'label' => __('Shopping Cart', 'ecwid-shopping-cart'),
303
+ 'name' => 'cart',
304
+ 'ecwid-page' => 'cart'
305
  ),
306
  'ecwid-product-search' => array(
307
+ 'list-name' => __('Product Search', 'ecwid-shopping-cart'),
308
+ 'classes' => 'ecwid-product-search',
309
+ 'url' => 'search',
310
+ 'label' => __('Product Search', 'ecwid-shopping-cart'),
311
+ 'name' => 'search',
312
+ 'ecwid-page' => 'search'
313
  ),
314
  'ecwid-my-account' => array(
315
+ 'list-name' => __('My Account', 'ecwid-shopping-cart'),
316
+ 'classes' => 'ecwid-my-account',
317
+ 'url' => 'accountSettings',
318
+ 'label' => __('My Account', 'ecwid-shopping-cart'),
319
+ 'name' => 'account',
320
+ 'ecwid-page' => 'account/orders'
321
  ),
322
  'ecwid-store' => array(
323
+ 'list-name' => __('Store', 'ecwid-shopping-cart'),
324
+ 'classes' => 'ecwid-store',
325
+ 'url' => '',
326
+ 'label' => __('Store', 'ecwid-shopping-cart'),
327
+ 'name' => 'store',
328
+ 'ecwid-page' => '/'
329
  ),
330
  'ecwid-store-with-categories' => array(
331
+ 'list-name' => __('Store with Categories Menu', 'ecwid-shopping-cart'),
332
+ 'classes' => 'ecwid-store-with-categories',
333
+ 'url' => '',
334
+ 'label' => __('Store', 'ecwid-shopping-cart'),
335
+ 'name' => 'store-with-categories',
336
+ 'ecwid-page' => '/'
337
  )
338
  );
339
 
includes/class-ecwid-popup-deactivate.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
29
+
30
+ $to = 'plugins-feedback@ecwid.com';
31
+
32
+ $body_lines = array();
33
+ if ( get_ecwid_store_id() != ECWID_DEMO_STORE_ID ) {
34
+ $body_lines[] = 'Store ID: ' . get_ecwid_store_id();
35
+ }
36
+
37
+ $reasons = $this->_get_reasons();
38
+ $reason = $reasons[$_GET['reason']];
39
+
40
+ if ( isset( $reason['is_disable_message'] ) ) {
41
+ update_option( self::OPTION_DISABLE_POPUP, true );
42
+ }
43
+
44
+ $body_lines[] = 'Store URL: ' . Ecwid_Store_Page::get_store_url();
45
+ $body_lines[] = 'Plugin installed: ' . strftime( '%d %b %Y', get_option( 'ecwid_installation_date' ) );
46
+ $body_lines[] = 'Reason: ' . $reason['text'] . "\n" . $_GET['message'];
47
+
48
+ global $current_user;
49
+ $reply_to = $current_user->user_email;
50
+
51
+ $result = wp_mail(
52
+ $to,
53
+ __( 'WordPress plugin deactivation feedback (store ID ' . get_ecwid_store_id() . ')', 'ecwid-shopping-cart' ),
54
+ implode( PHP_EOL, $body_lines ),
55
+ 'Reply-To:' . $reply_to
56
+ );
57
+
58
+ if ($result) {
59
+ header('200 OK');
60
+
61
+ die();
62
+ } else {
63
+ header('500 Send mail failed');
64
+ die();
65
+ }
66
+ }
67
+
68
+ public function is_disabled() {
69
+ $disabled = get_option( self::OPTION_DISABLE_POPUP, false );
70
+
71
+ if ( $disabled ) return true;
72
+
73
+ if ( Ecwid_Config::is_wl() ) return true;
74
+
75
+ if (strpos(get_locale(), 'en') !== 0) return true;
76
+
77
+ return false;
78
+ }
79
+
80
+ protected function _get_footer_buttons()
81
+ {
82
+ return array(
83
+ (object) array(
84
+ 'class' => 'button-secondary deactivate',
85
+ 'title' => __( 'Submit & Deactivate', 'ecwid-shopping-cart' )
86
+ ),
87
+ (object) array(
88
+ 'class' => 'button-primary btn-close',
89
+ 'title' => __( 'Cancel', 'ecwid-shopping-cart' )
90
+ )
91
+ );
92
+ }
93
+
94
+ protected function _get_header()
95
+ {
96
+ return __( 'Before You Go', 'ecwid-shopping-cart' );
97
+ }
98
+
99
+ protected function _render_body()
100
+ {
101
+ $reasons = $this->_get_reasons();
102
+ require ( ECWID_POPUP_TEMPLATES_DIR . 'deactivate.php' );
103
+ }
104
+
105
+ protected function _get_reasons()
106
+ {
107
+ $options = array(
108
+ array(
109
+ 'text' => __( 'I have a problem using this plugin', 'ecwid-shopping-cart' ),
110
+ 'has_message' => true,
111
+ 'message_hint' => __( 'What was wrong?', 'ecwid-shopping-cart' ),
112
+ ),
113
+ array(
114
+ 'text' => __( 'The plugin is difficult to set up and use', 'ecwid-shopping-cart' ),
115
+ 'has_message' => true,
116
+ 'message_hint' => __( 'What was difficult?', 'ecwid-shopping-cart' )
117
+ ),
118
+ array(
119
+ 'text' => __( 'The plugins doesn\'t support the feature I want', 'ecwid-shopping-cart' ),
120
+ 'has_message' => true,
121
+ 'message_hint' => __( 'What feature do you need?', 'ecwid-shopping-cart' )
122
+ ),
123
+ array(
124
+ 'text' => __( 'I found a better plugin', 'ecwid-shopping-cart' ),
125
+ 'has_message' => true,
126
+ 'message_hint' => __( 'Can you share the name of the plugin you chose?', 'ecwid-shopping-cart' )
127
+ ),
128
+ array(
129
+ 'text' => __( 'It\'s a temporary deactivation. Please do not ask me again.', 'ecwid-shopping-cart' ),
130
+ 'has_message' => false,
131
+ 'is_disable_message' => true
132
+ ),
133
+ array(
134
+ 'text' => __( 'Other', 'ecwid-shopping-cart' ),
135
+ 'has_message' => true,
136
+ 'message_hint' => __( 'Can you share your feedback? What was wrong?', 'ecwid-shopping-cart' )
137
+ )
138
+ );
139
+
140
+ return $options;
141
+ }
142
+ }
includes/class-ecwid-popup.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !defined( 'ECWID_POPUP_TEMPLATES_DIR' ) ) {
4
+ define ( 'ECWID_POPUP_TEMPLATES_DIR', ECWID_PLUGIN_DIR . 'templates/popup/' );
5
+ }
6
+ abstract class Ecwid_Popup
7
+ {
8
+ public static $popups = array();
9
+
10
+ protected $_class = '';
11
+
12
+ public static function add_popup( $popup ) {
13
+
14
+ if ( current_filter() != 'current_screen' ) {
15
+ if (WP_DEBUG) {
16
+ wp_die( 'Called add_popup not from admin_init action' );
17
+ }
18
+ }
19
+
20
+ self::$popups[] = $popup;
21
+
22
+ $popup->_init();
23
+ }
24
+
25
+ protected function _init()
26
+ {
27
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
28
+ add_action( 'admin_footer', array( $this, 'render' ) );
29
+ }
30
+
31
+ public function enqueue_scripts()
32
+ {
33
+ wp_enqueue_script( 'ecwid-popup', ECWID_PLUGIN_URL . '/js/popup.js', array( 'jquery' ), get_option('ecwid_plugin_version') );
34
+ wp_enqueue_style( 'ecwid-popup', ECWID_PLUGIN_URL . '/css/popup.css', array(), get_option('ecwid_plugin_version') );
35
+ }
36
+
37
+ public function render() {
38
+ require( ECWID_POPUP_TEMPLATES_DIR . 'popup.php' );
39
+ }
40
+
41
+ protected function _render_header() {
42
+ require( ECWID_POPUP_TEMPLATES_DIR . 'header.php' );
43
+ }
44
+
45
+ protected function _render_footer() {
46
+ require( ECWID_POPUP_TEMPLATES_DIR . 'footer.php' );
47
+ }
48
+
49
+ abstract protected function _get_footer_buttons();
50
+
51
+ abstract protected function _get_header();
52
+
53
+ abstract protected function _render_body();
54
+ }
includes/class-ecwid-store-page.php CHANGED
@@ -78,7 +78,10 @@ class Ecwid_Store_Page {
78
  {
79
  $suffix = '';
80
  if ( Ecwid_Seo_Links::is_enabled() ) {
81
- $suffix = $menu_item['clean-url'];
 
 
 
82
  } else {
83
  $suffix = '#!' . $menu_item['url'];
84
  }
@@ -312,7 +315,10 @@ class Ecwid_Store_Page {
312
  return;
313
  }
314
 
315
- $shortcodes = ecwid_find_shortcodes( $store_page->post_content, Ecwid_Shortcode_Base::get_store_shortcode_name() );
 
 
 
316
 
317
  if ( sizeof( $shortcodes ) == 0 ) {
318
  return;
78
  {
79
  $suffix = '';
80
  if ( Ecwid_Seo_Links::is_enabled() ) {
81
+ $suffix = $menu_item['ecwid-page'];
82
+ if ( $suffix == '/' ) {
83
+ $suffix = '';
84
+ }
85
  } else {
86
  $suffix = '#!' . $menu_item['url'];
87
  }
315
  return;
316
  }
317
 
318
+ $shortcodes = array();
319
+ foreach ( Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name ) {
320
+ $shortcodes[] = ecwid_find_shortcodes( $store_page->post_content, $shortcode_name );
321
+ }
322
 
323
  if ( sizeof( $shortcodes ) == 0 ) {
324
  return;
includes/oembed.php CHANGED
@@ -14,8 +14,12 @@ function ecwid_get_embed_content()
14
  $root_category_id = 0;
15
 
16
  $post_content = get_post(get_the_ID())->post_content;
17
- $shortcodes = ecwid_find_shortcodes($post_content, Ecwid_Shortcode_Base::get_store_shortcode_name());
18
-
 
 
 
 
19
  if (!$shortcodes || !isset($shortcodes[0]) || !isset($shortcodes[0][3])) {
20
  return;
21
  }
14
  $root_category_id = 0;
15
 
16
  $post_content = get_post(get_the_ID())->post_content;
17
+ $shortcodes = array();
18
+
19
+ foreach (Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name) {
20
+ $shortcodes = ecwid_find_shortcodes($post_content, $shortcode_name);
21
+ }
22
+
23
  if (!$shortcodes || !isset($shortcodes[0]) || !isset($shortcodes[0][3])) {
24
  return;
25
  }
includes/shortcodes/class-ecwid-shortcode-base.php CHANGED
@@ -29,7 +29,12 @@ abstract class Ecwid_Shortcode_Base {
29
  self::$shortcodes[$this->get_shortcode_name()][] = $this;
30
  }
31
 
32
- public static function get_store_shortcode_name() {
 
 
 
 
 
33
  if ( Ecwid_Config::is_wl() ) {
34
  return 'ec_store';
35
  }
29
  self::$shortcodes[$this->get_shortcode_name()][] = $this;
30
  }
31
 
32
+ public static function get_store_shortcode_names() {
33
+ return array( 'ecwid', 'ec_store' );
34
+
35
+ }
36
+
37
+ public static function get_current_store_shortcode_name() {
38
  if ( Ecwid_Config::is_wl() ) {
39
  return 'ec_store';
40
  }
includes/shortcodes/class-ecwid-shortcode-productbrowser.php CHANGED
@@ -38,6 +38,8 @@ class Ecwid_Shortcode_ProductBrowser extends Ecwid_Shortcode_Base {
38
  } elseif ( Ecwid_Seo_Links::is_enabled() && Ecwid_Store_Page::is_store_page() ) {
39
  $html_catalog_params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
40
  }
 
 
41
 
42
  if ( $html_catalog_params !== false ) {
43
  $plain_content = $this->_build_html_catalog( $store_id, $html_catalog_params );
@@ -45,7 +47,7 @@ class Ecwid_Shortcode_ProductBrowser extends Ecwid_Shortcode_Base {
45
 
46
  $classname = $this->_get_html_class_name();
47
  $result = <<<HTML
48
- <div id="ecwid-store-$store_id" class="ecwid-shopping-cart-$classname">
49
  <div id="ecwid-html-catalog-$store_id">{$plain_content}</div>
50
  </div>
51
  HTML;
@@ -60,46 +62,47 @@ HTML;
60
  */
61
  public function _build_html_catalog($store_id, $params)
62
  {
63
- include_once ECWID_PLUGIN_DIR . 'lib/ecwid_product_api.php';
64
- include_once ECWID_PLUGIN_DIR . 'lib/ecwid_catalog.php';
65
-
66
- $page_url = get_page_link();
67
 
68
- $catalog = new EcwidCatalog($store_id, $page_url);
69
 
70
- $url = false;
71
 
72
- if (isset($params['mode']) && !empty($params['mode'])) {
73
- if ($params['mode'] == 'product') {
74
- $plain_content = $catalog->get_product($params['id']);
75
- $url = Ecwid_Store_Page::get_product_url($params['id']);
76
- } elseif ($params['mode'] == 'category') {
77
- $plain_content = $catalog->get_category($params['id']);
78
- $url = Ecwid_Store_Page::get_category_url($params['id']);
79
- }
 
 
 
 
80
 
81
- } else {
82
 
83
  $id = intval( $this->_get_param_default_category_id( $params ) );
84
- $plain_content = $catalog->get_category($id);
85
- if ( empty( $plain_content ) || !isset( $params['id'] ) ) {
86
- $plain_content = $catalog->get_category(0);
87
- } else {
88
- $url = Ecwid_Store_Page::get_category_url( $params['id'] );
89
- }
90
  }
 
 
 
91
 
92
- if ( $url && !Ecwid_Seo_Links::is_product_browser_url() ) {
93
- $parsed = parse_url($url);
94
 
95
  if ($parsed['fragment']) {
96
  $plain_content .= '<script data-cfasync="false" type="text/javascript"> if (!document.location.hash) document.location.hash = "' . $parsed['fragment'] . '";</script>';
97
- return $plain_content;
98
- } else {
99
- $plain_content .= '<script data-cfasync="false" type="text/javascript"> document.location = "' . esc_js($url) . '";</script>';
100
- return $plain_content;
101
- }
102
  }
 
 
103
  return $plain_content;
104
  }
105
 
@@ -173,6 +176,10 @@ HTML;
173
  $input_params['defaultCategoryId'] = $ecwid_default_category_id;
174
  }
175
 
 
 
 
 
176
  $this->_params = $input_params;
177
  }
178
 
38
  } elseif ( Ecwid_Seo_Links::is_enabled() && Ecwid_Store_Page::is_store_page() ) {
39
  $html_catalog_params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
40
  }
41
+
42
+ $html_catalog_params['default_category_id'] = @ (int)$this->_params['defaultCategoryId'];
43
 
44
  if ( $html_catalog_params !== false ) {
45
  $plain_content = $this->_build_html_catalog( $store_id, $html_catalog_params );
47
 
48
  $classname = $this->_get_html_class_name();
49
  $result = <<<HTML
50
+ <div id="ecwid-store-$store_id" class="ecwid-shopping-cart-$classname" data-ecwid-default-category-id="$html_catalog_params[default_category_id]">
51
  <div id="ecwid-html-catalog-$store_id">{$plain_content}</div>
52
  </div>
53
  HTML;
62
  */
63
  public function _build_html_catalog($store_id, $params)
64
  {
65
+ include_once ECWID_PLUGIN_DIR . 'lib/ecwid_product_api.php';
66
+ include_once ECWID_PLUGIN_DIR . 'lib/ecwid_catalog.php';
 
 
67
 
68
+ $page_url = get_page_link();
69
 
70
+ $catalog = new EcwidCatalog($store_id, $page_url);
71
 
72
+ $url = false;
73
+
74
+ $is_default_category = false;
75
+
76
+ if ( isset( $params['mode'] ) && !empty( $params['mode'] ) ) {
77
+ if ( $params['mode'] == 'product' ) {
78
+ $plain_content = $catalog->get_product( $params['id'] );
79
+ $url = Ecwid_Store_Page::get_product_url( $params['id'] );
80
+ } elseif ( $params['mode'] == 'category' ) {
81
+ $plain_content = $catalog->get_category( $params['id'] );
82
+ $url = Ecwid_Store_Page::get_category_url( $params['id'] );
83
+ }
84
 
85
+ } else {
86
 
87
  $id = intval( $this->_get_param_default_category_id( $params ) );
88
+ $plain_content = $catalog->get_category($id);
89
+ if ( empty( $plain_content ) ) {
90
+ $plain_content = $catalog->get_category(0);
 
 
 
91
  }
92
+
93
+ $is_default_category = true;
94
+ }
95
 
96
+ if ( $url && !$is_default_category && !Ecwid_Seo_Links::is_product_browser_url() ) {
97
+ $parsed = parse_url($url);
98
 
99
  if ($parsed['fragment']) {
100
  $plain_content .= '<script data-cfasync="false" type="text/javascript"> if (!document.location.hash) document.location.hash = "' . $parsed['fragment'] . '";</script>';
101
+ } else {
102
+ $plain_content .= '<script data-cfasync="false" type="text/javascript"> document.location = "' . esc_js($url) . '";</script>';
 
 
 
103
  }
104
+ }
105
+
106
  return $plain_content;
107
  }
108
 
176
  $input_params['defaultCategoryId'] = $ecwid_default_category_id;
177
  }
178
 
179
+ if (isset($shortcode_params['default_product_id'])) {
180
+ $input_params['defaultProductId'] = $shortcode_params['default_product_id'];
181
+ }
182
+
183
  $this->_params = $input_params;
184
  }
185
 
includes/widgets/class-ecwid-widget-floating-shopping-cart.php CHANGED
@@ -96,7 +96,7 @@ class Ecwid_Widget_Floating_Shopping_Cart extends WP_Widget {
96
  <<<HTML
97
  <div class="ecwid-float-icons position-$position" ondragstart="return false">
98
  <div class="ecwid-cart-icon off">
99
- <a href="$cart_url" data-count="0">
100
  <svg width="20" height="26" viewBox="0 0 20 26" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M.5 6.5v14.81c0 2.255 1.79 4.084 4 4.084h11c2.21 0 4-1.83 4-4.085V6.5H.5zM6 10.585c.552 0 1-.457 1-1.02C7 9 6.552 8.542 6 8.542S5 9 5 9.563c0 .565.448 1.022 1 1.022zm8 0c.552 0 1-.457 1-1.02 0-.565-.448-1.022-1-1.022S13 9 13 9.563c0 .565.448 1.022 1 1.022z" stroke="#439CA0"/><path d="M14.5 6h-1V4.582c0-1.97-1.57-3.575-3.5-3.575S6.5 2.61 6.5 4.582V6h-1V4.582C5.5 2.048 7.52-.014 10-.014c2.482 0 4.5 2.062 4.5 4.596V6z" fill="#439CA0"/></g></svg>
101
  <div id="ecwid-cart"><script type="text/javascript"> xMinicart("style=","id=ecwid-cart"); </script></div>
102
  </a>
96
  <<<HTML
97
  <div class="ecwid-float-icons position-$position" ondragstart="return false">
98
  <div class="ecwid-cart-icon off">
99
+ <a href="$cart_url" data-ecwid-page="cart" data-count="0">
100
  <svg width="20" height="26" viewBox="0 0 20 26" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M.5 6.5v14.81c0 2.255 1.79 4.084 4 4.084h11c2.21 0 4-1.83 4-4.085V6.5H.5zM6 10.585c.552 0 1-.457 1-1.02C7 9 6.552 8.542 6 8.542S5 9 5 9.563c0 .565.448 1.022 1 1.022zm8 0c.552 0 1-.457 1-1.02 0-.565-.448-1.022-1-1.022S13 9 13 9.563c0 .565.448 1.022 1 1.022z" stroke="#439CA0"/><path d="M14.5 6h-1V4.582c0-1.97-1.57-3.575-3.5-3.575S6.5 2.61 6.5 4.582V6h-1V4.582C5.5 2.048 7.52-.014 10-.014c2.482 0 4.5 2.062 4.5 4.596V6z" fill="#439CA0"/></g></svg>
101
  <div id="ecwid-cart"><script type="text/javascript"> xMinicart("style=","id=ecwid-cart"); </script></div>
102
  </a>
includes/widgets/class-ecwid-widget-products-base.php CHANGED
@@ -126,7 +126,7 @@ HTML;
126
  $name = esc_html($product->name);
127
 
128
  echo <<<HTML
129
- <a class="product" href="$product->link" alt="$name" title="$name">
130
  <div class="ecwid ecwid-SingleProduct ecwid-Product ecwid-Product-$product->id" data-single-product-link="$product->link" itemscope itemtype="http://schema.org/Product" data-single-product-id="$product->id">
131
  <div itemprop="image" data-force-image="$force_image"></div>
132
  <div class="ecwid-title" itemprop="name"></div>
126
  $name = esc_html($product->name);
127
 
128
  echo <<<HTML
129
+ <a class="product" href="$product->link" data-ecwid-page="product" data-ecwid-product-id="$product->id" alt="$name" title="$name">
130
  <div class="ecwid ecwid-SingleProduct ecwid-Product ecwid-Product-$product->id" data-single-product-link="$product->link" itemscope itemtype="http://schema.org/Product" data-single-product-id="$product->id">
131
  <div itemprop="image" data-force-image="$force_image"></div>
132
  <div class="ecwid-title" itemprop="name"></div>
includes/widgets/class-ecwid-widget-random-product.php CHANGED
@@ -19,9 +19,9 @@ class Ecwid_Widget_Random_Product extends WP_Widget {
19
 
20
  $content = <<<HTML
21
  <div class="ecwid ecwid-random-product ecwid-SingleProduct-v2 ecwid-SingleProduct-v2-bordered ecwid-SingleProduct-v2-centered ecwid-Product ecwid-Product-$product->id" itemscope itemtype="http://schema.org/Product" data-single-product-id="$product->id">
22
- <a href="$url"><div itemprop="image"></div></a>
23
- <a href="$url"><div class="ecwid-title" itemprop="name" content="$name"></div></a>
24
- <a href="$url"><div itemtype="http://schema.org/Offer" itemscope itemprop="offers">
25
  <div class="ecwid-productBrowser-price ecwid-price" itemprop="price" content="$product->price" data-spw-price-location="button">
26
  <div itemprop="priceCurrency"></div>
27
  </div>
19
 
20
  $content = <<<HTML
21
  <div class="ecwid ecwid-random-product ecwid-SingleProduct-v2 ecwid-SingleProduct-v2-bordered ecwid-SingleProduct-v2-centered ecwid-Product ecwid-Product-$product->id" itemscope itemtype="http://schema.org/Product" data-single-product-id="$product->id">
22
+ <a href="$url" data-ecwid-page="product" data-ecwid-product-id="$product->id"><div itemprop="image"></div></a>
23
+ <a href="$url" data-ecwid-page="product" data-ecwid-product-id="$product->id"><div class="ecwid-title" itemprop="name" content="$name"></div></a>
24
+ <a href="$url" data-ecwid-page="product" data-ecwid-product-id="$product->id"><div itemtype="http://schema.org/Offer" itemscope itemprop="offers">
25
  <div class="ecwid-productBrowser-price ecwid-price" itemprop="price" content="$product->price" data-spw-price-location="button">
26
  <div itemprop="priceCurrency"></div>
27
  </div>
includes/widgets/class-ecwid-widget-store-link.php CHANGED
@@ -12,7 +12,7 @@ class Ecwid_Widget_Store_Link extends WP_Widget {
12
 
13
  echo '<div>';
14
 
15
- echo '<a href="' . Ecwid_Store_Page::get_store_url() . '">' . $instance['label'] . '</a>';
16
  echo '</div>';
17
 
18
  echo $after_widget;
12
 
13
  echo '<div>';
14
 
15
+ echo '<a href="' . Ecwid_Store_Page::get_store_url() . '" data-ecwid-page="/">' . $instance['label'] . '</a>';
16
  echo '</div>';
17
 
18
  echo $after_widget;
includes/widgets/class-ecwid-widget-vertical-categories-list.php CHANGED
@@ -30,7 +30,10 @@ class Ecwid_Widget_Vertical_Categories_List extends WP_Widget {
30
 
31
  foreach ($categories as $category) {
32
  echo '<li>';
33
- echo '<a href="' . Ecwid_Store_Page::get_category_url( $category->id ) . '">' . $category->name . '</a>';
 
 
 
34
  echo '</li>';
35
  }
36
 
30
 
31
  foreach ($categories as $category) {
32
  echo '<li>';
33
+ echo '<a href="' . Ecwid_Store_Page::get_category_url( $category->id )
34
+ . '" data-ecwid-page="category" data-ecwid-category-id="' . $category->id . '">'
35
+ . $category->name
36
+ . '</a>';
37
  echo '</li>';
38
  }
39
 
js/frontend.js CHANGED
@@ -3,9 +3,39 @@ window.ec.config = window.ec.config || {};
3
  window.ec.config.storefrontUrls = window.ec.config.storefrontUrls || {};
4
 
5
  jQuery(document).ready(function() {
6
- jQuery('.ecwid-store-with-categories a').click(function() {jQuery(':focus').blur()});
7
-
8
- jQuery('a[data-ecwid-page]').click(function() {
9
 
10
- });
11
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  window.ec.config.storefrontUrls = window.ec.config.storefrontUrls || {};
4
 
5
  jQuery(document).ready(function() {
6
+ jQuery('.ecwid-store-with-categories a').click(function() {jQuery(':focus').blur()});
 
 
7
 
8
+ window.ecwidShoppingCartMakeStoreLinksUseApiCall = function($link) {
9
+
10
+ $link.click(function() {
11
+ if (typeof Ecwid == 'undefined') {
12
+ return true;
13
+ }
14
+
15
+ var page = jQuery(this).data('ecwid-page');
16
+ if (page == '/') {
17
+ var id = jQuery('[data-ecwid-default-category-id]').data('ecwid-default-category-id');
18
+ if (id) {
19
+ Ecwid.openPage('category', {id:id});
20
+ } else {
21
+ Ecwid.openPage('category', 0);
22
+ }
23
+ } if (page == 'category') {
24
+ Ecwid.openPage('category', {id:jQuery(this).data('ecwid-category-id')});
25
+ } else if ( page == 'product' ) {
26
+ Ecwid.openPage('product', {id: jQuery(this).data('ecwid-product-id')});
27
+ } else {
28
+ Ecwid.openPage(page);
29
+ }
30
+
31
+ jQuery(this).parents('ul.sub-menu.focus').removeClass('focus').blur().parents('li.menu-item.focus').removeClass('focus').blur();
32
+
33
+ return false;
34
+ });
35
+ };
36
+
37
+
38
+ if (ecwidParams.useJsApiToOpenStorePages) {
39
+ ecwidShoppingCartMakeStoreLinksUseApiCall(jQuery("a[data-ecwid-page]"));
40
+ }
41
+ });
js/nav-menu-frontend.js CHANGED
@@ -14,6 +14,7 @@ jQuery(document).ready(function() {
14
  } else {
15
  window.ecwidCurrentMenuPage = 'store';
16
  }
 
17
  });
18
 
19
  Ecwid.OnPageLoaded.add(refreshEcwidMenuItemsSelection);
14
  } else {
15
  window.ecwidCurrentMenuPage = 'store';
16
  }
17
+
18
  });
19
 
20
  Ecwid.OnPageLoaded.add(refreshEcwidMenuItemsSelection);
js/popup-deactivate.js ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+
3
+ var deactivateButton = jQuery('tr[data-slug="ecwid-shopping-cart"] .deactivate a');
4
+
5
+ jQuery('input[name=reason]').click(function() {
6
+ jQuery('.reasons-list-item').removeClass('selected');
7
+
8
+ jQuery(this).closest('.reasons-list-item').addClass('selected');
9
+ });
10
+
11
+ deactivateButton.click(function() {
12
+ jQuery('.ecwid-popup-deactivate').addClass('open');
13
+ jQuery('body').addClass('ecwid-popup-open');
14
+
15
+ return false;
16
+ });
17
+
18
+ function gatherFeedback() {
19
+ var feedback = {};
20
+
21
+ var reasonElement = jQuery('.ecwid-popup-deactivate input[name=reason]:checked');
22
+ feedback.reason = reasonElement.val();
23
+ feedback.reasonText = reasonElement.attr('data-text');
24
+ feedback.message = jQuery('.ecwid-popup-deactivate textarea[name="message[' + feedback.reason + ']"]').val();
25
+
26
+ return feedback;
27
+ }
28
+
29
+
30
+ jQuery('.ecwid-popup-deactivate .deactivate').click(function() {
31
+ feedback = gatherFeedback();
32
+ jQuery.ajax({
33
+ url: wp.ajax.settings.url,
34
+ data: {
35
+ action: 'ecwid_deactivate_feedback',
36
+ reason: feedback.reason,
37
+ message: feedback.message
38
+ },
39
+ complete: function() {
40
+ location.href = deactivateButton.attr('href');
41
+ }
42
+ });
43
+ });
44
+
45
+ jQuery('.ecwid-popup-deactivate .bottom-support-link a').click(function() {
46
+ var feedback = gatherFeedback();
47
+
48
+ var target = 'admin.php?page=ec-store-help';
49
+
50
+ if (feedback.reasonText)
51
+ target += '&contact_us_subject=' + encodeURIComponent(feedback.reasonText);
52
+ if (feedback.message)
53
+ target += '&contact_us_message=' + encodeURIComponent(feedback.message);
54
+
55
+ location.href = target;
56
+
57
+ return false;
58
+ });
59
+ });
js/popup.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery('document').ready(function() {
2
+ jQuery('.ecwid-popup').click(function(e) {
3
+ var $popup = jQuery('.ecwid-popup-window', this);
4
+
5
+ if (!$popup.is(e.target) && $popup.has(e.target).length === 0) {
6
+ jQuery(this).removeClass('open');
7
+ jQuery('body').removeClass('ecwid-popup-open');
8
+ }
9
+ });
10
+
11
+ jQuery('.ecwid-popup .btn-close').click(function() {
12
+ jQuery(this).closest('.ecwid-popup').removeClass('open');
13
+ jQuery('body').removeClass('ecwid-popup-open');
14
+ });
15
+ });
js/products-list.js CHANGED
@@ -115,17 +115,16 @@ jQuery.widget('ecwid.productsList', {
115
  var container = jQuery('.'+ this._getProductClass(product.id), this.el);
116
 
117
  if (product.link != '') {
118
-
119
- if ( window.ec && window.ec.config && window.ec.config.baseUrl ) {
120
- var match = product.link.match(/([^-^\/]*)-p([0-9]*)$/);
121
- if (match && match.length == 3) {
122
- product.link = '#!/' + match[1] + '/p/' + match[2];
123
- }
124
- }
125
-
126
- jQuery('a', container)
127
  .attr('href', product.link)
128
- .attr('title', product.name);
 
 
 
 
 
 
129
  }
130
  if (product.image) {
131
  jQuery('.' + this._prefix + '-image img', container).attr('src', product.image);
115
  var container = jQuery('.'+ this._getProductClass(product.id), this.el);
116
 
117
  if (product.link != '') {
118
+
119
+ var a = jQuery('a', container)
 
 
 
 
 
 
 
120
  .attr('href', product.link)
121
+ .attr('title', product.name)
122
+ .data('ecwid-page', 'product')
123
+ .data('ecwid-product-id', product.id);
124
+
125
+ if (typeof window.ecwidShoppingCartMakeStoreLinksUseApiCall != 'undefined') {
126
+ ecwidShoppingCartMakeStoreLinksUseApiCall(a);
127
+ }
128
  }
129
  if (product.image) {
130
  jQuery('.' + this._prefix + '-image img', container).attr('src', product.image);
js/store-editor-common.js CHANGED
@@ -4,13 +4,19 @@ function ecwid_get_store_shortcode(content) {
4
  var found = false;
5
  var index = 0;
6
 
7
- while (found = wp.shortcode.next(ecwid_params.store_shortcode, content, index)) {
8
-
9
- if (found && (!found.shortcode.attrs.named.widgets || found.shortcode.attrs.named.widgets.toLowerCase().indexOf('productbrowser') != -1)) {
10
- break;
 
 
 
 
 
11
  }
12
- index = found.index + 1;
13
- }
 
14
 
15
  if (typeof found == 'undefined') {
16
  found = false;
@@ -18,7 +24,14 @@ function ecwid_get_store_shortcode(content) {
18
 
19
  // Workaround for the caching bug that does allow to have properly parsed attributes
20
  if (found) {
21
- var tmpfound = wp.shortcode.next(ecwid_params.store_shortcode, found.content.replace('[' + ecwid_params.store_shortcode, '[' + ecwid_params.store_shortcode+ ' timestamp="' + (new Date()).getMilliseconds() + '"'));
 
 
 
 
 
 
 
22
  found.shortcode.attrs = tmpfound.shortcode.attrs;
23
  delete found.shortcode.attrs.named.timestamp;
24
  }
4
  var found = false;
5
  var index = 0;
6
 
7
+ for (var i = 0; i < ecwid_params.store_shortcodes.length; i++) {
8
+ var candidate = false;
9
+ while (candidate = wp.shortcode.next(ecwid_params.store_shortcodes[i], content, index)) {
10
+
11
+ if (candidate && (!candidate.shortcode.attrs.named.widgets || candidate.shortcode.attrs.named.widgets.toLowerCase().indexOf('productbrowser') != -1)) {
12
+ found = candidate;
13
+ break;
14
+ }
15
+ index = found.index + 1;
16
  }
17
+
18
+ if (found) break;
19
+ }
20
 
21
  if (typeof found == 'undefined') {
22
  found = false;
24
 
25
  // Workaround for the caching bug that does allow to have properly parsed attributes
26
  if (found) {
27
+ var tmpfound = false;
28
+ for (var i = 0; i < ecwid_params.store_shortcodes.length; i++) {
29
+ var shortcode_name = ecwid_params.store_shortcodes[i];
30
+ tmpfound = wp.shortcode.next(shortcode_name, found.content.replace('[' + shortcode_name, '[' + shortcode_name + ' timestamp="' + (new Date()).getMilliseconds() + '"'));
31
+ if (tmpfound) {
32
+ break;
33
+ }
34
+ }
35
  found.shortcode.attrs = tmpfound.shortcode.attrs;
36
  delete found.shortcode.attrs.named.timestamp;
37
  }
js/store-editor-page.js CHANGED
@@ -51,7 +51,7 @@ jQuery(document).ready(function() {
51
  attributes.grid_rows = grid[1];
52
  attributes.grid_columns = grid[2];
53
 
54
- for (var i in {'categories_per_row': defaults.categories_per_row, 'list': defaults.list_rows, 'table': defaults.table_rows, 'grid_rows': defaults.grid_rows, 'grid_columns': defaults.grid_columns, 'default_category_id': 0}) {
55
  parsed = parseInt(attributes[i]);
56
  if (isNaN(parsed) || parsed < 0) {
57
  attributes[i] = undefined;
@@ -77,6 +77,7 @@ jQuery(document).ready(function() {
77
  'grid_rows': grid[1],
78
  'grid_columns': grid[2],
79
  'default_category_id': attributes.default_category_id,
 
80
  'minicart_layout': 'attachToCategories'
81
  };
82
 
@@ -97,6 +98,7 @@ jQuery(document).ready(function() {
97
  'table_rows': ecwid_pb_defaults.table_rows,
98
  'list_rows': ecwid_pb_defaults.list_rows,
99
  'default_category_id': 0,
 
100
  'category_view': 'grid',
101
  'search_view': 'list',
102
  'minicart_layout': 'MiniAttachToProductBrowser'
@@ -222,7 +224,8 @@ jQuery(document).ready(function() {
222
  result.list = getNumber('list_rows', defaults.list_rows);
223
  result.table = getNumber('table_rows', defaults.table_rows);
224
  result.default_category_id = getNumber('default_category_id', defaults.default_category_id);
225
- result.category_view = getString('category_view', ['list', 'grid', 'table'], defaults.category_view);
 
226
  result.search_view = getString('search_view', ['list', 'grid', 'table'], defaults.search_view);
227
  result.minicart_layout = defaults.minicart_layout;
228
 
51
  attributes.grid_rows = grid[1];
52
  attributes.grid_columns = grid[2];
53
 
54
+ for (var i in {'categories_per_row': defaults.categories_per_row, 'list': defaults.list_rows, 'table': defaults.table_rows, 'grid_rows': defaults.grid_rows, 'grid_columns': defaults.grid_columns, 'default_category_id': 0, 'default_product_id': 0}) {
55
  parsed = parseInt(attributes[i]);
56
  if (isNaN(parsed) || parsed < 0) {
57
  attributes[i] = undefined;
77
  'grid_rows': grid[1],
78
  'grid_columns': grid[2],
79
  'default_category_id': attributes.default_category_id,
80
+ 'default_product_id': attributes.default_product_id,
81
  'minicart_layout': 'attachToCategories'
82
  };
83
 
98
  'table_rows': ecwid_pb_defaults.table_rows,
99
  'list_rows': ecwid_pb_defaults.list_rows,
100
  'default_category_id': 0,
101
+ 'default_product_id': 0,
102
  'category_view': 'grid',
103
  'search_view': 'list',
104
  'minicart_layout': 'MiniAttachToProductBrowser'
224
  result.list = getNumber('list_rows', defaults.list_rows);
225
  result.table = getNumber('table_rows', defaults.table_rows);
226
  result.default_category_id = getNumber('default_category_id', defaults.default_category_id);
227
+ result.default_product_id = getNumber('default_category_id', defaults.default_product_id);
228
+ result.category_view = getString('category_view', ['list', 'grid', 'table'], defaults.category_view);
229
  result.search_view = getString('search_view', ['list', 'grid', 'table'], defaults.search_view);
230
  result.minicart_layout = defaults.minicart_layout;
231
 
languages/ecwid-shopping-cart-ru_RU.mo CHANGED
Binary file
languages/ecwid-shopping-cart-ru_RU.po CHANGED
@@ -210,8 +210,8 @@ msgid "Take a few simple steps to complete store setup"
210
  msgstr "Магазин почти готов — осталось несколько простых шагов"
211
 
212
  #: includes/class-ecwid-message-manager.php:205
213
- msgid "Set up %s"
214
- msgstr "Настроить %s"
215
 
216
  #: includes/class-ecwid-message-manager.php:204
217
  msgid "Your store is almost ready!"
@@ -1186,7 +1186,7 @@ msgstr "Добро пожаловать в %s!"
1186
  #: templates/landing.php:9
1187
  msgid ""
1188
  "Thank you for choosing %s to build your online store. The first step to sell "
1189
- "successfully online is to setup your store! Let’s get started and add a "
1190
  "store to your website in a few simple steps."
1191
  msgstr ""
1192
  "Спасибо, что выбрали %s для создания вашего интернет-магазина. Первый шаг к "
@@ -1194,8 +1194,8 @@ msgstr ""
1194
  "ваш сайт за несколько простых шагов."
1195
 
1196
  #: templates/landing.php:15 templates/landing.php:132
1197
- msgid "Create Free %s"
1198
- msgstr "Создать %s"
1199
 
1200
  #: templates/landing.php:31 templates/landing.php:148
1201
  msgid "Store is created"
@@ -1225,10 +1225,6 @@ msgstr ""
1225
  msgid "Already have %s account?"
1226
  msgstr "Уже есть аккаунт в %s?"
1227
 
1228
- #: templates/landing.php:50 templates/landing_old.php:62
1229
- msgid "Connect your store to Wordpress site"
1230
- msgstr "Подключить магазин к своему сайту"
1231
-
1232
  #: templates/landing.php:53
1233
  msgid ""
1234
  "You will be asked to log in to your %s Control Panel<br />and give "
@@ -1242,8 +1238,8 @@ msgid "Get ready to sell online"
1242
  msgstr "Продавать онлайн – это просто"
1243
 
1244
  #: templates/landing.php:67
1245
- msgid "Sell Everywhere<br>with your %s store"
1246
- msgstr "Продавайте c %s там,<br> где ваши клиенты"
1247
 
1248
  #: templates/landing.php:68 templates/landing_old.php:87
1249
  msgid ""
210
  msgstr "Магазин почти готов — осталось несколько простых шагов"
211
 
212
  #: includes/class-ecwid-message-manager.php:205
213
+ msgid "Set up your store"
214
+ msgstr "Настроить магазин"
215
 
216
  #: includes/class-ecwid-message-manager.php:204
217
  msgid "Your store is almost ready!"
1186
  #: templates/landing.php:9
1187
  msgid ""
1188
  "Thank you for choosing %s to build your online store. The first step to sell "
1189
+ "successfully online is to set up your store! Let’s get started and add a "
1190
  "store to your website in a few simple steps."
1191
  msgstr ""
1192
  "Спасибо, что выбрали %s для создания вашего интернет-магазина. Первый шаг к "
1194
  "ваш сайт за несколько простых шагов."
1195
 
1196
  #: templates/landing.php:15 templates/landing.php:132
1197
+ msgid "Create Store"
1198
+ msgstr "Создать магазин"
1199
 
1200
  #: templates/landing.php:31 templates/landing.php:148
1201
  msgid "Store is created"
1225
  msgid "Already have %s account?"
1226
  msgstr "Уже есть аккаунт в %s?"
1227
 
 
 
 
 
1228
  #: templates/landing.php:53
1229
  msgid ""
1230
  "You will be asked to log in to your %s Control Panel<br />and give "
1238
  msgstr "Продавать онлайн – это просто"
1239
 
1240
  #: templates/landing.php:67
1241
+ msgid "Sell Everywhere"
1242
+ msgstr "Продавайте там,<br> где ваши клиенты"
1243
 
1244
  #: templates/landing.php:68 templates/landing_old.php:87
1245
  msgid ""
lib/ecwid_api_v3.php CHANGED
@@ -386,6 +386,10 @@ class Ecwid_Api_V3
386
 
387
  $url = $this->build_request_url($url, $params);
388
  $result = EcwidPlatform::fetch_url($url);
 
 
 
 
389
 
390
  $profile = json_decode($result['data']);
391
 
@@ -423,7 +427,7 @@ class Ecwid_Api_V3
423
  'email' => $admin_email,
424
  'name' => $admin_name,
425
  'password' => wp_generate_password(8),
426
- 'ip' => $_SERVER['REMOTE_ADDR']
427
  ),
428
  'affiliatePartner' => array(
429
  'source' => 'wporg'
386
 
387
  $url = $this->build_request_url($url, $params);
388
  $result = EcwidPlatform::fetch_url($url);
389
+
390
+ if (@$result['code'] != '200' || empty($result['data'])) {
391
+ return false;
392
+ }
393
 
394
  $profile = json_decode($result['data']);
395
 
427
  'email' => $admin_email,
428
  'name' => $admin_name,
429
  'password' => wp_generate_password(8),
430
+ 'ip' => in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')) ? '35.197.29.131' : $_SERVER['REMOTE_ADDR']
431
  ),
432
  'affiliatePartner' => array(
433
  'source' => 'wporg'
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: Ecwid
3
  Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
4
  Requires at least: 3.5
5
- Tested up to: 4.8
6
- Stable tag: 5.6.2
7
 
8
  Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
9
 
@@ -149,6 +149,12 @@ You can use Ecwid’s built-in import tools to copy your store products from any
149
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
150
 
151
  == Changelog ==
 
 
 
 
 
 
152
  = 5.6.2 - Oct 25, 2017 =
153
  - **Fixed an issue with custom store menu links.** You can add store pages to the site menu under “Appearance → Menu” in your WordPress site settings. Previously, these links might not work if you added them in the recent weeks. We now fixed it, they should work fine.
154
  - **Fixed an issue with the browser back button and the customer cart content.** In some rare cases (when the Single Sign On tool is enabled), when a logged in store visitor clicked the back button in their browser, the cart content might be refreshed. We fixed that — whether you have the customer Single Sign On enabled or not, the storefront, cart and checkout should work properly.
2
  Contributors: Ecwid
3
  Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
4
  Requires at least: 3.5
5
+ Tested up to: 4.9
6
+ Stable tag: 5.7
7
 
8
  Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
9
 
149
  * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
150
 
151
  == Changelog ==
152
+ = 5.7 =
153
+ - **New feature in the [ecwid] shortcode — it’s now possible to specify the product that will be displayed by default when the store page is opened.** If you want to feature some product from your online store on one of the site pages or if you sell a single product, you can specify it in the new “default_product_id” parameter in the ecwid shortcode to make it opened by default.
154
+ - **Speedup in the store navigation for your customers.** We improved Ecwid e-commerce sidebar widgets and menus in the storefront, they now work without page reload when a visitor is already on the store page. After the customer opens your store page, all further browsing will be super fast, including switching between products, opening categories, visiting recently viewed products etc.
155
+ - **Fixed an issue with title and description meta tags being changed by the Yoast SEO plugin on store pages.** If you have Yoast installed, you might notice this issue recently. Now your products and categories titles and descriptions will get to the page meta title/description tags with no problem. This should help Google index your catalog properly.
156
+ - Ecwid is constantly updated with new cool ecommerce features and improvements. To see more updates and learn something new about selling online, see [our blog](https://www.ecwid.com/blog/ecwid-updates).
157
+
158
  = 5.6.2 - Oct 25, 2017 =
159
  - **Fixed an issue with custom store menu links.** You can add store pages to the site menu under “Appearance → Menu” in your WordPress site settings. Previously, these links might not work if you added them in the recent weeks. We now fixed it, they should work fine.
160
  - **Fixed an issue with the browser back button and the customer cart content.** In some rare cases (when the Single Sign On tool is enabled), when a logged in store visitor clicked the back button in their browser, the cart content might be refreshed. We fixed that — whether you have the customer Single Sign On enabled or not, the storefront, cart and checkout should work properly.
templates/admin-footer.php CHANGED
@@ -15,12 +15,14 @@
15
  <?php _e('<a href="admin.php?page=' . Ecwid_Admin::ADMIN_SLUG . '-help">Read FAQ or contact support</a>', 'ecwid-shopping-cart'); ?>
16
  </div>
17
  </div>
18
- <?php endif; ?>
19
- <?php if (@$show_reconnect): ?>
20
- <div class="ecwid-admin-footer-block">
21
- <h4 class="ecwid-admin-footer-title"><?php printf( __('Want to connect another %s store?', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></h4>
22
- <div class="ecwid-admin-footer-text">
23
- <?php echo sprintf(__('<a %s>Reconnect</a>', 'ecwid-shopping-cart'), 'href="' . Ecwid_Admin::get_dashboard_url() . '&reconnect"'); ?>
24
- </div>
25
- </div>
26
- <?php endif; ?>
 
 
15
  <?php _e('<a href="admin.php?page=' . Ecwid_Admin::ADMIN_SLUG . '-help">Read FAQ or contact support</a>', 'ecwid-shopping-cart'); ?>
16
  </div>
17
  </div>
18
+ <?php endif; ?>
19
+ <?php if (@$show_reconnect && Ecwid_Config::should_show_reconnect_in_footer()): ?>
20
+ <div class="ecwid-admin-footer-block">
21
+ <h4 class="ecwid-admin-footer-title"><?php printf( __('Want to connect another %s store?', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></h4>
22
+ <div class="ecwid-admin-footer-text">
23
+ <?php echo sprintf(__('<a %s>Reconnect</a>', 'ecwid-shopping-cart'), 'href="' . Ecwid_Admin::get_dashboard_url() . '&reconnect"'); ?>
24
+ </div>
25
+ </div>
26
+ <?php endif; ?>
27
+ </div>
28
+
templates/help.php CHANGED
@@ -224,8 +224,8 @@
224
  <form action="admin-post.php" enctype="multipart/form-data" class="new_email" id="new_email" method="post" novalidate="novalidate">
225
  <input type="hidden" name="action" value="ecwid_contact_us" />
226
  <input type="hidden" name="wp-nonce" id="wp-nonce" value="<?php echo wp_create_nonce( Ecwid_Help_Page::CONTACT_US_ACTION_NAME ); ?>" />
227
- <input id="email_subject" maxlength="100" name="email[subject]" type="text" class="form-control" value="" placeholder="<?php _e( 'Subject', 'ecwid-shopping-cart' ); ?> ">
228
- <textarea id="email_body" name="email[body]" class="form-control" placeholder="<?php _e( 'Type in your message here', 'ecwid-shopping-cart' ); ?> "></textarea>
229
  <div class="btn-container">
230
  <button id="contact-ecwid-support" class="btn btn-medium btn-aqua" type="submit">
231
  <span class="btn-text"><?php _e( 'Send Message', 'ecwid-shopping-cart'); ?></span>
224
  <form action="admin-post.php" enctype="multipart/form-data" class="new_email" id="new_email" method="post" novalidate="novalidate">
225
  <input type="hidden" name="action" value="ecwid_contact_us" />
226
  <input type="hidden" name="wp-nonce" id="wp-nonce" value="<?php echo wp_create_nonce( Ecwid_Help_Page::CONTACT_US_ACTION_NAME ); ?>" />
227
+ <input id="email_subject" maxlength="100" name="email[subject]" type="text" class="form-control" value="<?php if ( @$_GET['contact_us_subject'] ) echo esc_attr__( stripslashes( $_GET['contact_us_subject'] ) ); ?>" placeholder="<?php _e( 'Subject', 'ecwid-shopping-cart' ); ?> ">
228
+ <textarea id="email_body" name="email[body]" class="form-control" placeholder="<?php _e( 'Type in your message here', 'ecwid-shopping-cart' ); ?> "><?php if ( @$_GET['contact_us_message'] ) echo htmlentities($_GET['contact_us_message']); ?></textarea>
229
  <div class="btn-container">
230
  <button id="contact-ecwid-support" class="btn btn-medium btn-aqua" type="submit">
231
  <span class="btn-text"><?php _e( 'Send Message', 'ecwid-shopping-cart'); ?></span>
templates/landing.php CHANGED
@@ -6,13 +6,13 @@
6
  <div class="ecwid-thank">
7
  <h1>
8
  <?php printf( __( 'Welcome to %s!', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
9
- <span><?php printf( __( 'Thank you for choosing %s to build your online store. The first step to sell successfully online is to setup your store! Let’s get started and add a store to your website in a few simple steps.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></span>
10
  </h1>
11
 
12
  <div class="ecwid-button">
13
 
14
  <button class="create-store-button btn btn-primary btn-large">
15
- <?php printf( __( 'Create Free %s', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
16
  </button>
17
  <button class="create-store-loading btn btn-primary btn-large btn-loading">
18
  <div class="loader">
@@ -47,7 +47,7 @@
47
  </div>
48
  <div class="create-store-have-account ecwid-button-description">
49
  <span class="create-store-have-account-question"><?php printf( __( 'Already have %s account?', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></span>
50
- <a class="create-store-have-account-link" href="admin-post.php?action=ec_connect"><?php _e('Connect your store to Wordpress site', 'ecwid-shopping-cart'); ?></a>
51
  </div>
52
  <div class="button-description-mobile">
53
  <?php printf( __( 'You will be asked to log in to your %s Control Panel<br />and give permissions to show your store on this site', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
@@ -64,7 +64,7 @@
64
  <div class="ecwid-description-inner">
65
  <div class="ecwid-description-image"><img src="<?php echo ECWID_PLUGIN_URL; ?>images/landing/ecwid-description-image.jpg"></div>
66
  <div class="ecwid-description-text">
67
- <h2><?php printf( __( 'Sell Everywhere<br>with your %s store', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></h2>
68
  <p><?php _e('Start selling on your WordPress site. Then mirror your shop on your Facebook page, blog and marketplaces like Google Shopping, Yahoo and Shopping.com.', 'ecwid-shopping-cart'); ?></p>
69
  <p><?php printf( __( 'Use %s\'s mobile-POS to swipe credit cards and sell on the go. Your orders and inventory are always synchronized with your online store.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></p>
70
  </div>
@@ -129,7 +129,7 @@
129
  </h2>
130
  <div class="ecwid-button">
131
  <button class="create-store-button btn btn-primary btn-large">
132
- <?php printf( __( 'Create Free %s', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
133
  </button>
134
  <button class="create-store-loading btn btn-primary btn-large btn-loading">
135
  <div class="loader">
6
  <div class="ecwid-thank">
7
  <h1>
8
  <?php printf( __( 'Welcome to %s!', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
9
+ <span><?php printf( __( 'Thank you for choosing %s to build your online store. The first step to sell successfully online is to set up your store! Let’s get started and add a store to your website in a few simple steps.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></span>
10
  </h1>
11
 
12
  <div class="ecwid-button">
13
 
14
  <button class="create-store-button btn btn-primary btn-large">
15
+ <?php _e( 'Create Store', 'ecwid-shopping-cart' ); ?>
16
  </button>
17
  <button class="create-store-loading btn btn-primary btn-large btn-loading">
18
  <div class="loader">
47
  </div>
48
  <div class="create-store-have-account ecwid-button-description">
49
  <span class="create-store-have-account-question"><?php printf( __( 'Already have %s account?', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></span>
50
+ <a class="create-store-have-account-link" href="admin-post.php?action=ec_connect"><?php _e('Connect your store to this site', 'ecwid-shopping-cart'); ?></a>
51
  </div>
52
  <div class="button-description-mobile">
53
  <?php printf( __( 'You will be asked to log in to your %s Control Panel<br />and give permissions to show your store on this site', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?>
64
  <div class="ecwid-description-inner">
65
  <div class="ecwid-description-image"><img src="<?php echo ECWID_PLUGIN_URL; ?>images/landing/ecwid-description-image.jpg"></div>
66
  <div class="ecwid-description-text">
67
+ <h2><?php _e( 'Sell Everywhere', 'ecwid-shopping-cart'); ?></h2>
68
  <p><?php _e('Start selling on your WordPress site. Then mirror your shop on your Facebook page, blog and marketplaces like Google Shopping, Yahoo and Shopping.com.', 'ecwid-shopping-cart'); ?></p>
69
  <p><?php printf( __( 'Use %s\'s mobile-POS to swipe credit cards and sell on the go. Your orders and inventory are always synchronized with your online store.', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ); ?></p>
70
  </div>
129
  </h2>
130
  <div class="ecwid-button">
131
  <button class="create-store-button btn btn-primary btn-large">
132
+ <?php _e( 'Create Store', 'ecwid-shopping-cart'); ?>
133
  </button>
134
  <button class="create-store-loading btn btn-primary btn-large btn-loading">
135
  <div class="loader">
templates/popup/deactivate.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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']; ?>"></textarea>
17
+ </div>
18
+ <?php endif; ?>
19
+ </li>
20
+ <?php endforeach; ?>
21
+ </ul>
22
+
23
+ <div class="bottom-support-link">
24
+ <a href="#"><?php _e( 'Contact Support', 'ecwid-shopping-cart' ); ?></a>
25
+ </div>
templates/popup/footer.php ADDED
@@ -0,0 +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; ?>
templates/popup/header.php ADDED
@@ -0,0 +1 @@
 
1
+ <h3><?php echo $this->_get_header(); ?></h3>
templates/popup/popup.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="ecwid-popup <?php echo $this->_class; ?>">
2
+ <div class="ecwid-popup-window">
3
+ <div class="ecwid-popup-header">
4
+ <?php $this->_render_header(); ?>
5
+ </div>
6
+ <div class="ecwid-popup-body">
7
+ <?php $this->_render_body(); ?>
8
+ </div>
9
+ <div class="ecwid-popup-footer">
10
+ <?php $this->_render_footer(); ?>
11
+ </div>
12
+ </div>
13
+ </div>