Ecwid Ecommerce Shopping Cart - Version 4.0

Version Description

  • Built-in Full-featured Store Control Panel. You can now manage your store, add new products, track sales and more right in your Wordpress site admin backend. No redirects, no external dashboards, no extra login/password you now have a single place and single login to manage your site and your store. To make it even better, we added the Products and Sales shortcuts to your Wordpress admin menu feel free to use them to easily access your inventory and sales list.
  • New Drop-down Categories Menu. Noticed how Wordpress automatically updates your site menu adding your site pages to it? Ecwid now does it too: open "Appearance -> Menus" in your Wordpress control panel and add the "Store with Categories Menu" item to your site menu. A drop-down menu containing your store categories will automatically appear on your site. It will keep the categories list up to date even if you often change your store categories. Rest assured your customers can easily quickly get to the category of products they are interested in right from the site menu.
  • More Store Menu Items for your site. In addition to the drop-down categories list, the new "Store" menus section under Appearance -> Menus provides "Search", "Cart" and "My Account" items. Add those quick links to your site for your customers to browse your store easier.
  • Updated SEO Titles and Meta Descriptions. Google recently launched a new crawling schema to better index rich AJAX sites and applications like Ecwid, which is a great news for all Ecwid users. We're keeping an eye on this and help Google improve indexing of all Ecwid stores. In this update, we made the product/categories page titles and descriptions change on the fly (with no page reload) so that Google will index them better. No action is required from your side we will continue improving how your store appears for Google to make sure your products and categories will get to the search results.
  • Bug Fixes and Improvements. As usual, we fine-tuned the plugin and fixed a few bugs. We wish you happy holidays and all the best in the New Year! Sincerely yours, Ecwid team.
Download this release

Release Info

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

Code changes from version 3.4.7 to 4.0

css/admin.css CHANGED
@@ -128,10 +128,10 @@ div.ecwid-message {
128
  .ecwid-message .ecwid-message-hide:before {
129
  content: "\e606";
130
  font-family: ecwid-icons;
131
- font-size: 26px;
132
  position: relative;
133
  left: 1px;
134
- top: 6px;
135
  }
136
 
137
  @media screen and (max-width: 768px) {
@@ -304,4 +304,100 @@ body[class*="_page_ecwid"] .ecwid-message {
304
 
305
  .ecwid-debug h2.hide:before {
306
  content: "[+]";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  }
128
  .ecwid-message .ecwid-message-hide:before {
129
  content: "\e606";
130
  font-family: ecwid-icons;
131
+ font-size: 16px;
132
  position: relative;
133
  left: 1px;
134
+ top: 3px;
135
  }
136
 
137
  @media screen and (max-width: 768px) {
304
 
305
  .ecwid-debug h2.hide:before {
306
  content: "[+]";
307
+ }
308
+
309
+ .ecwid-reconnect-allow-sso .main-wrap {
310
+ display: table;
311
+ width:100%;
312
+ max-width: 1000px;
313
+ }
314
+
315
+ .ecwid-reconnect-allow-sso .main-wrap .column {
316
+ display: table-cell;
317
+ width: 50%;
318
+ vertical-align: top;
319
+ padding-left: 5%;
320
+ text-align: left;
321
+ }
322
+
323
+ .ecwid-reconnect-allow-sso .main-wrap .column img {
324
+ width:100%;
325
+ max-width: 413px;
326
+ }
327
+
328
+
329
+ .ecwid-reconnect-allow-sso .main-wrap .column h4 {
330
+ font-size: 32px;
331
+ font-family: 'Open Sans';
332
+ line-height: normal;
333
+ margin-top: 1em;
334
+ font-weight: normal;
335
+ margin-bottom: 28px;
336
+ }
337
+
338
+ .ecwid-reconnect-allow-sso.ecwid-connect .box .connect-button a {
339
+ text-align: center;
340
+ white-space: nowrap;
341
+ width:auto;
342
+ }
343
+
344
+ .ecwid-reconnect-allow-sso.ecwid-connect .box .note {
345
+ font-size: 16px;
346
+ line-height: 1.50em;
347
+ color: #444;
348
+ margin-bottom: 40px;
349
+ }
350
+
351
+ .ecwid-admin-superwrap.has-wp-message {
352
+ margin-top: 25px;
353
+ }
354
+
355
+ /* Remove left padding for integrated admin */
356
+ .ecwid-admin-superwrap {
357
+ position:relative;
358
+ height: 600px;
359
+ }
360
+
361
+ .ecwid-admin-superwrap #wrap {
362
+ position:absolute;
363
+ left:-20px;
364
+ right: 0px;
365
+ height: 600px;
366
+ background: white;
367
+ }
368
+ /* ---------------------- */
369
+
370
+ @media screen and (max-width:1023px) {
371
+ .ecwid-reconnect-allow-sso .main-wrap .column h4 {
372
+ font-size: 28px;
373
+ }
374
+
375
+ .ecwid-reconnect-allow-sso .main-wrap .note {
376
+ font-size: 14px;
377
+ }
378
+
379
+ .ecwid-connect.ecwid-reconnect-allow-sso .main-wrap .connect-button a {
380
+ font-size: 16px;
381
+ }
382
+ }
383
+
384
+ @media screen and (max-width:767px) {
385
+ .ecwid-reconnect-allow-sso .main-wrap .column {
386
+ display: block;
387
+ width: 100%;
388
+ text-align: center;
389
+ padding-left: inherit;
390
+ }
391
+
392
+ .ecwid-reconnect-allow-sso .main-wrap .column p {
393
+ display: inline-block;
394
+ }
395
+
396
+ .ecwid-reconnect-allow-sso .main-wrap .column h4 {
397
+ margin-bottom: 14px;
398
+ }
399
+
400
+ .ecwid-reconnect-allow-sso.ecwid-connect .box .note {
401
+ margin-bottom: 20px;
402
+ }
403
  }
css/nav-menu.css ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #update-nav-menu ul.menu li.menu-item.ecwid-link .field-url
2
+ {
3
+ display: none;
4
+ }
5
+
6
+ #update-nav-menu ul.menu li.menu-item.ecwid-link .ecwid-reset-categories-cache {
7
+ padding: 1px 2px;
8
+ margin: 6px 0;
9
+ line-height: 15px;
10
+ text-decoration: none;
11
+ border-bottom: 1px solid #0073aa;
12
+ }
13
+
14
+ #update-nav-menu ul.menu li.menu-item.ecwid-link .ecwid-reset-categories-cache-updated {
15
+ display: none;
16
+ padding: 1px 2px;
17
+ margin: 6px 0;
18
+ line-height: 15px;
19
+ text-decoration: none;
20
+ cursor: default;
21
+ color: #62ae29;
22
+ position: relative;
23
+ left: 20px;
24
+ }
25
+ #update-nav-menu ul.menu li.menu-item.ecwid-link .ecwid-reset-categories-cache-updated:before {
26
+ content: "\f147";
27
+ font: 20px 'dashicons';
28
+ position: absolute;
29
+ top: 6px;
30
+ left: -20px;
31
+ line-height: 10px;
32
+ }
33
+
34
+ #update-nav-menu ul.menu li.menu-item.ecwid-link .ecwid-reset-categories-cache.cache-cleared:not(:hover) {
35
+ color: #999;
36
+ border-bottom-color:#999;
37
+ }
38
+
39
+ #update-nav-menu ul.menu li.menu-item.ecwid-link .ecwid-reset-categories-cache.cache-cleared:hover {
40
+ color:#666;
41
+ border-bottom-color:#666;
42
+ }
43
+
44
+ #update-nav-menu .ecwid-store-with-cats-message {
45
+ float: left;
46
+ font-style: italic;
47
+ color: #666;
48
+ margin-bottom: 5px;
49
+ }
50
+
51
+ #update-nav-menu .ecwid-store-with-cats-reset-cache {
52
+ float: left;
53
+ margin-top: 0px;
54
+ }
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: 3.4.7
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
@@ -13,7 +13,6 @@ register_activation_hook( __FILE__, 'ecwid_store_activate' );
13
  register_deactivation_hook( __FILE__, 'ecwid_store_deactivate' );
14
  register_uninstall_hook( __FILE__, 'ecwid_uninstall' );
15
 
16
-
17
  define("APP_ECWID_COM", 'app.ecwid.com');
18
  define("ECWID_DEMO_STORE_ID", 1003);
19
 
@@ -36,18 +35,24 @@ add_shortcode('ecwid', 'ecwid_shortcode');
36
  add_action( 'plugins_loaded', 'ecwid_init_integrations' );
37
  add_filter('plugins_loaded', 'ecwid_load_textdomain');
38
 
 
 
 
 
39
  if ( is_admin() ){
40
  add_action('admin_init', 'ecwid_settings_api_init');
41
  add_action('admin_init', 'ecwid_check_version');
42
  add_action('admin_init', 'ecwid_process_oauth_params');
 
43
  add_action('admin_notices', 'ecwid_show_admin_messages');
44
- add_action('admin_menu', 'ecwid_options_add_page');
45
  add_action('wp_dashboard_setup', 'ecwid_add_dashboard_widgets' );
46
  add_action('admin_enqueue_scripts', 'ecwid_common_admin_scripts');
47
  add_action('admin_enqueue_scripts', 'ecwid_register_admin_styles');
48
  add_action('admin_enqueue_scripts', 'ecwid_register_settings_styles');
49
  add_action('wp_ajax_ecwid_hide_vote_message', 'ecwid_hide_vote_message');
50
  add_action('wp_ajax_ecwid_hide_message', 'ecwid_ajax_hide_message');
 
51
  add_filter('plugin_action_links_ecwid-shopping-cart/ecwid-shopping-cart.php', 'ecwid_plugin_actions');
52
  add_action('admin_head', 'ecwid_ie8_fonts_inclusion');
53
  add_action('admin_head', 'ecwid_send_stats');
@@ -66,11 +71,12 @@ if ( is_admin() ){
66
  add_action('send_headers', 'ecwid_503_on_store_closed');
67
  add_action('template_redirect', 'ecwid_404_on_broken_escaped_fragment');
68
  add_action('template_redirect', 'ecwid_apply_theme');
69
- add_action('wp_enqueue_scripts', 'ecwid_add_frontend_styles');
70
  add_action('wp', 'ecwid_seo_ultimate_compatibility', 0);
71
  add_action('wp', 'ecwid_remove_default_canonical');
72
  add_filter('wp', 'ecwid_seo_compatibility_init', 0);
73
  add_filter('wp_title', 'ecwid_seo_title', 10000);
 
74
  add_action('plugins_loaded', 'ecwid_minifier_compatibility', 0);
75
  add_action('wp_head', 'ecwid_meta_description', 0);
76
  add_action('wp_head', 'ecwid_ajax_crawling_fragment');
@@ -95,6 +101,8 @@ require_once ECWID_PLUGIN_DIR . '/includes/themes.php';
95
  require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-message-manager.php';
96
  require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-store-editor.php';
97
  require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-oauth.php';
 
 
98
 
99
  function ecwid_init_integrations()
100
  {
@@ -256,13 +264,33 @@ add_action('wp_ajax_ecwid_get_product_info', 'ecwid_ajax_get_product_info' );
256
  add_action('wp_ajax_nopriv_ecwid_get_product_info', 'ecwid_ajax_get_product_info' );
257
 
258
 
259
- function ecwid_add_frontend_styles() {
260
 
261
- wp_register_script('ecwid-products-list-js', plugins_url('ecwid-shopping-cart/js/products-list.js'), array('jquery-ui-widget'));
 
262
  wp_register_style('ecwid-products-list-css', plugins_url('ecwid-shopping-cart/css/products-list.css'), array(), get_option('ecwid_plugin_version'));
263
  wp_enqueue_style('ecwid-css', plugins_url('ecwid-shopping-cart/css/frontend.css'),array(), get_option('ecwid_plugin_version'));
264
  wp_enqueue_style('ecwid-fonts-css', plugins_url('ecwid-shopping-cart/css/fonts.css'), array(), get_option('ecwid_plugin_version'));
265
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  if ((bool)get_option('ecwid_use_chameleon')) {
267
  wp_enqueue_script('ecwid-chameleon-js', 'https://dj925myfyz5v.cloudfront.net/widgets/chameleon/v1/ecwid-chameleon.js', array(), get_option('ecwid_plugin_version'), true);
268
 
@@ -655,16 +683,9 @@ TEXT;
655
  "id" => "ecwid-control-panel",
656
  "title" => __("Manage my store", 'ecwid-shopping-cart'),
657
  "parent" => "ecwid-main",
658
- 'href' => 'https://my.ecwid.com/cp/?source=wporg#t1=&t2=Dashboard'
659
  )
660
  );
661
- $wp_admin_bar->add_menu(array(
662
- "id" => "ecwid-settings",
663
- "title" => __("Manage plugin settings", 'ecwid-shopping-cart'),
664
- "parent" => "ecwid-main",
665
- 'href' => admin_url('admin.php?page=ecwid')
666
- )
667
- );
668
  $wp_admin_bar->add_menu(array(
669
  "id" => "ecwid-fb-app",
670
  "title" => __("→ Sell on Facebook", 'ecwid-shopping-cart'),
@@ -841,51 +862,97 @@ function ecwid_get_product_and_category($category_id, $product_id) {
841
 
842
  function ecwid_get_title_separator()
843
  {
 
 
 
 
 
 
844
  return apply_filters('ecwid_title_separator', '|');
845
  }
846
 
847
  function ecwid_seo_title($content) {
848
- if (isset($_GET['_escaped_fragment_']) && ecwid_is_api_enabled()) {
849
- $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
850
- $ecwid_seo_title = '';
851
 
852
- $separator = ecwid_get_title_separator();
 
 
853
 
854
- $api = ecwid_new_product_api();
 
855
 
856
- if (isset($params['mode']) && !empty($params['mode'])) {
857
- if ($params['mode'] == 'product') {
858
- if (isset($params['category']) && !empty($params['category'])){
859
- $ecwid_seo_title = ecwid_get_product_and_category($params['category'], $params['id']);
860
- } elseif (empty($params['category'])) {
861
- $ecwid_product = $api->get_product($params['id']);
862
- $ecwid_seo_title = $ecwid_product['name'];
863
- if(isset($ecwid_product['categories']) && is_array($ecwid_product['categories'])){
864
- foreach ($ecwid_product['categories'] as $ecwid_category){
865
- if ( $ecwid_category['defaultCategory'] == true ) {
866
- $ecwid_seo_title .= ' ' . $separator . ' ';
867
- $ecwid_seo_title .= $ecwid_category['name'];
868
- }
869
- }
870
- }
871
- }
872
- }
873
-
874
- elseif ($params['mode'] == 'category') {
875
- $api = ecwid_new_product_api();
876
- $ecwid_category = $api->get_category($params['id']);
877
- $ecwid_seo_title = $ecwid_category['name'];
878
- }
879
- }
880
 
881
- if (!empty($ecwid_seo_title))
882
- return "$ecwid_seo_title $separator $content";
883
- else
884
- return $content;
885
 
886
- } else {
887
- return $content;
888
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
889
  }
890
 
891
  function ecwid_add_credits($powered_by)
@@ -916,10 +983,10 @@ function ecwid_content_started($content)
916
 
917
  function ecwid_wrap_shortcode_content($content, $name, $attrs)
918
  {
919
- return "<!-- Ecwid shopping cart plugin v 3.4.7 --><!-- noptimize -->"
920
  . ecwid_get_scriptjs_code(@$attrs['lang'])
921
  . "<div class=\"ecwid-shopping-cart-$name\">$content</div>"
922
- . "<!-- /noptimize --><!-- END Ecwid Shopping Cart v 3.4.7 -->";
923
  }
924
 
925
  function ecwid_get_scriptjs_code($force_lang = null) {
@@ -966,7 +1033,7 @@ function ecwid_minicart_shortcode($attributes) {
966
 
967
  $layout = $params['layout'];
968
  if (!in_array($layout, array('', 'attachToCategories', 'floating', 'Mini', 'MiniAttachToProductBrowser'), true)) {
969
- $layout = 'attachToCategories';
970
  }
971
 
972
  if ($params['is_ecwid_shortcode']) {
@@ -1037,9 +1104,10 @@ function ecwid_categories_shortcode($attributes) {
1037
  if (!empty($ecwid_show_categories)) {
1038
  if (get_option('ecwid_use_new_horizontal_categories')) {
1039
  $store_id = get_ecwid_store_id();
 
1040
  $result = <<<HTML
1041
  <div id="horizontal-menu" data-storeid="$store_id"></div>
1042
- <script src="https://djqizrxa6f10j.cloudfront.net/horizontal-category-widget/v1.1/horizontal-widget.js"></script>
1043
  HTML;
1044
  } else {
1045
  $result = <<<EOT
@@ -1128,7 +1196,7 @@ function ecwid_shortcode($attributes)
1128
  'grid' => '3,3',
1129
  'list' => '10',
1130
  'table' => '20',
1131
- 'minicart_layout' => 'attachToCategories',
1132
  'default_category_id' => 0,
1133
  'lang' => ''
1134
  )
@@ -1323,7 +1391,7 @@ function ecwid_override_jsexclude($exclude)
1323
  function ecwid_store_activate() {
1324
  $my_post = array();
1325
  $content = <<<EOT
1326
- <!-- Ecwid code. Please do not remove this line otherwise your Ecwid shopping cart will not work properly. --> [ecwid widgets="productbrowser search" grid="3,3" list="10" table="20" default_category_id="0" category_view="grid" search_view="grid" minicart_layout="attachToCategories" ] <!-- Ecwid code end -->
1327
  EOT;
1328
  add_option("ecwid_store_page_id", '', '', 'yes');
1329
  add_option("ecwid_store_page_id_auto", '', '', 'yes');
@@ -1462,7 +1530,7 @@ function ecwid_abs_intval($value) {
1462
  return null;
1463
  }
1464
 
1465
- function ecwid_options_add_page() {
1466
 
1467
  $is_newbie = get_ecwid_store_id() == ECWID_DEMO_STORE_ID;
1468
 
@@ -1471,10 +1539,11 @@ function ecwid_options_add_page() {
1471
  __('Ecwid Store', 'ecwid-shopping-cart'),
1472
  'manage_options',
1473
  'ecwid',
1474
- 'ecwid_general_settings_do_page'
 
 
1475
  );
1476
 
1477
-
1478
  if ($is_newbie) {
1479
  $title = __('Setup', 'ecwid-shopping-cart');
1480
  } else {
@@ -1489,6 +1558,26 @@ function ecwid_options_add_page() {
1489
  'ecwid_general_settings_do_page'
1490
  );
1491
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1492
  if (get_option('ecwid_hide_appearance_menu') != 'Y') {
1493
  add_submenu_page(
1494
  'ecwid',
@@ -1514,6 +1603,179 @@ function ecwid_options_add_page() {
1514
  add_submenu_page('', 'Ecwid debug', '', 'manage_options', 'ecwid-debug', 'ecwid_debug_do_page');
1515
  }
1516
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1517
  function ecwid_register_admin_styles($hook_suffix) {
1518
 
1519
  wp_enqueue_style('ecwid-admin-css', plugins_url('ecwid-shopping-cart/css/admin.css'), array(), get_option('ecwid_plugin_version'));
@@ -1535,6 +1797,8 @@ function ecwid_register_admin_styles($hook_suffix) {
1535
  wp_enqueue_script('ecwid-connect-js', plugins_url('ecwid-shopping-cart/js/dashboard.js'), array(), get_option('ecwid_plugin_version'));
1536
  }
1537
  }
 
 
1538
  }
1539
 
1540
  function ecwid_register_settings_styles($hook_suffix) {
@@ -1601,6 +1865,30 @@ function ecwid_common_admin_scripts() {
1601
 
1602
  wp_enqueue_script('ecwid-admin-js', plugins_url('ecwid-shopping-cart/js/admin.js'), array(), get_option('ecwid_plugin_version'));
1603
  wp_enqueue_script('ecwid-modernizr-js', plugins_url('ecwid-shopping-cart/js/modernizr.js'), array(), get_option('ecwid_plugin_version'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1604
  }
1605
 
1606
  function ecwid_get_register_link()
@@ -1635,15 +1923,15 @@ function ecwid_get_register_link()
1635
 
1636
  function ecwid_general_settings_do_page() {
1637
 
1638
- $connection_error = isset($_GET['connection_error']);
1639
 
1640
- $no_oauth = isset($_GET['oauth']) && @$_GET['oauth'] == 'no';
1641
 
1642
- if (!$no_oauth) {
1643
- $last_check = get_option('ecwid_last_oauth_fail_time');
1644
 
1645
  // if something was not right last time
1646
- if ($last_check > 0) {
1647
  // then we consider it not working
1648
  $no_oauth = ecwid_test_oauth();
1649
  }
@@ -1651,7 +1939,10 @@ function ecwid_general_settings_do_page() {
1651
 
1652
  global $ecwid_oauth;
1653
 
1654
- if (get_option('ecwid_store_id') == ECWID_DEMO_STORE_ID && !$no_oauth) {
 
 
 
1655
 
1656
  $register = !$connection_error && !isset($_GET['connect']) && !@$_COOKIE['ecwid_create_store_clicked'];
1657
 
@@ -1671,7 +1962,8 @@ function ecwid_general_settings_do_page() {
1671
 
1672
  require_once ECWID_PLUGIN_DIR . '/templates/connect.php';
1673
  } else {
1674
- require_once ECWID_PLUGIN_DIR . '/templates/dashboard.php';
 
1675
  }
1676
  }
1677
 
@@ -2108,10 +2400,12 @@ class EcwidMinicartWidget extends WP_Widget {
2108
 
2109
  echo '<div>';
2110
 
 
2111
  echo ecwid_get_scriptjs_code();
2112
  echo ecwid_get_product_browser_url_script();
2113
  echo '<script data-cfasync="false" type="text/javascript"> xMinicart("style="); </script>';
2114
 
 
2115
  echo '</div>';
2116
 
2117
  echo $after_widget;
@@ -2152,11 +2446,13 @@ class EcwidMinicartMiniViewWidget extends WP_Widget {
2152
 
2153
 
2154
  echo '<div>';
 
2155
 
2156
  echo ecwid_get_scriptjs_code();
2157
  echo ecwid_get_product_browser_url_script();
2158
  echo '<script data-cfasync="false" type="text/javascript"> xMinicart("style=left:10px","layout=Mini"); </script>';
2159
 
 
2160
  echo '</div>';
2161
 
2162
  echo $after_widget;
@@ -2197,11 +2493,13 @@ class EcwidSearchWidget extends WP_Widget {
2197
  echo $before_title . $title . $after_title;
2198
 
2199
  echo '<div>';
 
2200
 
2201
  echo ecwid_get_scriptjs_code();
2202
  echo ecwid_get_product_browser_url_script();
2203
  echo '<script data-cfasync="false" type="text/javascript"> xSearchPanel("style="); </script>';
2204
 
 
2205
  echo '</div>';
2206
 
2207
  echo $after_widget;
@@ -2241,11 +2539,13 @@ class EcwidVCategoriesWidget extends WP_Widget {
2241
  echo $before_title . $title . $after_title;
2242
 
2243
  echo '<div>';
 
2244
 
2245
  echo ecwid_get_scriptjs_code();
2246
  echo ecwid_get_product_browser_url_script();
2247
  echo '<script data-cfasync="false" type="text/javascript"> xVCategories("style="); </script>';
2248
 
 
2249
  echo '</div>';
2250
 
2251
  echo $after_widget;
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: 4.0
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
13
  register_deactivation_hook( __FILE__, 'ecwid_store_deactivate' );
14
  register_uninstall_hook( __FILE__, 'ecwid_uninstall' );
15
 
 
16
  define("APP_ECWID_COM", 'app.ecwid.com');
17
  define("ECWID_DEMO_STORE_ID", 1003);
18
 
35
  add_action( 'plugins_loaded', 'ecwid_init_integrations' );
36
  add_filter('plugins_loaded', 'ecwid_load_textdomain');
37
 
38
+ add_action( 'wp_ajax_ecwid_ajax_seo_title', 'ecwid_ajax_seo_title' );
39
+ add_action( 'wp_ajax_nopriv_ecwid_ajax_seo_title', 'ecwid_ajax_seo_title' );
40
+ add_filter('wp_get_nav_menu_items', 'ecwid_nav_menu_items');
41
+
42
  if ( is_admin() ){
43
  add_action('admin_init', 'ecwid_settings_api_init');
44
  add_action('admin_init', 'ecwid_check_version');
45
  add_action('admin_init', 'ecwid_process_oauth_params');
46
+ add_filter( 'admin_init', 'ecwid_add_meta_boxes' );
47
  add_action('admin_notices', 'ecwid_show_admin_messages');
48
+ add_action('admin_menu', 'ecwid_build_menu');
49
  add_action('wp_dashboard_setup', 'ecwid_add_dashboard_widgets' );
50
  add_action('admin_enqueue_scripts', 'ecwid_common_admin_scripts');
51
  add_action('admin_enqueue_scripts', 'ecwid_register_admin_styles');
52
  add_action('admin_enqueue_scripts', 'ecwid_register_settings_styles');
53
  add_action('wp_ajax_ecwid_hide_vote_message', 'ecwid_hide_vote_message');
54
  add_action('wp_ajax_ecwid_hide_message', 'ecwid_ajax_hide_message');
55
+ add_action('wp_ajax_ecwid_reset_categories_cache', 'ecwid_reset_categories_cache');
56
  add_filter('plugin_action_links_ecwid-shopping-cart/ecwid-shopping-cart.php', 'ecwid_plugin_actions');
57
  add_action('admin_head', 'ecwid_ie8_fonts_inclusion');
58
  add_action('admin_head', 'ecwid_send_stats');
71
  add_action('send_headers', 'ecwid_503_on_store_closed');
72
  add_action('template_redirect', 'ecwid_404_on_broken_escaped_fragment');
73
  add_action('template_redirect', 'ecwid_apply_theme');
74
+ add_action('wp_enqueue_scripts', 'ecwid_enqueue_frontend');
75
  add_action('wp', 'ecwid_seo_ultimate_compatibility', 0);
76
  add_action('wp', 'ecwid_remove_default_canonical');
77
  add_filter('wp', 'ecwid_seo_compatibility_init', 0);
78
  add_filter('wp_title', 'ecwid_seo_title', 10000);
79
+ add_filter('document_title_parts', 'ecwid_seo_title_parts');
80
  add_action('plugins_loaded', 'ecwid_minifier_compatibility', 0);
81
  add_action('wp_head', 'ecwid_meta_description', 0);
82
  add_action('wp_head', 'ecwid_ajax_crawling_fragment');
101
  require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-message-manager.php';
102
  require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-store-editor.php';
103
  require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-oauth.php';
104
+ require_once ECWID_PLUGIN_DIR . '/lib/ecwid_platform.php';
105
+
106
 
107
  function ecwid_init_integrations()
108
  {
264
  add_action('wp_ajax_nopriv_ecwid_get_product_info', 'ecwid_ajax_get_product_info' );
265
 
266
 
267
+ function ecwid_enqueue_frontend() {
268
 
269
+ wp_enqueue_script('jquery-ui-widget');
270
+ wp_register_script('ecwid-products-list-js', plugins_url('ecwid-shopping-cart/js/products-list.js'), array('jquery-ui-widget'), get_option('ecwid_plugin_version'));
271
  wp_register_style('ecwid-products-list-css', plugins_url('ecwid-shopping-cart/css/products-list.css'), array(), get_option('ecwid_plugin_version'));
272
  wp_enqueue_style('ecwid-css', plugins_url('ecwid-shopping-cart/css/frontend.css'),array(), get_option('ecwid_plugin_version'));
273
  wp_enqueue_style('ecwid-fonts-css', plugins_url('ecwid-shopping-cart/css/fonts.css'), array(), get_option('ecwid_plugin_version'));
274
 
275
+ wp_enqueue_script('ecwid-frontend-js', plugins_url('ecwid-shopping-cart/js/frontend.js'), array('jquery'), get_option('ecwid_plugin_version'));
276
+
277
+ /*
278
+ global $ecwid_seo_title_mode;
279
+
280
+ $ecwid_seo_title_mode = 'none';
281
+ $original_title = wp_get_document_title();
282
+ $ecwid_seo_title_mode = 'placeholder';
283
+ $title_template = wp_get_document_title();
284
+ $ecwid_seo_title_mode = 'normal';
285
+
286
+ wp_localize_script('ecwid-frontend-js', 'ecwid_ajax_object', array(
287
+ 'ajax_url' => admin_url('admin-ajax.php'),
288
+ 'original_title' => $original_title,
289
+ 'title_template' => $title_template
290
+ )
291
+ );
292
+ */
293
+
294
  if ((bool)get_option('ecwid_use_chameleon')) {
295
  wp_enqueue_script('ecwid-chameleon-js', 'https://dj925myfyz5v.cloudfront.net/widgets/chameleon/v1/ecwid-chameleon.js', array(), get_option('ecwid_plugin_version'), true);
296
 
683
  "id" => "ecwid-control-panel",
684
  "title" => __("Manage my store", 'ecwid-shopping-cart'),
685
  "parent" => "ecwid-main",
686
+ 'href' => admin_url('admin.php?page=ecwid')
687
  )
688
  );
 
 
 
 
 
 
 
689
  $wp_admin_bar->add_menu(array(
690
  "id" => "ecwid-fb-app",
691
  "title" => __("→ Sell on Facebook", 'ecwid-shopping-cart'),
862
 
863
  function ecwid_get_title_separator()
864
  {
865
+ $sep = apply_filters('document_title_separator');
866
+
867
+ if (!empty($sep)) {
868
+ return $sep;
869
+ }
870
+
871
  return apply_filters('ecwid_title_separator', '|');
872
  }
873
 
874
  function ecwid_seo_title($content) {
 
 
 
875
 
876
+ $title = _ecwid_get_seo_title();
877
+ if (!empty($title)) {
878
+ $sep = ecwid_get_title_separator();
879
 
880
+ return "$title $sep $content";
881
+ }
882
 
883
+ return $content;
884
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
885
 
 
 
 
 
886
 
887
+ function ecwid_seo_title_parts($parts)
888
+ {
889
+ $title = _ecwid_get_seo_title();
890
+ if ($title) {
891
+ array_unshift($parts, $title);
892
+ }
893
+
894
+ return $parts;
895
+ }
896
+
897
+ function ecwid_ajax_seo_title()
898
+ {
899
+ $title = _ecwid_get_seo_title();
900
+ $template = $_GET['title_template'];
901
+
902
+ $result = str_replace('ECWID_SEO_TITLE', $title, $template);
903
+
904
+ echo $result;
905
+ wp_die();
906
+ }
907
+
908
+
909
+ function _ecwid_get_seo_title()
910
+ {
911
+ global $ecwid_seo_title_mode;
912
+
913
+ if ($ecwid_seo_title_mode == 'placeholder') {
914
+ return 'ECWID_SEO_TITLE';
915
+ } else if ($ecwid_seo_title_mode == 'none') {
916
+ return '';
917
+ }
918
+
919
+ if (!isset($_GET['_escaped_fragment_']) || !ecwid_is_api_enabled()) return;
920
+
921
+ $params = ecwid_parse_escaped_fragment( $_GET['_escaped_fragment_'] );
922
+ $ecwid_seo_title = '';
923
+
924
+ $separator = ecwid_get_title_separator();
925
+
926
+ $api = ecwid_new_product_api();
927
+
928
+ if ( isset( $params['mode'] ) && ! empty( $params['mode'] ) ) {
929
+ if ( $params['mode'] == 'product' ) {
930
+ if ( isset( $params['category'] ) && ! empty( $params['category'] ) ) {
931
+ $ecwid_seo_title = ecwid_get_product_and_category( $params['category'], $params['id'] );
932
+ } elseif ( empty( $params['category'] ) ) {
933
+ $ecwid_product = $api->get_product( $params['id'] );
934
+ $ecwid_seo_title = $ecwid_product['name'];
935
+ if ( isset( $ecwid_product['categories'] ) && is_array( $ecwid_product['categories'] ) ) {
936
+ foreach ( $ecwid_product['categories'] as $ecwid_category ) {
937
+ if ( $ecwid_category['defaultCategory'] == true ) {
938
+ $ecwid_seo_title .= ' ' . $separator . ' ';
939
+ $ecwid_seo_title .= $ecwid_category['name'];
940
+ }
941
+ }
942
+ }
943
+ }
944
+ } elseif ( $params['mode'] == 'category' ) {
945
+ $api = ecwid_new_product_api();
946
+ $ecwid_category = $api->get_category( $params['id'] );
947
+ $ecwid_seo_title = $ecwid_category['name'];
948
+ }
949
+ }
950
+
951
+ if ( ! empty( $ecwid_seo_title ) ) {
952
+ return $ecwid_seo_title;
953
+ }
954
+
955
+ return "";
956
  }
957
 
958
  function ecwid_add_credits($powered_by)
983
 
984
  function ecwid_wrap_shortcode_content($content, $name, $attrs)
985
  {
986
+ return "<!-- Ecwid shopping cart plugin v 4.0 --><!-- noptimize -->"
987
  . ecwid_get_scriptjs_code(@$attrs['lang'])
988
  . "<div class=\"ecwid-shopping-cart-$name\">$content</div>"
989
+ . "<!-- /noptimize --><!-- END Ecwid Shopping Cart v 4.0 -->";
990
  }
991
 
992
  function ecwid_get_scriptjs_code($force_lang = null) {
1033
 
1034
  $layout = $params['layout'];
1035
  if (!in_array($layout, array('', 'attachToCategories', 'floating', 'Mini', 'MiniAttachToProductBrowser'), true)) {
1036
+ $layout = 'MiniAttachToProductBrowser';
1037
  }
1038
 
1039
  if ($params['is_ecwid_shortcode']) {
1104
  if (!empty($ecwid_show_categories)) {
1105
  if (get_option('ecwid_use_new_horizontal_categories')) {
1106
  $store_id = get_ecwid_store_id();
1107
+ $ver = get_option('ecwid_plugin_version');
1108
  $result = <<<HTML
1109
  <div id="horizontal-menu" data-storeid="$store_id"></div>
1110
+ <script src="https://djqizrxa6f10j.cloudfront.net/horizontal-category-widget/v1.1/horizontal-widget.js?ver=$ver"></script>
1111
  HTML;
1112
  } else {
1113
  $result = <<<EOT
1196
  'grid' => '3,3',
1197
  'list' => '10',
1198
  'table' => '20',
1199
+ 'minicart_layout' => 'MiniAttachToProductBrowser',
1200
  'default_category_id' => 0,
1201
  'lang' => ''
1202
  )
1391
  function ecwid_store_activate() {
1392
  $my_post = array();
1393
  $content = <<<EOT
1394
+ [ecwid widgets="productbrowser minicart categories search" grid="3,3" list="10" table="20" default_category_id="0" category_view="grid" search_view="grid" minicart_layout="MiniAttachToProductBrowser" ]
1395
  EOT;
1396
  add_option("ecwid_store_page_id", '', '', 'yes');
1397
  add_option("ecwid_store_page_id_auto", '', '', 'yes');
1530
  return null;
1531
  }
1532
 
1533
+ function ecwid_build_menu() {
1534
 
1535
  $is_newbie = get_ecwid_store_id() == ECWID_DEMO_STORE_ID;
1536
 
1539
  __('Ecwid Store', 'ecwid-shopping-cart'),
1540
  'manage_options',
1541
  'ecwid',
1542
+ 'ecwid_general_settings_do_page',
1543
+ '',
1544
+ 2
1545
  );
1546
 
 
1547
  if ($is_newbie) {
1548
  $title = __('Setup', 'ecwid-shopping-cart');
1549
  } else {
1558
  'ecwid_general_settings_do_page'
1559
  );
1560
 
1561
+ if (!$is_newbie) {
1562
+ add_submenu_page(
1563
+ 'ecwid',
1564
+ __('Sales', 'ecwid-shopping-cart'),
1565
+ __('Sales', 'ecwid-shopping-cart'),
1566
+ 'manage_options',
1567
+ 'ecwid-admin-orders',
1568
+ 'ecwid_admin_orders_do_page'
1569
+ );
1570
+
1571
+
1572
+ add_submenu_page(
1573
+ 'ecwid',
1574
+ __('Products', 'ecwid-shopping-cart'),
1575
+ __('Products', 'ecwid-shopping-cart'),
1576
+ 'manage_options',
1577
+ 'ecwid-admin-products',
1578
+ 'ecwid_admin_products_do_page'
1579
+ );
1580
+ }
1581
  if (get_option('ecwid_hide_appearance_menu') != 'Y') {
1582
  add_submenu_page(
1583
  'ecwid',
1603
  add_submenu_page('', 'Ecwid debug', '', 'manage_options', 'ecwid-debug', 'ecwid_debug_do_page');
1604
  }
1605
 
1606
+ function ecwid_add_meta_boxes()
1607
+ {
1608
+ add_meta_box( 'ecwid_nav_links', __( 'Store', 'ecwid-shopping-cart' ), 'ecwid_nav_menu_links', 'nav-menus', 'normal' );
1609
+ }
1610
+
1611
+ function ecwid_nav_menu_items($items)
1612
+ {
1613
+
1614
+ if (is_admin()) {
1615
+ return $items;
1616
+ }
1617
+
1618
+ $categories = wp_cache_get('all_categories', 'ecwid');
1619
+
1620
+ if ( false == $categories ) {
1621
+ $callback = 'ecwidcatscallback';
1622
+ $result = EcwidPlatform::fetch_url('https://my.ecwid.com/categories.js?ownerid=' . get_ecwid_store_id() . '&callback=' . $callback);
1623
+ $result = $result['data'];
1624
+
1625
+ $prefix_length = strlen($callback . '(');
1626
+ $suffix_length = strlen(');');
1627
+ $result = substr($result, $prefix_length, strlen($result) - $suffix_length - $prefix_length - 1);
1628
+
1629
+ $categories = json_decode($result);
1630
+
1631
+ $result = wp_cache_set('all_categories', $categories, 'ecwid', time() + 60 * 60 * 12);
1632
+ }
1633
+
1634
+ $counter = 0;
1635
+ foreach ($items as $key => $item) {
1636
+
1637
+ $items[$key]->menu_order += $counter;
1638
+
1639
+ if (in_array('ecwid-store-with-categories', $item->classes)) {
1640
+ foreach ($categories as $category) {
1641
+ $counter ++;
1642
+ $post = new stdClass;
1643
+ $post->ID = 0;
1644
+ $post->post_author = '';
1645
+ $post->post_date = '';
1646
+ $post->post_date_gmt = '';
1647
+ $post->post_password = '';
1648
+ $post->post_name = '';
1649
+ $post->post_type = $item->post_type;
1650
+ $post->post_status = 'publish';
1651
+ $post->to_ping = '';
1652
+ $post->pinged = '';
1653
+ $post->post_parent = 0;
1654
+ $post->menu_order = $item->menu_order + $counter;
1655
+ $post->menu_item_parent = $item->ID;
1656
+ $post->url = ecwid_get_store_page_url() . $category->link;
1657
+ $post->classes = '';
1658
+ $post->type = 'post';
1659
+ $post->db_id = 0;
1660
+ $post->title = $category->name;
1661
+ $post->object = '';
1662
+ $post->object_id = 0;
1663
+ array_splice($items, $key + $counter, 0, array($post));
1664
+ }
1665
+ $counter++;
1666
+ }
1667
+ }
1668
+ return $items;
1669
+ }
1670
+
1671
+ function ecwid_reset_categories_cache()
1672
+ {
1673
+ wp_cache_delete('all_categories', 'ecwid');
1674
+ }
1675
+
1676
+ function ecwid_nav_menu_links()
1677
+ {
1678
+ $menu_links = array(
1679
+ 'Cart' => array(
1680
+ 'list-name' => __( 'Cart', 'ecwid-shopping-cart' ),
1681
+ 'classes' => 'ecwid-cart',
1682
+ 'url' => 'cart',
1683
+ 'label' => __('Shopping cart', 'ecwid-shopping-cart')
1684
+ ), 'Search' => array(
1685
+ 'list-name' => __( 'Product Search', 'ecwid-shopping-cart' ),
1686
+ 'classes' => 'ecwid-product-search',
1687
+ 'url' => 'search',
1688
+ 'label' => __('Product Search', 'ecwid-shopping-cart')
1689
+ ), 'Account' => array(
1690
+ 'list-name' => __( 'My Account' , 'ecwid-shopping-cart' ),
1691
+ 'classes' => 'ecwid-my-account',
1692
+ 'url' => 'accountSettings',
1693
+ 'label' => __('My Account', 'ecwid-shopping-cart')
1694
+ ), 'Store' => array(
1695
+ 'list-name' => __( 'Store' , 'ecwid-shopping-cart' ),
1696
+ 'classes' => 'ecwid-store',
1697
+ 'url' => '',
1698
+ 'label' => __('Store', 'ecwid-shopping-cart')
1699
+ ), 'Store with categories' => array(
1700
+ 'list-name' => __( 'Store with Categories Menu' , 'ecwid-shopping-cart' ),
1701
+ 'classes' => 'ecwid-store-with-categories',
1702
+ 'url' => '',
1703
+ 'label' => __('Store', 'ecwid-shopping-cart')
1704
+ )
1705
+ );
1706
+ ?>
1707
+ <div id="posttype-ecwid-links" class="posttypediv">
1708
+ <div id="tabs-panel-ecwid-links" class="tabs-panel tabs-panel-active">
1709
+ <ul id="ecwid-links-checklist" class="categorychecklist form-no-clear">
1710
+ <?php
1711
+ $i = -1;
1712
+ foreach ( $menu_links as $key => $value ) {
1713
+ ?>
1714
+ <li>
1715
+ <label class="menu-item-title">
1716
+ <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']; ?>
1717
+ </label>
1718
+ <input type="hidden" class="menu-item-type" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-type]" value="custom" />
1719
+ <input type="hidden" class="menu-item-title" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-title]" value="<?php echo esc_html(isset($value['label']) ? $value['label'] : $key ); ?>" />
1720
+ <input type="hidden" class="menu-item-url" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-url]" value="<?php echo esc_url( ecwid_get_store_page_url() . '#!/~/' . $value['url']); ?>" />
1721
+ <input type="hidden" class="menu-item-classes" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-classes]" value="<?php echo $value['classes']; ?>" />
1722
+ </li>
1723
+ <?php
1724
+ $i --;
1725
+ }
1726
+ ?>
1727
+ </ul>
1728
+ </div>
1729
+ <p class="button-controls">
1730
+ <span class="list-controls">
1731
+ <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>
1732
+ </span>
1733
+ <span class="add-to-menu">
1734
+ <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">
1735
+ <span class="spinner"></span>
1736
+ </span>
1737
+ </p>
1738
+ </div>
1739
+ <?php
1740
+ }
1741
+
1742
+ function ecwid_admin_do_page( $page ) {
1743
+
1744
+ global $ecwid_oauth;
1745
+
1746
+ Ecwid_Message_Manager::reset_hidden_messages();
1747
+ if ($page == 'dashboard') {
1748
+ $show_reconnect = true;
1749
+ }
1750
+
1751
+ $time = time();
1752
+
1753
+ $iframe_src = sprintf(
1754
+ 'https://my.ecwid.com/api/v3/%s/sso?token=%s&timestamp=%s&signature=%s&place=%s&inline&lang=%s',
1755
+ get_ecwid_store_id(),
1756
+ $ecwid_oauth->get_oauth_token(),
1757
+ $time,
1758
+ hash('sha256', get_ecwid_store_id() . $ecwid_oauth->get_oauth_token(). $time . Ecwid_OAuth::OAUTH_CLIENT_SECRET),
1759
+ $page,
1760
+ substr(get_bloginfo('language'), 0, 2)
1761
+ );
1762
+
1763
+ $result = wp_remote_get($iframe_src);
1764
+ if ($result['response']['code'] != 200) {
1765
+ require_once ECWID_PLUGIN_DIR . 'templates/reconnect-sso.php';
1766
+ } else {
1767
+ require_once ECWID_PLUGIN_DIR . '/templates/ecwid-admin.php';
1768
+ }
1769
+ }
1770
+
1771
+ function ecwid_admin_products_do_page() {
1772
+ ecwid_admin_do_page('products');
1773
+ }
1774
+
1775
+ function ecwid_admin_orders_do_page() {
1776
+ ecwid_admin_do_page('orders');
1777
+ }
1778
+
1779
  function ecwid_register_admin_styles($hook_suffix) {
1780
 
1781
  wp_enqueue_style('ecwid-admin-css', plugins_url('ecwid-shopping-cart/css/admin.css'), array(), get_option('ecwid_plugin_version'));
1797
  wp_enqueue_script('ecwid-connect-js', plugins_url('ecwid-shopping-cart/js/dashboard.js'), array(), get_option('ecwid_plugin_version'));
1798
  }
1799
  }
1800
+
1801
+ wp_enqueue_style('ecwid-nav-menu', plugins_url('ecwid-shopping-cart/css/nav-menu.css'), array(), get_option('ecwid_plugin_version'));
1802
  }
1803
 
1804
  function ecwid_register_settings_styles($hook_suffix) {
1865
 
1866
  wp_enqueue_script('ecwid-admin-js', plugins_url('ecwid-shopping-cart/js/admin.js'), array(), get_option('ecwid_plugin_version'));
1867
  wp_enqueue_script('ecwid-modernizr-js', plugins_url('ecwid-shopping-cart/js/modernizr.js'), array(), get_option('ecwid_plugin_version'));
1868
+
1869
+ if (function_exists('get_current_screen') ) {
1870
+ $screen = get_current_screen();
1871
+
1872
+ if ($screen->base == 'nav-menus') {
1873
+ wp_enqueue_script('ecwid-admin-menu-js', plugins_url('ecwid-shopping-cart/js/nav-menu.js'), array(), get_option('ecwid_plugin_version'));
1874
+ wp_localize_script('ecwid-admin-menu-js', 'ecwid_l10n', array(
1875
+ 'store_page' => __('Store Page', 'ecwid-shopping-cart'),
1876
+ 'reset_cats_cache' => __('Refresh categories list', 'ecwid-shopping-cart'),
1877
+ 'cache_updated' => __('Done', 'ecwid-shopping-cart'),
1878
+ 'reset_cache_message' => __('The store top-level categories are automatically added to this drop-down menu', 'ecwid-shopping-cart')
1879
+ ));
1880
+ }
1881
+
1882
+ }
1883
+
1884
+ wp_localize_script('ecwid-admin-js', 'ecwid_l10n', array(
1885
+ 'dashboard' => __('Dashboard', 'ecwid-shopping-cart'),
1886
+ 'dashboard_url' => 'admin.php?page=ecwid',
1887
+ 'products' => __('Products', 'ecwid-shopping-cart'),
1888
+ 'products_url' => 'admin.php?page=ecwid-admin-products',
1889
+ 'orders' => __('Orders', 'ecwid-shopping-cart'),
1890
+ 'orders_url' => 'admin.php?page=ecwid-admin-orders'
1891
+ ));
1892
  }
1893
 
1894
  function ecwid_get_register_link()
1923
 
1924
  function ecwid_general_settings_do_page() {
1925
 
1926
+ $connection_error = isset( $_GET['connection_error'] );
1927
 
1928
+ $no_oauth = isset( $_GET['oauth'] ) && @$_GET['oauth'] == 'no';
1929
 
1930
+ if ( ! $no_oauth ) {
1931
+ $last_check = get_option( 'ecwid_last_oauth_fail_time' );
1932
 
1933
  // if something was not right last time
1934
+ if ( $last_check > 0 ) {
1935
  // then we consider it not working
1936
  $no_oauth = ecwid_test_oauth();
1937
  }
1939
 
1940
  global $ecwid_oauth;
1941
 
1942
+ if ( get_option( 'ecwid_store_id' ) != ECWID_DEMO_STORE_ID && ! $ecwid_oauth->has_scope( 'allow_sso' ) && !isset($_GET['connection_error']) ) {
1943
+ require_once ECWID_PLUGIN_DIR . '/templates/reconnect-sso.php';
1944
+
1945
+ } else if (get_option('ecwid_store_id') == ECWID_DEMO_STORE_ID && !$no_oauth) {
1946
 
1947
  $register = !$connection_error && !isset($_GET['connect']) && !@$_COOKIE['ecwid_create_store_clicked'];
1948
 
1962
 
1963
  require_once ECWID_PLUGIN_DIR . '/templates/connect.php';
1964
  } else {
1965
+
1966
+ ecwid_admin_do_page( 'dashboard' );
1967
  }
1968
  }
1969
 
2400
 
2401
  echo '<div>';
2402
 
2403
+ echo '<!-- noptimize -->';
2404
  echo ecwid_get_scriptjs_code();
2405
  echo ecwid_get_product_browser_url_script();
2406
  echo '<script data-cfasync="false" type="text/javascript"> xMinicart("style="); </script>';
2407
 
2408
+ echo '<!-- /noptimize -->';
2409
  echo '</div>';
2410
 
2411
  echo $after_widget;
2446
 
2447
 
2448
  echo '<div>';
2449
+ echo '<!-- noptimize -->';
2450
 
2451
  echo ecwid_get_scriptjs_code();
2452
  echo ecwid_get_product_browser_url_script();
2453
  echo '<script data-cfasync="false" type="text/javascript"> xMinicart("style=left:10px","layout=Mini"); </script>';
2454
 
2455
+ echo '<!-- /noptimize -->';
2456
  echo '</div>';
2457
 
2458
  echo $after_widget;
2493
  echo $before_title . $title . $after_title;
2494
 
2495
  echo '<div>';
2496
+ echo '<!-- noptimize -->';
2497
 
2498
  echo ecwid_get_scriptjs_code();
2499
  echo ecwid_get_product_browser_url_script();
2500
  echo '<script data-cfasync="false" type="text/javascript"> xSearchPanel("style="); </script>';
2501
 
2502
+ echo '<!-- /noptimize -->';
2503
  echo '</div>';
2504
 
2505
  echo $after_widget;
2539
  echo $before_title . $title . $after_title;
2540
 
2541
  echo '<div>';
2542
+ echo '<!-- noptimize -->';
2543
 
2544
  echo ecwid_get_scriptjs_code();
2545
  echo ecwid_get_product_browser_url_script();
2546
  echo '<script data-cfasync="false" type="text/javascript"> xVCategories("style="); </script>';
2547
 
2548
+ echo '<!-- /noptimize -->';
2549
  echo '</div>';
2550
 
2551
  echo $after_widget;
images/new-feature.png ADDED
Binary file
includes/class-ecwid-message-manager.php CHANGED
@@ -167,7 +167,7 @@ class Ecwid_Message_Manager
167
 
168
  'on_storeid_set' => array(
169
  'title' => __('Good job! Your store is set up and you\'re ready to sell.', 'ecwid-shopping-cart'),
170
- 'message' => __('Now you can fine-tune your store\'s appearance', 'ecwid-shopping-cart'),
171
  'primary_title' => __('Visit Storefront', 'ecwid-shopping-cart'),
172
  'primary_url' => '',
173
  'primary_blank' => true,
167
 
168
  'on_storeid_set' => array(
169
  'title' => __('Good job! Your store is set up and you\'re ready to sell.', 'ecwid-shopping-cart'),
170
+ 'message' => __('Use the dashboard below to add products, track sales and adjust settings in your store. We also created a store page on your site and now you can fine-tune the storefront appearance.', 'ecwid-shopping-cart'),
171
  'primary_title' => __('Visit Storefront', 'ecwid-shopping-cart'),
172
  'primary_url' => '',
173
  'primary_blank' => true,
includes/class-ecwid-oauth.php CHANGED
@@ -120,6 +120,7 @@ class Ecwid_OAuth {
120
  }
121
 
122
  update_option( 'ecwid_store_id', $result->store_id );
 
123
  $this->_init_crypt();
124
  $this->_save_token($result->access_token);
125
 
@@ -130,7 +131,13 @@ class Ecwid_OAuth {
130
  if ( isset( $this->state->return_url ) && !empty( $this->state->return_url ) ) {
131
  wp_redirect( admin_url( $this->state->return_url ) );
132
  } else {
133
- wp_redirect( 'admin.php?page=ecwid&settings-updated=true' );
 
 
 
 
 
 
134
  }
135
  exit;
136
  }
@@ -149,7 +156,7 @@ class Ecwid_OAuth {
149
  public function get_safe_scopes_array($scopes)
150
  {
151
  if (!isset($scopes) || empty($scopes)) {
152
- return array( 'read_store_profile', 'read_catalog' );
153
  }
154
 
155
  if (!empty($scopes)) {
@@ -165,6 +172,18 @@ class Ecwid_OAuth {
165
  return $scopes_array;
166
  }
167
 
 
 
 
 
 
 
 
 
 
 
 
 
168
 
169
  protected function trigger_auth_error($mode = 'default')
170
  {
@@ -209,7 +228,7 @@ class Ecwid_OAuth {
209
  }
210
 
211
  protected function _get_scope() {
212
- $default = array( 'read_store_profile', 'read_catalog' );
213
 
214
  $scopes = array();
215
  if ( $this->_is_reconnect() ) {
@@ -253,6 +272,28 @@ class Ecwid_OAuth {
253
  return $token;
254
  }
255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  public function _init_crypt() {
257
  $this->crypt->setIV( substr( md5( SECURE_AUTH_SALT . get_option('ecwid_store_id') ), 0, 16 ) );
258
  $this->crypt->setKey( SECURE_AUTH_KEY );
120
  }
121
 
122
  update_option( 'ecwid_store_id', $result->store_id );
123
+ update_option( 'ecwid_oauth_scope', $result->scope );
124
  $this->_init_crypt();
125
  $this->_save_token($result->access_token);
126
 
131
  if ( isset( $this->state->return_url ) && !empty( $this->state->return_url ) ) {
132
  wp_redirect( admin_url( $this->state->return_url ) );
133
  } else {
134
+ $url = '';
135
+ if ($reconnect) {
136
+ $url = 'admin.php?page=ecwid&setting-updated=true';
137
+ } else {
138
+ $url = 'admin.php?page=ecwid';
139
+ }
140
+ wp_redirect( $url );
141
  }
142
  exit;
143
  }
156
  public function get_safe_scopes_array($scopes)
157
  {
158
  if (!isset($scopes) || empty($scopes)) {
159
+ return $this->_get_default_scopes_array();
160
  }
161
 
162
  if (!empty($scopes)) {
172
  return $scopes_array;
173
  }
174
 
175
+ public function has_scope( $scope ) {
176
+ $stored_scope = get_option( 'ecwid_oauth_scope' );
177
+ if (empty($stored_scope)) {
178
+ $stored_scope = 'read_store_profile read_catalog';
179
+ }
180
+
181
+ return in_array( $scope, explode(' ', $stored_scope) );
182
+ }
183
+
184
+ protected function _get_default_scopes_array() {
185
+ return array( 'read_store_profile', 'read_catalog', 'allow_sso' );
186
+ }
187
 
188
  protected function trigger_auth_error($mode = 'default')
189
  {
228
  }
229
 
230
  protected function _get_scope() {
231
+ $default = $this->_get_default_scopes_array();
232
 
233
  $scopes = array();
234
  if ( $this->_is_reconnect() ) {
272
  return $token;
273
  }
274
 
275
+
276
+ public function get_sso_admin_link() {
277
+ $url = 'https://my.ecwid.com/api/v3/%s/sso?token=%s&timestamp=%s&signature=%s&inline=true';
278
+
279
+ $store_id = get_ecwid_store_id();
280
+
281
+ $token = $this->get_oauth_token();
282
+
283
+ $timestamp = time();
284
+ $signature = hash('sha256', $store_id . $token . $timestamp . self::OAUTH_CLIENT_SECRET);
285
+
286
+ $url = sprintf(
287
+ $url,
288
+ $store_id,
289
+ $token,
290
+ $timestamp,
291
+ $signature
292
+ );
293
+
294
+ return $url;
295
+ }
296
+
297
  public function _init_crypt() {
298
  $this->crypt->setIV( substr( md5( SECURE_AUTH_SALT . get_option('ecwid_store_id') ), 0, 16 ) );
299
  $this->crypt->setKey( SECURE_AUTH_KEY );
includes/class-ecwid-store-editor.php CHANGED
@@ -10,13 +10,17 @@ class Ecwid_Store_Editor {
10
 
11
  add_action( 'template_redirect', array( $this, 'get_store_svg' ) );
12
 
13
- if ( !in_array( $GLOBALS['pagenow'], array( 'post.php', 'post-new.php' ) ) ) return;
14
-
15
- $this->init();
16
  }
17
 
18
- protected function init()
19
  {
 
 
 
 
 
 
20
  add_filter( 'mce_external_plugins', array( $this, 'add_mce_plugin' ) );
21
  add_action( 'media_buttons_context', array( $this, 'add_editor_button' ) );
22
  add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts' ) );
10
 
11
  add_action( 'template_redirect', array( $this, 'get_store_svg' ) );
12
 
13
+ add_action( 'current_screen', array($this, 'init') );
 
 
14
  }
15
 
16
+ public function init()
17
  {
18
+ $current_screen = get_current_screen();
19
+
20
+ if ($current_screen->base != 'post') {
21
+ return;
22
+ }
23
+
24
  add_filter( 'mce_external_plugins', array( $this, 'add_mce_plugin' ) );
25
  add_action( 'media_buttons_context', array( $this, 'add_editor_button' ) );
26
  add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts' ) );
includes/themes.php CHANGED
@@ -49,7 +49,8 @@ function ecwid_apply_theme($theme_name = null)
49
  'twentysixteen',
50
  'mantra',
51
  'attitude',
52
- 'responsiveboat'
 
53
  );
54
 
55
 
49
  'twentysixteen',
50
  'mantra',
51
  'attitude',
52
+ 'responsiveboat',
53
+ 'central'
54
  );
55
 
56
 
includes/themes/class-ecwid-theme-central.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once ECWID_THEMES_DIR . '/class-ecwid-theme-base.php';
4
+
5
+ class Ecwid_Theme_Central extends Ecwid_Theme_Base
6
+ {
7
+ protected $name = 'Central';
8
+
9
+ protected $adjust_pb_scroll = true;
10
+
11
+ public function __construct()
12
+ {
13
+ parent::__construct();
14
+
15
+ add_filter('body_class', array( $this, 'body_class') );
16
+ }
17
+
18
+ public function body_class($classes) {
19
+ // Yeah, we have to to turn off these ajax click handling routines that break our links
20
+ if (ecwid_page_has_productbrowser()) {
21
+ $classes[] = 'woocommerce';
22
+ }
23
+
24
+ return $classes;
25
+ }
26
+
27
+ }
28
+
29
+ $ecwid_current_theme = new Ecwid_Theme_Central();
js/admin.js CHANGED
@@ -63,10 +63,48 @@
63
  });
64
 
65
  jQuery('#ecwid-connect-no-oauth').click(function() {
66
- debugger;
67
  if (jQuery('#ecwid-store-id').val()) {
68
  location.href = this.href + '&force_store_id=' + jQuery('#ecwid-store-id').val();
69
  }
70
  return false;
71
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  });
63
  });
64
 
65
  jQuery('#ecwid-connect-no-oauth').click(function() {
 
66
  if (jQuery('#ecwid-store-id').val()) {
67
  location.href = this.href + '&force_store_id=' + jQuery('#ecwid-store-id').val();
68
  }
69
  return false;
70
  });
71
+
72
+ var admin_pages = [
73
+ {
74
+ url: ecwid_l10n.dashboard_url,
75
+ title: ecwid_l10n.dashboard,
76
+ place: 'dashboard'
77
+ },
78
+ {
79
+ url: ecwid_l10n.products_url,
80
+ title: ecwid_l10n.products,
81
+ place: 'products'
82
+ },
83
+ {
84
+ url: ecwid_l10n.orders_url,
85
+ title: ecwid_l10n.orders,
86
+ place: 'orders'
87
+ },
88
+ ];
89
+
90
+ if (jQuery('#ecwid-frame').length > 0) {
91
+ if (jQuery('div.update-nag').length > 0) {
92
+ jQuery('#superwrap').addClass('has-wp-message');
93
+ }
94
+ for (var i = 0; i < admin_pages.length; i++) {
95
+ jQuery('li.toplevel_page_ecwid .wp-submenu a[href="' + admin_pages[i].url + '"]')
96
+ .data('ecwid-menu', admin_pages[i])
97
+ .click(function() {
98
+ var ecwidMenu = jQuery(this).data('ecwid-menu');
99
+ jQuery('.toplevel_page_ecwid *.current').removeClass('current');
100
+ jQuery(this).addClass('current').closest('li').addClass('current');
101
+ jQuery('#ecwid-frame')[0].contentWindow.postMessage(JSON.stringify({
102
+ ecwidAppNs: "ecwid-wp-plugin",
103
+ method: "openPage",
104
+ data: ecwidMenu.place
105
+ }), "*")
106
+ return false;
107
+ });
108
+ }
109
+ }
110
  });
js/frontend.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+
3
+ /*
4
+ if (typeof window.Ecwid != 'undefined') {
5
+ Ecwid.OnPageLoaded.add(function() {
6
+ jQuery.get(ecwid_ajax_object.ajax_url,
7
+ {'action': 'ecwid_ajax_seo_title', '_escaped_fragment_': window.location.hash, title_template: ecwid_ajax_object.title_template},
8
+ function(new_title) {
9
+ if (new_title == ecwid_ajax_object.title_template.replace('ECWID_SEO_TITLE', '')) {
10
+ new_title = ecwid_ajax_object.original_title;
11
+ }
12
+ jQuery('title').text(new_title);
13
+ }
14
+ );
15
+ });
16
+ }
17
+ */
18
+ })
js/nav-menu.js ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+ jQuery('ul.menu > li.menu-item').each(function(idx, el) {
3
+ processEcwidLinks(el);
4
+ });
5
+
6
+ jQuery('#ecwid_nav_links').insertAfter(jQuery('#add-page'));
7
+
8
+ jQuery('#menu-to-edit').on('DOMNodeInserted', function(e) {
9
+ if (!jQuery(e.srcElement).hasClass('menu-item')) return;
10
+ processEcwidLinks(e.srcElement);
11
+ });
12
+
13
+ function processEcwidLinks(element) {
14
+ if (!isEcwidLink(element)) return;
15
+
16
+ if (jQuery(element).hasClass('ecwid-link')) return;
17
+
18
+ jQuery(element).addClass('ecwid-link');
19
+ jQuery(element).find('.item-type').text(ecwid_l10n.store_page);
20
+
21
+ if (isStoreWithCategories(element)) {
22
+
23
+ var $message = jQuery('<p>')
24
+ .addClass('ecwid-store-with-cats-message')
25
+ .text(ecwid_l10n.reset_cache_message)
26
+ .insertAfter(jQuery('.field-move', element));
27
+
28
+ $target = jQuery('<p class="ecwid-store-with-cats-reset-cache">').insertAfter($message);
29
+
30
+ jQuery('<span>')
31
+ .text(ecwid_l10n.cache_updated)
32
+ .addClass('ecwid-reset-categories-cache-updated')
33
+ .appendTo($target);
34
+
35
+ jQuery('<a>')
36
+ .text(ecwid_l10n.reset_cats_cache)
37
+ .attr('href', 'javascript:void(0);')
38
+ .addClass('ecwid-reset-categories-cache')
39
+ .appendTo($target)
40
+ .click(function() {
41
+
42
+ var that = this;
43
+ jQuery(this).css('cursor', 'wait');
44
+ resetCache(function() {
45
+ jQuery(that).fadeOut(100, function() {
46
+ jQuery(that).prev('.ecwid-reset-categories-cache-updated').fadeIn(100, function() {
47
+ setTimeout(function () {
48
+ jQuery(that).prev('.ecwid-reset-categories-cache-updated').fadeOut(500, function () {
49
+ jQuery(that).fadeIn(500);
50
+ })
51
+ }, 4000);
52
+ });
53
+ });
54
+
55
+ jQuery(that).css('cursor', 'pointer');
56
+ });
57
+ });
58
+ }
59
+ }
60
+
61
+ function isEcwidLink(element) {
62
+
63
+ var ecwidClasses = ['ecwid-store', 'ecwid-cart', 'ecwid-my-account', 'ecwid-store-with-categories', 'ecwid-product-search'];
64
+ var classes = jQuery('.edit-menu-item-classes', element).val().split(' ');
65
+ for (var i = 0; i < classes.length; i++) {
66
+ if (ecwidClasses.indexOf(classes[i]) != -1) {
67
+ return true;
68
+ }
69
+ }
70
+
71
+ return false;
72
+ }
73
+
74
+ function isStoreWithCategories(element) {
75
+ var classes = jQuery('.edit-menu-item-classes', element).val().split(' ');
76
+ for (var i = 0; i < classes.length; i++) {
77
+ if (classes[i] == 'ecwid-store-with-categories') {
78
+ return true;
79
+ }
80
+ }
81
+
82
+ return false;
83
+ }
84
+
85
+ function resetCache(callback) {
86
+
87
+ jQuery.getJSON(
88
+ 'admin-ajax.php',
89
+ {
90
+ action: 'ecwid_reset_categories_cache'
91
+ },
92
+ callback
93
+ );
94
+
95
+ }
96
+
97
+
98
+ });
languages/ecwid-shopping-cart-ru_RU.mo CHANGED
Binary file
languages/ecwid-shopping-cart-ru_RU.po CHANGED
@@ -19,9 +19,6 @@ msgstr "Открыть страницу магазина"
19
  msgid "Manage my store"
20
  msgstr "Управлять магазином"
21
 
22
- msgid "Manage plugin settings"
23
- msgstr "Изменить настройки плагина"
24
-
25
  msgid "→ Sell on Facebook"
26
  msgstr "→ Начать продавать на Facebook"
27
 
@@ -85,6 +82,18 @@ msgstr "Корзина вашего магазина"
85
  msgid "Shopping Cart"
86
  msgstr "Корзина"
87
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  msgid "Adds a cart widget for customer to see the products they added to the cart."
89
  msgstr "Добавляет виджет корзины покупателя для быстрого доступа к добавленным товарам."
90
 
@@ -136,8 +145,8 @@ msgstr "Настроить магазин"
136
  msgid "Good job! Your store is set up and you're ready to sell."
137
  msgstr "Отлично! Магазин установлен и готов к продажам."
138
 
139
- msgid "Now you can fine-tune your store's appearance"
140
- msgstr "Теперь вы можете настроить внешний вид витрины"
141
 
142
  msgid "Visit Storefront"
143
  msgstr "Открыть витрину"
@@ -430,8 +439,8 @@ msgstr "New features available, reconnect to be in touch with our updates"
430
  msgid "Add store"
431
  msgstr "Add store"
432
 
433
- msgid "Store settings"
434
- msgstr "Настройки магазина"
435
 
436
  msgid "Choose widgets to show"
437
  msgstr "Виджеты витрины магазина"
@@ -454,8 +463,8 @@ msgstr "Кроме того, вы можете добавить отдельны
454
  msgid "Demo store"
455
  msgstr "Демонстрационный магазин"
456
 
457
- msgid "Ecwid plugin settings"
458
- msgstr "Настройки плагина"
459
 
460
  msgid "Your store will be shown here!"
461
  msgstr "Здесь будет отображаться ваш магазин."
@@ -494,4 +503,22 @@ msgid "Enable the new category menu"
494
  msgstr "Включить новое меню категорий"
495
 
496
  msgid "The new category menu looks better and is more mobile-friendly. If you haven't yet added category menu to your store page, you can do that in the <a %s>store page editor</a> (enable the \"Show categories\" option)"
497
- msgstr "Новое меню категорий лучше выглядит и отлично работает на мобильных устройствах. Если у вас на странице магазина пока нет меню категорий, добавьте его в <a %s>настройках страницы магазина</a> (включите виджет \"Категории\")."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  msgid "Manage my store"
20
  msgstr "Управлять магазином"
21
 
 
 
 
22
  msgid "→ Sell on Facebook"
23
  msgstr "→ Начать продавать на Facebook"
24
 
82
  msgid "Shopping Cart"
83
  msgstr "Корзина"
84
 
85
+ msgid "Cart"
86
+ msgstr "Корзина"
87
+
88
+ msgid "My Account"
89
+ msgstr "Профиль"
90
+
91
+ msgid "Store with Categories Menu"
92
+ msgstr "Магазин с меню категорий"
93
+
94
+ msgid "Store Page"
95
+ msgstr "Страница магазина"
96
+
97
  msgid "Adds a cart widget for customer to see the products they added to the cart."
98
  msgstr "Добавляет виджет корзины покупателя для быстрого доступа к добавленным товарам."
99
 
145
  msgid "Good job! Your store is set up and you're ready to sell."
146
  msgstr "Отлично! Магазин установлен и готов к продажам."
147
 
148
+ msgid "Use the dashboard below to add products, track sales and adjust settings in your store. We also created a store page on your site and now you can fine-tune the storefront appearance."
149
+ msgstr "На этой странице вы можете добавлять товары, следить за заказами и управлять настройками магазина. Мы создали страницу витрины магазина на сайте, и теперь вы можете посмотреть витрину и настроить её внешний вид. "
150
 
151
  msgid "Visit Storefront"
152
  msgstr "Открыть витрину"
439
  msgid "Add store"
440
  msgstr "Add store"
441
 
442
+ msgid "Store elements"
443
+ msgstr "Витрина"
444
 
445
  msgid "Choose widgets to show"
446
  msgstr "Виджеты витрины магазина"
463
  msgid "Demo store"
464
  msgstr "Демонстрационный магазин"
465
 
466
+ msgid "Open store dashboard"
467
+ msgstr "Настройки магазина"
468
 
469
  msgid "Your store will be shown here!"
470
  msgstr "Здесь будет отображаться ваш магазин."
503
  msgstr "Включить новое меню категорий"
504
 
505
  msgid "The new category menu looks better and is more mobile-friendly. If you haven't yet added category menu to your store page, you can do that in the <a %s>store page editor</a> (enable the \"Show categories\" option)"
506
+ msgstr "Новое меню категорий лучше выглядит и отлично работает на мобильных устройствах. Если у вас на странице магазина пока нет меню категорий, добавьте его в <a %s>настройках страницы магазина</a> (включите виджет \"Категории\")."
507
+
508
+ msgid "Products"
509
+ msgstr "Товары"
510
+
511
+ msgid "Sales"
512
+ msgstr "Продажи"
513
+
514
+ msgid "If you want to connect another Ecwid store, you can re-connect on <a %s>this page</a>"
515
+ msgstr "Чтобы отвязать Эквид-аккаунт от сайта и подключить другой, воспользуйтесь <a %s>этой страницей<a>"
516
+
517
+ msgid "Your store Control Panel. Right here in WordPress."
518
+ msgstr "Панель управления магазином, встроенная в Wordpress."
519
+
520
+ msgid "Manage products, track sales, adjust settings - <nobr>All without</nobr> leaving this page."
521
+ msgstr "Вы сможете добавлять товары, обрабатывать заказы и управлять магазином прямо на этой странице."
522
+
523
+ msgid "Re-connect to Enable Control Panel"
524
+ msgstr "Подключить панель управления"
readme.txt CHANGED
@@ -107,6 +107,13 @@ http://codex.wordpress.org/Managing_Plugins#Installing_Plugins
107
  * [Ecwid site](http://www.ecwid.com/?source=wporg-plugin-site "Ecwid Site")
108
 
109
  == Changelog ==
 
 
 
 
 
 
 
110
  = 3.4.7 =
111
  - Fixed a few layout issues in three popular Wordpress themes: Responsive, Attitude, ResponsiveBoat.
112
  - Added a fix for the bug in WordPress editor, which corrupts the schema.org-formatted HTML codes. This should prevent the editor from corrupting Ecwid single products widget codes and other HTML snippets containing schema.org / microdata formatting.
107
  * [Ecwid site](http://www.ecwid.com/?source=wporg-plugin-site "Ecwid Site")
108
 
109
  == Changelog ==
110
+ = 4.0 =
111
+ - **Built-in Full-featured Store Control Panel.** You can now manage your store, add new products, track sales and more right in your Wordpress site admin backend. No redirects, no external dashboards, no extra login/password – you now have a single place and single login to manage your site and your store. To make it even better, we added the Products and Sales shortcuts to your Wordpress admin menu – feel free to use them to easily access your inventory and sales list.
112
+ - **New Drop-down Categories Menu.** Noticed how Wordpress automatically updates your site menu adding your site pages to it? Ecwid now does it too: open "Appearance -> Menus" in your Wordpress control panel and add the "Store with Categories Menu" item to your site menu. A drop-down menu containing your store categories will automatically appear on your site. It will keep the categories list up to date even if you often change your store categories. Rest assured your customers can easily quickly get to the category of products they are interested in right from the site menu.
113
+ - **More Store Menu Items for your site.** In addition to the drop-down categories list, the new "Store" menus section under Appearance -> Menus provides "Search", "Cart" and "My Account" items. Add those quick links to your site for your customers to browse your store easier.
114
+ - **Updated SEO Titles and Meta Descriptions.** Google recently launched a new crawling schema to better index rich AJAX sites and applications like Ecwid, which is a great news for all Ecwid users. We're keeping an eye on this and help Google improve indexing of all Ecwid stores. In this update, we made the product/categories page titles and descriptions change on the fly (with no page reload) so that Google will index them better. No action is required from your side – we will continue improving how your store appears for Google to make sure your products and categories will get to the search results.
115
+ - **Bug Fixes and Improvements.** As usual, we fine-tuned the plugin and fixed a few bugs. We wish you happy holidays and all the best in the New Year! Sincerely yours, Ecwid team.
116
+
117
  = 3.4.7 =
118
  - Fixed a few layout issues in three popular Wordpress themes: Responsive, Attitude, ResponsiveBoat.
119
  - Added a fix for the bug in WordPress editor, which corrupts the schema.org-formatted HTML codes. This should prevent the editor from corrupting Ecwid single products widget codes and other HTML snippets containing schema.org / microdata formatting.
templates/admin-footer.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php if (@$show_reconnect): ?>
2
+
3
+ <p><?php echo sprintf(__('If you want to connect another Ecwid store, you can re-connect on <a %s>this page</a>', 'ecwid-shopping-cart'), 'href=admin.php?page=ecwid&reconnect'); ?></p>
4
+
5
+ <?php endif; ?>
6
+
7
+ <p><?php echo sprintf(__('Questions? <a %s>Read FAQ</a> or contact support at <a %s>wordpress@ecwid.com</a>', 'ecwid-shopping-cart'), 'target="_blank" href="https://help.ecwid.com/customer/portal/articles/1085017-wordpress-downloadable#FAQ"', 'href="mailto:wordpress@ecwid.com"'); ?></p>
8
+
templates/connect.php CHANGED
@@ -48,5 +48,5 @@
48
  </a>
49
  </div>
50
  </div>
51
- <p><?php echo sprintf(__('Questions? <a %s>Read FAQ</a> or contact support at <a %s>wordpress@ecwid.com</a>', 'ecwid-shopping-cart'), 'target="_blank" href="https://help.ecwid.com/customer/portal/articles/1085017-wordpress-downloadable#FAQ"', 'href="mailto:wordpress@ecwid.com"'); ?></p>
52
  </div>
48
  </a>
49
  </div>
50
  </div>
51
+ <?php require_once ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
52
  </div>
templates/dashboard.php CHANGED
@@ -52,7 +52,7 @@
52
 
53
  </div>
54
  </div>
55
-
56
  </div>
57
- <p><?php echo sprintf(__('Questions? <a %s>Read FAQ</a> or contact support at <a %s>wordpress@ecwid.com</a>', 'ecwid-shopping-cart'), 'target="_blank" href="https://help.ecwid.com/customer/portal/articles/1085017-wordpress-downloadable#FAQ"', 'href="mailto:wordpress@ecwid.com"'); ?></p>
 
58
  </div>
52
 
53
  </div>
54
  </div>
 
55
  </div>
56
+
57
+ <?php require ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
58
  </div>
templates/ecwid-admin.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type='text/javascript'>//<![CDATA[
2
+ window.onload=function(){
3
+ $ = jQuery;
4
+ // Create IE + others compatible event handler
5
+ var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
6
+ var eventer = window[eventMethod];
7
+ var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
8
+
9
+ // Listen to message from child window
10
+ eventer(messageEvent,function(e) {
11
+ $('#ecwid-frame').css('height', e.data.height + 'px');
12
+ $('#superwrap').css('height', (e.data.height) + 'px');
13
+ },false);
14
+
15
+ $(document).ready(function(){
16
+ $('#ecwid-frame').attr('src', '<?php echo $iframe_src; ?>');
17
+ });
18
+
19
+ }//]]>
20
+
21
+ </script>
22
+
23
+ <div id="superwrap" class="ecwid-admin-superwrap">
24
+ <div id="wrap">
25
+ <iframe seamless id="ecwid-frame" frameborder="0" width="100%" height="700" scrolling="no"></iframe>
26
+ </div>
27
+ </div>
28
+
29
+ <?php require_once ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
templates/reconnect-sso.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap ecwid-admin ecwid-connect ecwid-reconnect-allow-sso">
2
+ <div class="box">
3
+ <div class="head"><?php ecwid_embed_svg('ecwid_logo_symbol_RGB');?>
4
+ <h3>
5
+ <?php _e( 'Ecwid Shopping Cart', 'ecwid-shopping-cart' ); ?>
6
+ </h3>
7
+ </div>
8
+
9
+ <div class="main-wrap">
10
+ <div class="column">
11
+ <h4><?php _e('Your store Control Panel. Right here in WordPress.', 'ecwid-shopping-cart'); ?></h4>
12
+ <p class="note"><?php _e('Manage products, track sales, adjust settings - <nobr>All without</nobr> leaving this page.', 'ecwid-shopping-cart'); ?></p>
13
+ <div class="connect-button">
14
+ <a href="admin-post.php?action=ecwid_connect&reconnect"><?php _e( 'Re-connect to Enable Control Panel', 'ecwid-shopping-cart' ); ?></a>
15
+ </div>
16
+ </div>
17
+
18
+ <div class="column">
19
+ <img src="<?php echo(esc_attr(ECWID_PLUGIN_URL)); ?>/images/new-feature.png" />
20
+ </div>
21
+ </div>
22
+
23
+ </div>
24
+ <?php require_once ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
25
+ </div>
templates/reconnect.php CHANGED
@@ -47,5 +47,5 @@
47
  </div>
48
  <?php endif; ?>
49
  </div>
50
- <p><?php echo sprintf(__('Questions? <a %s>Read FAQ</a> or contact support at <a %s>wordpress@ecwid.com</a>', 'ecwid-shopping-cart'), 'target="_blank" href="https://help.ecwid.com/customer/portal/articles/1085017-wordpress-downloadable#FAQ"', 'href="mailto:wordpress@ecwid.com"'); ?></p>
51
  </div>
47
  </div>
48
  <?php endif; ?>
49
  </div>
50
+ <?php require_once ECWID_PLUGIN_DIR . 'templates/admin-footer.php'; ?>
51
  </div>
templates/store-popup.php CHANGED
@@ -9,7 +9,7 @@
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 settings', 'ecwid-shopping-cart'); ?></a>
13
  <a href="#" class="media-menu-item" data-content="appearance"><?php _e('Appearance', 'ecwid-shopping-cart'); ?></a>
14
  </div>
15
  </div>
@@ -22,7 +22,7 @@
22
 
23
  <div class="media-frame-title store-settings">
24
  <h1>
25
- <?php _e('Store settings', 'ecwid-shopping-cart'); ?><span class="dashicons dashicons-arrow-down"></span>
26
  </h1>
27
  </div>
28
 
@@ -249,7 +249,7 @@
249
  <div class="store-id"><?php _e('Demo store', 'ecwid-shopping-cart'); ?></div>
250
  <?php endif; ?>
251
  <div class="setting-link">
252
- <a target="_blank" href="admin.php?page=ecwid"><?php _e('Ecwid plugin settings', 'ecwid-shopping-cart'); ?>
253
  </div>
254
  </div>
255
  <div class="media-toolbar-primary add-store">
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
  <a href="#" class="media-menu-item" data-content="appearance"><?php _e('Appearance', 'ecwid-shopping-cart'); ?></a>
14
  </div>
15
  </div>
22
 
23
  <div class="media-frame-title store-settings">
24
  <h1>
25
+ <?php _e('Store elements', 'ecwid-shopping-cart'); ?><span class="dashicons dashicons-arrow-down"></span>
26
  </h1>
27
  </div>
28
 
249
  <div class="store-id"><?php _e('Demo store', 'ecwid-shopping-cart'); ?></div>
250
  <?php endif; ?>
251
  <div class="setting-link">
252
+ <a target="_blank" href="admin.php?page=ecwid"><?php _e('Open store dashboard', 'ecwid-shopping-cart'); ?>
253
  </div>
254
  </div>
255
  <div class="media-toolbar-primary add-store">
templates/wp-dashboard-widget.php CHANGED
@@ -122,11 +122,9 @@
122
 
123
  function check_ads() {
124
  if (is_ad_loaded()) {
125
- debugger;
126
  jQuery('#ecwid_dashboard_widget div.inside > table').show();
127
  jQuery('#ecwid_dashboard_widget .ecwid-wp-dashboard-fallback').hide();
128
  } else {
129
- debugger;
130
  jQuery('#ecwid_dashboard_widget div.inside > table').hide();
131
  jQuery('#ecwid_dashboard_widget .ecwid-wp-dashboard-fallback').show();
132
  }
@@ -140,7 +138,6 @@
140
 
141
  setTimeout(function() {
142
  if (!is_ad_loaded()) {
143
- debugger;
144
  clearInterval(ecwid_wp_dashboard_interval);
145
  }
146
  }, 3000);
122
 
123
  function check_ads() {
124
  if (is_ad_loaded()) {
 
125
  jQuery('#ecwid_dashboard_widget div.inside > table').show();
126
  jQuery('#ecwid_dashboard_widget .ecwid-wp-dashboard-fallback').hide();
127
  } else {
 
128
  jQuery('#ecwid_dashboard_widget div.inside > table').hide();
129
  jQuery('#ecwid_dashboard_widget .ecwid-wp-dashboard-fallback').show();
130
  }
138
 
139
  setTimeout(function() {
140
  if (!is_ad_loaded()) {
 
141
  clearInterval(ecwid_wp_dashboard_interval);
142
  }
143
  }, 3000);