Ecwid Ecommerce Shopping Cart - Version 2.1

Version Description

  • Our plugin backend is now available in Italian, Russian and English. Thanks to Luciano Del Fico for the great help with the Italian translation.

  • Improvements and bug fixes, including

    • Better SEO for store pages: search engines will now index product options list and category descriptions
    • Compatibility with WP Minify (Wordpress sites optimization plugin)
    • Improved compatibility with Yoast WP SEO plugin: Ecwid SEO page titles are shown properly with enabled Yoast's "Force Rewrite Titles" option
    • Minor text and design tweaks of the plugin settings pages
Download this release

Release Info

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

Code changes from version 2.0 to 2.1

css/admin.css CHANGED
@@ -27,4 +27,13 @@
27
  padding-left: 43px;
28
  line-height: 32px;
29
  margin-bottom: 30px;
 
 
 
 
 
 
 
 
 
30
  }
27
  padding-left: 43px;
28
  line-height: 32px;
29
  margin-bottom: 30px;
30
+ }
31
+
32
+ #hide-vote-message {
33
+ text-decoration: underline;
34
+ cursor: pointer;
35
+ }
36
+
37
+ #hide-vote-message.hiding {
38
+ cursor: wait;
39
  }
ecwid-shopping-cart.php CHANGED
@@ -3,8 +3,9 @@
3
  Plugin Name: Ecwid Shopping Cart
4
  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
  Author: Ecwid Team
7
- Version: 2.0
8
  Author URI: http://www.ecwid.com?source=wporg
9
  */
10
 
@@ -24,11 +25,15 @@ if ( ! defined( 'ECWID_PLUGIN_URL' ) ) {
24
 
25
  if ( is_admin() ){
26
  add_action('admin_init', 'ecwid_settings_api_init');
27
- add_action('admin_notices', 'ecwid_show_admin_message');
28
  add_action('admin_menu', 'ecwid_options_add_page');
29
  add_action('wp_dashboard_setup', 'ecwid_add_dashboard_widgets' );
 
30
  add_action('admin_enqueue_scripts', 'ecwid_register_admin_styles');
31
  add_action('admin_enqueue_scripts', 'ecwid_register_settings_styles');
 
 
 
32
 
33
  } else {
34
  add_shortcode('ecwid_script', 'ecwid_script_shortcode');
@@ -37,12 +42,16 @@ if ( is_admin() ){
37
  add_shortcode('ecwid_categories', 'ecwid_categories_shortcode');
38
  add_shortcode('ecwid_productbrowser', 'ecwid_productbrowser_shortcode');
39
  add_action('init', 'ecwid_backward_compatibility');
 
 
 
40
  add_filter('wp_title', 'ecwid_seo_title', 20);
 
 
41
  add_action('wp_head', 'ecwid_ajax_crawling_fragment');
42
  add_action('wp_head', 'ecwid_meta');
43
- add_action('wp_title', 'ecwid_seo_compatibility_init', 0);
44
  add_action('wp_head', 'ecwid_seo_compatibility_restore', 1000);
45
- add_action('wp_head', 'ecwid_meta_description', 0);
46
  $ecwid_seo_title = '';
47
  }
48
  add_action('admin_bar_menu', 'add_ecwid_admin_bar_node', 1000);
@@ -82,12 +91,55 @@ if (version_compare($version, '3.6') < 0) {
82
 
83
  function ecwid_load_textdomain() {
84
  load_plugin_textdomain( 'ecwid-shopping-cart', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
 
85
  }
86
 
87
- add_filter( 'plugins_loaded', 'ecwid_load_textdomain' );
 
 
 
 
 
 
 
 
 
 
88
 
89
- function ecwid_backward_compatibility() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
 
 
 
 
 
 
 
91
  // Backward compatibility with 1.1.2 and earlier
92
  if (isset($_GET['ecwid_product_id']) || isset($_GET['ecwid_category_id'])) {
93
  $ecwid_page = get_option("ecwid_store_page_id");
@@ -104,6 +156,21 @@ function ecwid_backward_compatibility() {
104
  }
105
  }
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  function ecwid_override_option($name, $new_value = null)
108
  {
109
  static $overridden = array();
@@ -128,22 +195,31 @@ function ecwid_seo_compatibility_init($title)
128
  // Default wordpress canonical
129
  remove_action( 'wp_head','rel_canonical');
130
 
131
- // Canonical for Yoast Wordpress SEO
132
  global $wpseo_front;
 
133
  remove_action( 'wpseo_head', array( $wpseo_front, 'canonical' ), 20);
 
 
 
 
134
  remove_action( 'wpseo_head', array( $wpseo_front, 'metadesc' ), 10 );
135
 
136
- // Canonical for Platinum SEO Pack
 
137
  ecwid_override_option('psp_canonical', false);
138
- // Title for Platinum SEO Pack
139
  ecwid_override_option('aiosp_rewrite_titles', false);
140
 
 
141
  global $aioseop_options, $aiosp;
142
- // Canonical for All in One SEO Pack
143
  $aioseop_options['aiosp_can'] = false;
144
- // Title for All in One SEO Pack
145
- add_filter('aioseop_description', __return_null);
146
  add_filter('aioseop_title', __return_null);
 
 
 
147
 
148
  return $title;
149
 
@@ -276,6 +352,11 @@ function ecwid_meta_description() {
276
  HTML;
277
  }
278
 
 
 
 
 
 
279
  function ecwid_get_product_and_category($category_id, $product_id) {
280
  $params = array
281
  (
@@ -310,14 +391,11 @@ function ecwid_seo_title($content) {
310
 
311
  if (isset($params['mode']) && !empty($params['mode'])) {
312
  if ($params['mode'] == 'product') {
313
- $ecwid_product = $api->get_product($params['id']);
314
- $ecwid_seo_title = $ecwid_product['name'];
315
- if(isset($params['category']) && !empty($params['category'])){
316
- $ecwid_seo_title= ecwid_get_product_and_category($params['category'], $params['id']);
317
- }
318
- elseif(empty($params['category'])){
319
  $ecwid_product = $api->get_product($params['id']);
320
- $ecwid_seo_title .=$ecwid_product['name'];
321
  if(is_array($ecwid_product['categories'])){
322
  foreach ($ecwid_product['categories'] as $ecwid_category){
323
  if($ecwid_category['defaultCategory']==true){
@@ -326,8 +404,8 @@ function ecwid_seo_title($content) {
326
  }
327
  }
328
  }
 
329
  }
330
- }
331
 
332
  elseif ($params['mode'] == 'category'){
333
  $api = ecwid_new_product_api();
@@ -340,14 +418,31 @@ function ecwid_seo_title($content) {
340
  else
341
  return $content;
342
 
343
- } else {
344
- return $content;
345
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
  }
347
 
348
  function ecwid_wrap_shortcode_content($content)
349
  {
350
- return "<!-- Ecwid shopping cart plugin v 2.0 --><div>$content</div><!-- END Ecwid Shopping Cart v 2.0 -->";
351
  }
352
 
353
  function ecwid_get_scriptjs_code() {
@@ -469,29 +564,27 @@ function ecwid_productbrowser_shortcode($shortcode_params) {
469
  $ecwid_open_product = '';
470
  $plain_content = '';
471
 
472
- if (ecwid_is_api_enabled()) {
473
- if (isset($_GET['_escaped_fragment_'])) {
474
- $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
475
- include_once WP_PLUGIN_DIR . '/ecwid-shopping-cart/lib/ecwid_product_api.php';
476
- include_once WP_PLUGIN_DIR . '/ecwid-shopping-cart/lib/EcwidCatalog.php';
477
 
478
- $page_url = get_page_link();
479
 
480
- $catalog = new EcwidCatalog($store_id, $page_url);
481
 
482
- if (isset($params['mode']) && !empty($params['mode'])) {
483
- if ($params['mode'] == 'product') {
484
- $plain_content = $catalog->get_product($params['id']);
485
- $plain_content .= '<script type="text/javascript"> if (!document.location.hash) document.location.hash = "!/~/product/id='. intval($params['id']) .'";</script>';
486
- } elseif ($params['mode'] == 'category') {
487
- $plain_content = $catalog->get_category($params['id']);
488
- $ecwid_default_category_str = ',"defaultCategoryId=' . $params['id'] . '"';
489
- }
490
 
491
- } else {
492
- $plain_content = $catalog->get_category(intval($ecwid_default_category_id));
493
- }
494
- }
495
  } else {
496
  $plain_content = '<noscript>Your browser does not support JavaScript.<a href="' . $ecwid_mobile_catalog_link .'">HTML version of this store</a></noscript>';
497
  }
@@ -517,7 +610,6 @@ EOT;
517
  add_option("ecwid_show_categories", 'Y', '', 'yes');
518
  add_option("ecwid_show_search_box", '', '', 'yes');
519
 
520
-
521
  add_option("ecwid_pb_categoriesperrow", '3', '', 'yes');
522
 
523
  add_option("ecwid_pb_productspercolumn_grid", '3', '', 'yes');
@@ -533,9 +625,13 @@ EOT;
533
 
534
  add_option('ecwid_is_api_enabled', 'on', '', 'yes');
535
  add_option('ecwid_api_check_time', 0, '', 'yes');
536
-
 
 
537
  add_option("ecwid_sso_secret_key", '', '', 'yes');
538
-
 
 
539
  $id = get_option("ecwid_store_page_id");
540
  $_tmp_page = null;
541
  if (!empty($id) and ($id > 0)) {
@@ -558,22 +654,38 @@ EOT;
558
  }
559
 
560
  }
561
- function ecwid_show_admin_message() {
562
 
563
- if (get_ecwid_store_id() != ECWID_DEMO_STORE_ID || $_GET['page'] == 'ecwid') {
564
- return;
565
- } else {
566
  $ecwid_page_id = get_option("ecwid_store_page_id");
567
  $page_url = get_page_link($ecwid_page_id);
568
- echo sprintf(
569
- '<div class="updated fade"><p>'
570
- . __('<strong>Ecwid shopping cart is almost ready</strong>. Please visit <a target="_blank" href="%s">the created page</a> to see your store with demo products. In order to finish the installation, please go to the <a href="admin.php?page=ecwid"><strong>Ecwid settings</strong></a> and configure the plugin.', 'ecwid-shopping-cart')
571
- . '</p></div>',
572
  $page_url
573
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
574
  }
575
  }
576
 
 
 
 
 
 
577
  function ecwid_store_deactivate() {
578
  $ecwid_page_id = get_option("ecwid_store_page_id");
579
  $_tmp_page = null;
@@ -650,9 +762,19 @@ function ecwid_register_settings_styles() {
650
  wp_enqueue_style('ecwid-settings-css');
651
  }
652
 
 
 
 
 
 
 
 
 
 
653
 
654
  function ecwid_settings_api_init() {
655
- switch ($_POST['settings_section']) {
 
656
  case 'appearance':
657
  register_setting('ecwid_options_page', 'ecwid_enable_minicart');
658
 
@@ -684,6 +806,13 @@ function ecwid_settings_api_init() {
684
  }
685
  }
686
 
 
 
 
 
 
 
 
687
  function ecwid_general_settings_do_page() {
688
 
689
  if (get_ecwid_store_id() == ECWID_DEMO_STORE_ID) {
@@ -694,14 +823,8 @@ function ecwid_general_settings_do_page() {
694
  }
695
 
696
  function ecwid_advanced_settings_do_page() {
697
- wp_register_script('ecwid-appearance-js', plugins_url('ecwid-shopping-cart/js/advanced.js'), array(), '', '');
698
- wp_enqueue_script('ecwid-appearance-js');
699
-
700
- wp_register_script('select2-js', plugins_url('ecwid-shopping-cart/lib/select2/select2.js'), array(), '', '');
701
- wp_enqueue_script('select2-js');
702
-
703
- wp_register_style('select2-css', plugins_url('ecwid-shopping-cart/lib/select2/select2.css'), array(), '', 'all');
704
- wp_enqueue_style('select2-css');
705
 
706
  $categories = false;
707
  if (ecwid_is_paid_account()) {
@@ -1055,6 +1178,19 @@ function ecwid_hmacsha1($data, $key) {
1055
  }
1056
  }
1057
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1058
  function ecwid_is_paid_account()
1059
  {
1060
  return ecwid_is_api_enabled() && get_ecwid_store_id() != ECWID_DEMO_STORE_ID;
3
  Plugin Name: Ecwid Shopping Cart
4
  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: 2.1
9
  Author URI: http://www.ecwid.com?source=wporg
10
  */
11
 
25
 
26
  if ( is_admin() ){
27
  add_action('admin_init', 'ecwid_settings_api_init');
28
+ add_action('admin_notices', 'ecwid_show_admin_messages');
29
  add_action('admin_menu', 'ecwid_options_add_page');
30
  add_action('wp_dashboard_setup', 'ecwid_add_dashboard_widgets' );
31
+ add_action('admin_enqueue_scripts', 'ecwid_common_admin_scripts');
32
  add_action('admin_enqueue_scripts', 'ecwid_register_admin_styles');
33
  add_action('admin_enqueue_scripts', 'ecwid_register_settings_styles');
34
+ add_action('wp_ajax_ecwid_hide_vote_message', 'ecwid_hide_vote_message');
35
+ add_filter('plugins_loaded', 'ecwid_load_textdomain');
36
+ add_filter('plugin_action_links_ecwid-shopping-cart/ecwid-shopping-cart.php', 'ecwid_plugin_actions');
37
 
38
  } else {
39
  add_shortcode('ecwid_script', 'ecwid_script_shortcode');
42
  add_shortcode('ecwid_categories', 'ecwid_categories_shortcode');
43
  add_shortcode('ecwid_productbrowser', 'ecwid_productbrowser_shortcode');
44
  add_action('init', 'ecwid_backward_compatibility');
45
+ add_action('send_headers', 'ecwid_503_on_store_closed');
46
+ add_action('template_redirect', 'ecwid_404_on_broken_escaped_fragment');
47
+ add_action('wp_title', 'ecwid_seo_compatibility_init', 0);
48
  add_filter('wp_title', 'ecwid_seo_title', 20);
49
+ add_action('plugins_loaded', 'ecwid_minifier_compatibility', 0);
50
+ add_action('wp_head', 'ecwid_meta_description', 0);
51
  add_action('wp_head', 'ecwid_ajax_crawling_fragment');
52
  add_action('wp_head', 'ecwid_meta');
 
53
  add_action('wp_head', 'ecwid_seo_compatibility_restore', 1000);
54
+ add_filter( 'widget_meta_poweredby', 'ecwid_add_credits');
55
  $ecwid_seo_title = '';
56
  }
57
  add_action('admin_bar_menu', 'add_ecwid_admin_bar_node', 1000);
91
 
92
  function ecwid_load_textdomain() {
93
  load_plugin_textdomain( 'ecwid-shopping-cart', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
94
+
95
  }
96
 
97
+ function ecwid_404_on_broken_escaped_fragment() {
98
+ if (!ecwid_is_api_enabled()) {
99
+ return;
100
+ }
101
+
102
+ if (!isset($_GET['_escaped_fragment_'])) {
103
+ return;
104
+ }
105
+
106
+ $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
107
+ $api = ecwid_new_product_api();
108
 
109
+ if (isset($params['mode']) && !empty($params['mode']) && isset($params['id'])) {
110
+ $result = array();
111
+ if ($params['mode'] == 'product') {
112
+ $result = $api->get_product($params['id']);
113
+ } elseif ($params['mode'] == 'category') {
114
+ $result = $api->get_category($params['id']);
115
+ }
116
+ if (empty($result)) {
117
+ global $wp_query;
118
+
119
+ $wp_query->set_404();
120
+ }
121
+ }
122
+ }
123
+
124
+ function ecwid_503_on_store_closed() {
125
+ if (!ecwid_is_api_enabled()) {
126
+ return;
127
+ }
128
+
129
+ if (!isset($_GET['_escaped_fragment_'])) {
130
+ return;
131
+ }
132
+
133
+ $api = ecwid_new_product_api();
134
+ $profile = $api->get_profile();
135
 
136
+ if ($profile['closed']) {
137
+ header('HTTP/1.1 503 Service Temporarily Unavailable');
138
+ header('Status: 503 Service Temporarily Unavailable');
139
+ }
140
+ }
141
+
142
+ function ecwid_backward_compatibility() {
143
  // Backward compatibility with 1.1.2 and earlier
144
  if (isset($_GET['ecwid_product_id']) || isset($_GET['ecwid_category_id'])) {
145
  $ecwid_page = get_option("ecwid_store_page_id");
156
  }
157
  }
158
 
159
+ function ecwid_minifier_compatibility()
160
+ {
161
+ if ( !function_exists( 'get_plugins' ) ) { require_once ( ABSPATH . 'wp-admin/includes/plugin.php' ); }
162
+
163
+ $plugins = get_plugins();
164
+ $wp_minify_plugin = 'wp-minify/wp-minify.php';
165
+ if (array_key_exists($wp_minify_plugin, $plugins) && is_plugin_active($wp_minify_plugin)) {
166
+ global $wp_minify;
167
+
168
+ if (is_object($wp_minify) && array_key_exists('default_exclude', get_object_vars($wp_minify)) && is_array($wp_minify->default_exclude)) {
169
+ $wp_minify->default_exclude[] = 'ecwid.com/script.js';
170
+ }
171
+ }
172
+ }
173
+
174
  function ecwid_override_option($name, $new_value = null)
175
  {
176
  static $overridden = array();
195
  // Default wordpress canonical
196
  remove_action( 'wp_head','rel_canonical');
197
 
198
+ // Yoast Wordpress SEO
199
  global $wpseo_front;
200
+ // Canonical
201
  remove_action( 'wpseo_head', array( $wpseo_front, 'canonical' ), 20);
202
+ // Title
203
+ remove_action( 'get_header', array( $wpseo_front, 'force_rewrite_output_buffer' ) );
204
+ remove_action( 'wp_footer', array( $wpseo_front, 'flush_cache'));
205
+ // Description
206
  remove_action( 'wpseo_head', array( $wpseo_front, 'metadesc' ), 10 );
207
 
208
+ // Platinum SEO Pack
209
+ // Canonical
210
  ecwid_override_option('psp_canonical', false);
211
+ // Title
212
  ecwid_override_option('aiosp_rewrite_titles', false);
213
 
214
+ // All in one SEO Pack
215
  global $aioseop_options, $aiosp;
216
+ // Canonical
217
  $aioseop_options['aiosp_can'] = false;
218
+ // Title
 
219
  add_filter('aioseop_title', __return_null);
220
+ // Description
221
+ add_filter('aioseop_description', __return_null);
222
+
223
 
224
  return $title;
225
 
352
  HTML;
353
  }
354
 
355
+ function ecwid_hide_vote_message()
356
+ {
357
+ update_option('ecwid_show_vote_message', false);
358
+ }
359
+
360
  function ecwid_get_product_and_category($category_id, $product_id) {
361
  $params = array
362
  (
391
 
392
  if (isset($params['mode']) && !empty($params['mode'])) {
393
  if ($params['mode'] == 'product') {
394
+ if (isset($params['category']) && !empty($params['category'])){
395
+ $ecwid_seo_title = ecwid_get_product_and_category($params['category'], $params['id']);
396
+ } elseif (empty($params['category'])) {
 
 
 
397
  $ecwid_product = $api->get_product($params['id']);
398
+ $ecwid_seo_title = $ecwid_product['name'];
399
  if(is_array($ecwid_product['categories'])){
400
  foreach ($ecwid_product['categories'] as $ecwid_category){
401
  if($ecwid_category['defaultCategory']==true){
404
  }
405
  }
406
  }
407
+ }
408
  }
 
409
 
410
  elseif ($params['mode'] == 'category'){
411
  $api = ecwid_new_product_api();
418
  else
419
  return $content;
420
 
421
+ } else {
422
+ return $content;
423
+ }
424
+ }
425
+
426
+ function ecwid_add_credits($powered_by)
427
+ {
428
+ if (!ecwid_is_paid_account()) {
429
+
430
+ $new_powered_by = '<li>';
431
+ $new_powered_by .= sprintf(
432
+ __('Online store powered by <a %s>Ecwid</a>', 'ecwid-shopping-cart'),
433
+ 'target="_blank" href="//www.ecwid.com?source=wporg"'
434
+ );
435
+ $new_powered_by .= '</li>';
436
+
437
+ $powered_by .= $new_powered_by;
438
+ }
439
+
440
+ return $powered_by;
441
  }
442
 
443
  function ecwid_wrap_shortcode_content($content)
444
  {
445
+ return "<!-- Ecwid shopping cart plugin v 2.1 --><div>$content</div><!-- END Ecwid Shopping Cart v 2.1 -->";
446
  }
447
 
448
  function ecwid_get_scriptjs_code() {
564
  $ecwid_open_product = '';
565
  $plain_content = '';
566
 
567
+ if (ecwid_can_display_html_catalog()) {
568
+ $params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
569
+ include_once WP_PLUGIN_DIR . '/ecwid-shopping-cart/lib/ecwid_product_api.php';
570
+ include_once WP_PLUGIN_DIR . '/ecwid-shopping-cart/lib/EcwidCatalog.php';
 
571
 
572
+ $page_url = get_page_link();
573
 
574
+ $catalog = new EcwidCatalog($store_id, $page_url);
575
 
576
+ if (isset($params['mode']) && !empty($params['mode'])) {
577
+ if ($params['mode'] == 'product') {
578
+ $plain_content = $catalog->get_product($params['id']);
579
+ $plain_content .= '<script type="text/javascript"> if (!document.location.hash) document.location.hash = "!/~/product/id='. intval($params['id']) .'";</script>';
580
+ } elseif ($params['mode'] == 'category') {
581
+ $plain_content = $catalog->get_category($params['id']);
582
+ $ecwid_default_category_str = ',"defaultCategoryId=' . $params['id'] . '"';
583
+ }
584
 
585
+ } else {
586
+ $plain_content = $catalog->get_category(intval($ecwid_default_category_id));
587
+ }
 
588
  } else {
589
  $plain_content = '<noscript>Your browser does not support JavaScript.<a href="' . $ecwid_mobile_catalog_link .'">HTML version of this store</a></noscript>';
590
  }
610
  add_option("ecwid_show_categories", 'Y', '', 'yes');
611
  add_option("ecwid_show_search_box", '', '', 'yes');
612
 
 
613
  add_option("ecwid_pb_categoriesperrow", '3', '', 'yes');
614
 
615
  add_option("ecwid_pb_productspercolumn_grid", '3', '', 'yes');
625
 
626
  add_option('ecwid_is_api_enabled', 'on', '', 'yes');
627
  add_option('ecwid_api_check_time', 0, '', 'yes');
628
+
629
+ add_option('ecwid_show_vote_message', true);
630
+
631
  add_option("ecwid_sso_secret_key", '', '', 'yes');
632
+
633
+ add_option("ecwid_installation_date", time());
634
+
635
  $id = get_option("ecwid_store_page_id");
636
  $_tmp_page = null;
637
  if (!empty($id) and ($id > 0)) {
654
  }
655
 
656
  }
 
657
 
658
+ function ecwid_show_admin_messages() {
659
+ if (get_ecwid_store_id() == ECWID_DEMO_STORE_ID && $_GET['page'] != 'ecwid') {
660
+
661
  $ecwid_page_id = get_option("ecwid_store_page_id");
662
  $page_url = get_page_link($ecwid_page_id);
663
+
664
+ $message = sprintf(
665
+ __('<strong>Ecwid shopping cart is almost ready</strong>. Please visit <a target="_blank" href="%s">the created page</a> to see your store with demo products. In order to finish the installation, please go to the <a href="admin.php?page=ecwid"><strong>Ecwid settings</strong></a> and configure the plugin.', 'ecwid-shopping-cart'),
 
666
  $page_url
667
  );
668
+
669
+ ecwid_show_admin_message($message);
670
+ }
671
+ $install_date = get_option('ecwid_installation_date');
672
+ if (!$install_date) {
673
+ add_option('ecwid_installation_date', time());
674
+ } else if (ecwid_is_paid_account() && $install_date + 60*60*24*30 < time() && get_option('ecwid_show_vote_message')) {
675
+ $message = sprintf(
676
+ __('Do you like your Ecwid online store? We\'d appreciate it if you <a %s>add your review and vote</a> for the plugin on Wordpress site. (<a id="hide-vote-message">Close</a> and do not show this message anymore)', 'ecwid-shopping-cart'),
677
+ 'target="_blank" href="http://wordpress.org/support/view/plugin-reviews/ecwid-shopping-cart"'
678
+ );
679
+
680
+ ecwid_show_admin_message($message);
681
  }
682
  }
683
 
684
+ function ecwid_show_admin_message($message) {
685
+ $class = version_compare(get_bloginfo('version'), '3.0') < 0 ? "updated fade" : "update-nag";
686
+ echo sprintf('<div class="%s" style="margin-top: 5px">%s</div>', $class, $message);
687
+ }
688
+
689
  function ecwid_store_deactivate() {
690
  $ecwid_page_id = get_option("ecwid_store_page_id");
691
  $_tmp_page = null;
762
  wp_enqueue_style('ecwid-settings-css');
763
  }
764
 
765
+ function ecwid_plugin_actions($links) {
766
+ $settings_link = "<a href='admin.php?page=ecwid'>"
767
+ . (get_ecwid_store_id() == ECWID_DEMO_STORE_ID ? __('Setup', 'ecwid-shopping-cart') : __('Settings') )
768
+ . "</a>";
769
+ array_unshift( $links, $settings_link );
770
+
771
+ return $links;
772
+ }
773
+
774
 
775
  function ecwid_settings_api_init() {
776
+
777
+ if (isset($_POST['settings_section'])) switch ($_POST['settings_section']) {
778
  case 'appearance':
779
  register_setting('ecwid_options_page', 'ecwid_enable_minicart');
780
 
806
  }
807
  }
808
 
809
+ function ecwid_common_admin_scripts() {
810
+
811
+ wp_register_script('ecwid-admin-js', plugins_url('ecwid-shopping-cart/js/admin.js'), array(), '', '');
812
+ wp_enqueue_script('ecwid-admin-js');
813
+
814
+ }
815
+
816
  function ecwid_general_settings_do_page() {
817
 
818
  if (get_ecwid_store_id() == ECWID_DEMO_STORE_ID) {
823
  }
824
 
825
  function ecwid_advanced_settings_do_page() {
826
+ wp_register_script('ecwid-advanced-js', plugins_url('ecwid-shopping-cart/js/advanced.js'), array(), '', '');
827
+ wp_enqueue_script('ecwid-advanced-js');
 
 
 
 
 
 
828
 
829
  $categories = false;
830
  if (ecwid_is_paid_account()) {
1178
  }
1179
  }
1180
 
1181
+ function ecwid_can_display_html_catalog()
1182
+ {
1183
+ if (!isset($_GET['_escaped_fragment_'])) return;
1184
+
1185
+ $api = ecwid_new_product_api();
1186
+ if (!$api) return;
1187
+
1188
+ $profile = $api->get_profile();
1189
+ if (!$profile) return;
1190
+
1191
+ return $profile['closed'] != true;
1192
+ }
1193
+
1194
  function ecwid_is_paid_account()
1195
  {
1196
  return ecwid_is_api_enabled() && get_ecwid_store_id() != ECWID_DEMO_STORE_ID;
js/admin.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+ jQuery('#hide-vote-message').click(function() {
3
+ jQuery('#hide-vote-message').addClass('hiding');
4
+ jQuery.getJSON(
5
+ 'admin-ajax.php',
6
+ { action:'ecwid_hide_vote_message' },
7
+ function(data) {
8
+ jQuery('#hide-vote-message').removeClass('hiding')
9
+ .closest('div.update-nag, div.updated.fade').fadeOut();
10
+ }
11
+ );
12
+ });
13
+ });
languages/ecwid-shopping-cart-it_IT.mo ADDED
Binary file
languages/ecwid-shopping-cart-ru_RU.mo CHANGED
Binary file
languages/ecwid-shopping-cart-ru_RU.po ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was generated by Easy Translator Lite -- a WordPress plugin translator
2
+ # Your Name:
3
+ # Your Email: test@example.com
4
+ # Your Website: wordpress36
5
+ # Your URL: http://localhost/wordpress36
6
+ # Your Locale: ru_RU (MO: /languages/ecwid-shopping-cart-ru_RU.mo)
7
+ # Your Language: ru-RU
8
+ #, fuzzy
9
+ msgid ""
10
+ msgstr ""
11
+ "Project-Id-Version: Ecwid Shopping Cart\n"
12
+ "PO-Revision-Date: 2013-11-25 17:38:21\n"
13
+ "Last-Translator: <test@example.com>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+
18
+ msgid "Get help"
19
+ msgstr "Получить помощь"
20
+
21
+ msgid "Go to Ecwid site"
22
+ msgstr "Пройти на сайт Ecwid"
23
+
24
+ msgid "Visit storefront"
25
+ msgstr "Открыть страницу магазина"
26
+
27
+ msgid "Manage my store"
28
+ msgstr "Управлять магазином"
29
+
30
+ msgid "Manage plugin settings"
31
+ msgstr "Изменить настройки плагина"
32
+
33
+ msgid "→ Sell on Facebook"
34
+ msgstr "→ Начать продавать на Facebook"
35
+
36
+ msgid "Online store powered by <a %s>Ecwid</a>"
37
+ msgstr "Интернет магазин построен на <a %s>Ecwid</a>"
38
+
39
+ msgid "Store"
40
+ msgstr "Магазин"
41
+
42
+ msgid "<strong>Ecwid shopping cart is almost ready</strong>. Please visit <a target=\"_blank\" href=\"%s\">the created page</a> to see your store with demo products. In order to finish the installation, please go to the <a href=\"admin.php?page=ecwid\"><strong>Ecwid settings</strong></a> and configure the plugin."
43
+ msgstr "<strong>Магазин Ecwid почти готов к использованию</strong>. Пройдите по <a target=\"_blank\" href=\"%s\">ссылке</a>, чтобы посмотреть ваш магазин с демонстрационными продуктами. Чтобы закончить установку, пожалуйста, откройте страницу <a href=\"admin.php?page=ecwid\"><strong>настроек Ecwid</strong></a> и настройте плагин."
44
+
45
+ msgid "Do you like your Ecwid online store? We'd appreciate it if you <a %s>add your review and vote</a> for the plugin on Wordpress site. (<a id=\"hide-vote-message\">Close</a> and do not show this message anymore)"
46
+ msgstr "Вам нравится ваш магазин Ecwid? Будем благодарны, если вы <a %s>оставите отзыв и проголосуете</a> за этот плагин на сайте WordPress. (<a id=\"hide-vote-message\"> Закрыть</a> и больше не показывать это сообщение)"
47
+
48
+ msgid "Ecwid shopping cart settings"
49
+ msgstr "Настройки Ecwid"
50
+
51
+ msgid "Ecwid Store"
52
+ msgstr "Магазин Ecwid"
53
+
54
+ msgid "General settings"
55
+ msgstr "Основные настройки"
56
+
57
+ msgid "General"
58
+ msgstr "Основные"
59
+
60
+ msgid "Appearance settings"
61
+ msgstr "Настройки внешнего вида"
62
+
63
+ msgid "Appearance"
64
+ msgstr "Внешний вид"
65
+
66
+ msgid "Advanced settings"
67
+ msgstr "Дополнительные настройки"
68
+
69
+ msgid "Advanced"
70
+ msgstr "Дополнительные"
71
+
72
+ msgid "Setup"
73
+ msgstr "Настройки"
74
+
75
+ msgid "Your store's minicart"
76
+ msgstr "Корзина вашего магазина"
77
+
78
+ msgid "Ecwid Shopping Bag (Normal)"
79
+ msgstr "Корзина Ecwid (Основной режим)"
80
+
81
+ msgid "Ecwid Shopping Bag (Mini view)"
82
+ msgstr "Корзина Ecwid (Компактная)"
83
+
84
+ msgid "Your store's search box"
85
+ msgstr "Форма поиска по вашему магазину"
86
+
87
+ msgid "Ecwid Search Box"
88
+ msgstr "Поиск по магазину Ecwid"
89
+
90
+ msgid "Vertical menu of categories"
91
+ msgstr "Вертикальное меню категорий"
92
+
93
+ msgid "Ecwid Vertical Categories"
94
+ msgstr "Вертикальное меню категорий Ecwid"
95
+
96
+ msgid "Price"
97
+ msgstr "Цена"
98
+
99
+ msgid "Ecwid Shopping Cart - Advanced settings"
100
+ msgstr "Магазин Ecwid - Дополнительные настройки"
101
+
102
+ msgid "Category shown by default"
103
+ msgstr "Категория, показываемая по умолчанию"
104
+
105
+ msgid "Store root category"
106
+ msgstr "Корневая категория магазина"
107
+
108
+ msgid "Default category ID"
109
+ msgstr "ID категории по умолчанию"
110
+
111
+ msgid "By default, the storefront shows a list of root categories. You can override this behavior and show a different category when customers open your store for the first time. This is useful if you only have one category or want to display a specific set of items (e.g. \"Featured Products\") to new visitors."
112
+ msgstr "По умолчанию, магазин показывает корневые категории. Здесь можно выбрать другую категорию для отображения, когда покупатель впервые открывает ваш магазин. Это может быть полезно, если у вас есть только одна категория или вы хотите показывать определённые набор товаров (например, специальные предложения) новым пользователям."
113
+
114
+ msgid "In order to set this option, <a %s>find an ID of the necessary category</a> and save it here."
115
+ msgstr "Чтобы выставить категорию, <a %s>найдите ID нужной категории</a> и введите в это поле."
116
+
117
+ msgid "Single Sign-On Secret Key"
118
+ msgstr "Секретный ключ системы единой авторизации"
119
+
120
+ msgid "Single Sign-On Secret Key is an option that allows your customers access to your WordPress site as well as the Ecwid shopping cart. When customers log in to your site, they will automatically be logged in to your Ecwid store as well. It makes sense to enable this feature if your visitors actually create accounts in your WordPress website."
121
+ msgstr "Эта функция позволяет включить систему единой авторизации: когда покупатели вошли в свой аккаунт на вашем сайте, они автоматически входят в свой аккаунт Ecwid, даже если раньше у них его не было. Эта функция может быть полезна в случае, если ваши посетители создают свои аккаунты на вашем сайте."
122
+
123
+ msgid "In order to enable this feature, opt to use a secret key. You will find this key in your Ecwid control panel, at \"System Settings > API > Single Sign-On API\" page. This feature is available for <a href=\"http://www.ecwid.com/compare-plans.html\" target=\"_blank\">paid users</a> only."
124
+ msgstr "Чтобы включить эту функцию, вам необходимо ввести секретный ключ. Его можно найти в панели управления Ecwid в секции \"Настройки > API > Single Sign-on API\". Эта функция доступна только пользователям с <a href=\"http://www.ecwid.com/compare-plans.html\" target=\"_blank\">платным аккаунтом</a>."
125
+
126
+ msgid "Save changes"
127
+ msgstr "Сохранить изменения"
128
+
129
+ msgid "Ecwid Shopping Cart - Appearance settings"
130
+ msgstr "Магазин Ecwid - Настройки внешнего вида"
131
+
132
+ msgid "Display search box above products"
133
+ msgstr "Показывать форму поиска над списком продуктов"
134
+
135
+ msgid "Or you can add search box to your website's toolbar using <a href=\"widgets.php\">WordPress native widgets</a>."
136
+ msgstr "Или вы можете добавить форму поиска на ваш сайт с помощью <a href=\"widgets.php\">виджетов WordPress</a>."
137
+
138
+ msgid "Display horizontal categories above products"
139
+ msgstr "Показывать горизонтальное меню категорий над списком продуктов"
140
+
141
+ msgid "Or you can add vertical categories to your website's toolbar using <a href=\"widgets.php\">WordPress native widgets</a>."
142
+ msgstr "Или вы можете добавить вертикальное меню категорий на ваш сайт с помощью <a href=\"widgets.php\">виджетов WordPress</a>."
143
+
144
+ msgid "Enable minicart attached to horizontal categories"
145
+ msgstr "Показывать корзину у горизонтального меню категорий"
146
+
147
+ msgid "You should disable this option, if you added minicart to your website's&nbsp;sidebar."
148
+ msgstr "Если вы добавили виджет корзины в боковое меню, следует отключить эту настройку."
149
+
150
+ msgid "Number of categories per row"
151
+ msgstr "Количество категорий в ряд"
152
+
153
+ msgid "Number of products per page"
154
+ msgstr "Количество продуктов на странице"
155
+
156
+ msgid "Grid view"
157
+ msgstr "Вид \"сетка\""
158
+
159
+ msgid "List view"
160
+ msgstr "Вид \"список\""
161
+
162
+ msgid "Table view"
163
+ msgstr "Вид \"таблица\""
164
+
165
+ msgid "Here you can control how many products will be displayed per page. These options define maximum values. If there is not enough space to show all product columns, Ecwid will adapt the number of columns to hold all products."
166
+ msgstr "Здесь вы можете задать количество отображаемых продуктов на странице. Эти цифры определяют максимальные значения. Если на странице в сетке продуктов будет недостаточно места для отображения всех столбцов, Ecwid уменьшит их количество."
167
+
168
+ msgid "Default view mode on product pages"
169
+ msgstr "Вид страницы продуктов по умолчанию"
170
+
171
+ msgid "Grid"
172
+ msgstr "Сетка"
173
+
174
+ msgid "List"
175
+ msgstr "Список"
176
+
177
+ msgid "Table"
178
+ msgstr "Таблица"
179
+
180
+ msgid "Default view mode on search results"
181
+ msgstr "Вид страницы результатов поиска по умолчанию"
182
+
183
+ msgid "Store powered by Ecwid"
184
+ msgstr "Интернет-магазин построен на Ecwid"
185
+
186
+ msgid "Ecwid Shopping Cart - General settings"
187
+ msgstr "Магазин Ecwid - Основные настройки"
188
+
189
+ msgid "Thank you for choosing Ecwid to build your online store."
190
+ msgstr "Спасибо вам за то, что выбрали Ecwid для своего интернет-магазина."
191
+
192
+ msgid "The first step towards opening your online business: <br />Let’s get started and add a store to your WordPress website in <strong>3</strong> simple steps."
193
+ msgstr "Чтобы начать продавать онлайн, добавим магазин на вам сайт WordPress за <strong>3</strong> простых шага."
194
+
195
+ msgid "Register at Ecwid"
196
+ msgstr "Зарегистрируйтесь в Ecwid."
197
+
198
+ msgid "Create a new Ecwid account which you will use to manage your store and inventory. The registration is free."
199
+ msgstr "Создайте новый аккаунт Ecwid, которым вы будете пользоваться для управления своим магазином. Регистрация бесплатна."
200
+
201
+ msgid "Create new Ecwid account"
202
+ msgstr "Создать новый аккаунт Ecwid"
203
+
204
+ msgid "I already have Ecwid account, sign in"
205
+ msgstr "У меня уже есть аккаунт Ecwid, войти"
206
+
207
+ msgid "You will be able to sign up through your exising Google, Facebook or PayPal profiles as well."
208
+ msgstr "Также вы сможете зарегистрироваться с помощью вашего существующего аккаунта Google, Facebook или PayPal."
209
+
210
+ msgid "Find your Store ID"
211
+ msgstr "Найдите ваш ID Магазина"
212
+
213
+ msgid "Store ID is a unique identifier of any Ecwid store, it consists of several digits. You can find it on the \"Dashboard\" page of Ecwid control panel. Also the Store ID will be sent in the Welcome email after the registration."
214
+ msgstr "ID Магазина - это уникальный идентификатор, состоящий из нескольких цифр, который есть у любого магазина Ecwid. Вы можете найти его на странице \"Консоль\" панели управления Ecwid. Также ID Магазина будет выслан по электронной почте после регистрации."
215
+
216
+ msgid "Enter your Store ID"
217
+ msgstr "Введите ваш ID Магазина"
218
+
219
+ msgid "Enter your Store ID here:"
220
+ msgstr "Введите сюда ваш ID Магазина:"
221
+
222
+ msgid "Store ID"
223
+ msgstr "ID Магазина"
224
+
225
+ msgid "Save and connect your Ecwid store to the site"
226
+ msgstr "Сохранить и добавить магазин Ecwid на ваш сайт"
227
+
228
+ msgid "Questions? Visit <a href=\"http://help.ecwid.com/?source=wporg\">Ecwid support center</a>."
229
+ msgstr "Есть вопросы? Посетите <a href=\"http://help.ecwid.com/?source=wporg\">Центр поддержки Ecwid (англ)</a> или <a href=\"http://www.ecwid.com/forums/forumdisplay.php?f=10\"> русскоязычный раздел форума</a>."
230
+
231
+ msgid "Congratulations!"
232
+ msgstr "Поздравляем!"
233
+
234
+ msgid "Your Ecwid store is now connected to your WordPress website."
235
+ msgstr "Теперь ваш магазин подключен к вашему сайту WordPress."
236
+
237
+ msgid "Greetings!"
238
+ msgstr "Приветствуем!"
239
+
240
+ msgid "Your Ecwid store is connected to your WordPress website."
241
+ msgstr "Ваш магазин подключен к вашему сайту WordPress."
242
+
243
+ msgid "Control panel"
244
+ msgstr "Панель управления"
245
+
246
+ msgid "Account status"
247
+ msgstr "Аккаунт"
248
+
249
+ msgid "Paid"
250
+ msgstr "Платный"
251
+
252
+ msgid "Free"
253
+ msgstr "Бесплатный"
254
+
255
+ msgid "Thank you for supporting Ecwid!"
256
+ msgstr "Спасибо вам за поддержку Ecwid!"
257
+
258
+ msgid "Upgrade to get access to cool premium features."
259
+ msgstr "Перейдите на платный тарифный план, чтобы получить расширенные возможности."
260
+
261
+ msgid "Billing and plans"
262
+ msgstr "Оплата и тарифы"
263
+
264
+ msgid "Upgrade"
265
+ msgstr "Апгрейд"
266
+
267
+ msgid "If you want to connect another Ecwid store, you can <a %s>disconnect the current one and change Store ID</a>."
268
+ msgstr "Если вы хотите подключить другой магазин Ecwid, вы можете <a %s>отключить этот и ввести другой ID Магазина</a>."
languages/ecwid-shopping-cart.pot CHANGED
@@ -1,245 +1,260 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Ecwid Shopping Cart 2.0\n"
4
- "PO-Revision-Date: 2013-10-28 11:58:11\n"
5
- "Last-Translator: <test@example.com>\n"
6
- "MIME-Version: 1.0\n"
7
- "Content-Type: text/plain; charset=UTF-8\n"
8
- "Content-Transfer-Encoding: 8bit\n"
9
-
10
- msgid "Get help"
11
- msgstr ""
12
-
13
- msgid "Go to Ecwid site"
14
- msgstr ""
15
-
16
- msgid "Visit storefront"
17
- msgstr ""
18
-
19
- msgid "Manage my store"
20
- msgstr ""
21
-
22
- msgid "Manage plugin settings"
23
- msgstr ""
24
-
25
- msgid "→ Sell on Facebook"
26
- msgstr ""
27
-
28
- msgid "Store"
29
- msgstr ""
30
-
31
- msgid "<strong>Ecwid shopping cart is almost ready</strong>. Please visit <a target=\"_blank\" href=\"%s\">the created page</a> to see your store with demo products. In order to finish the installation, please go to the <a href=\"admin.php?page=ecwid\"><strong>Ecwid settings</strong></a> and configure the plugin."
32
- msgstr ""
33
-
34
- msgid "Ecwid shopping cart settings"
35
- msgstr ""
36
-
37
- msgid "Ecwid Store"
38
- msgstr ""
39
-
40
- msgid "General settings"
41
- msgstr ""
42
-
43
- msgid "General"
44
- msgstr ""
45
-
46
- msgid "Appearance settings"
47
- msgstr ""
48
-
49
- msgid "Appearance"
50
- msgstr ""
51
-
52
- msgid "Advanced settings"
53
- msgstr ""
54
-
55
- msgid "Advanced"
56
- msgstr ""
57
-
58
- msgid "Your store's minicart"
59
- msgstr ""
60
-
61
- msgid "Ecwid Shopping Bag (Normal)"
62
- msgstr ""
63
-
64
- msgid "Ecwid Shopping Bag (Mini view)"
65
- msgstr ""
66
-
67
- msgid "Your store's search box"
68
- msgstr ""
69
-
70
- msgid "Ecwid Search Box"
71
- msgstr ""
72
-
73
- msgid "Vertical menu of categories"
74
- msgstr ""
75
-
76
- msgid "Ecwid Vertical Categories"
77
- msgstr ""
78
-
79
- msgid "Ecwid Shopping Cart - Advanced settings"
80
- msgstr ""
81
-
82
- msgid "Category shown by default"
83
- msgstr ""
84
-
85
- msgid "Store root category"
86
- msgstr ""
87
-
88
- msgid "Default category ID"
89
- msgstr ""
90
-
91
- msgid "By default, the storefront shows a list of root categories. You can override this behaviour and show a different category when customers open your store for the first time. It is useful if you have one category only or want to display a specific set of items (e.g. \"Featured products\") to all new visitors."
92
- msgstr ""
93
-
94
- msgid "In order to set this option, <a %s>find an ID of the necessary category</a> and save it here."
95
- msgstr ""
96
-
97
- msgid "Single Sign-on Secret Key"
98
- msgstr ""
99
-
100
- msgid "This optional feature allows enabling Single Sign-On : when customers are logged in to your site, they are automatically logged in to your Ecwid store as well, even if they didn't have an account in the store before. It makes sense to enable this feature, if your visitors actually create accounts in your WordPress website."
101
- msgstr ""
102
-
103
- msgid "In order to enable this feature you should submit a secret key. You will find this key in your Ecwid control panel, at \"System Settings > API > Single Sign-on API\" page . This feature is available for <a href=\"http://www.ecwid.com/compare-plans.html\" target=\"_blank\">paid users</a> only."
104
- msgstr ""
105
-
106
- msgid "Save changes"
107
- msgstr ""
108
-
109
- msgid "Ecwid Shopping Cart - Appearance settings"
110
- msgstr ""
111
-
112
- msgid "Display search box above products"
113
- msgstr ""
114
-
115
- msgid "Or you can add search box to your website's toolbar using <a href=\"widgets.php\">WordPress native widgets</a>."
116
- msgstr ""
117
-
118
- msgid "Display horizontal categories above products"
119
- msgstr ""
120
-
121
- msgid "Or you can add vertical categories to your website's toolbar using <a href=\"widgets.php\">WordPress native widgets</a>."
122
- msgstr ""
123
-
124
- msgid "Enable minicart attached to horizontal categories"
125
- msgstr ""
126
-
127
- msgid "You should disable this option, if you added minicart to your website's&nbsp;sidebar."
128
- msgstr ""
129
-
130
- msgid "Number of categories per row"
131
- msgstr ""
132
-
133
- msgid "Number of products per page"
134
- msgstr ""
135
-
136
- msgid "Grid view"
137
- msgstr ""
138
-
139
- msgid "List view"
140
- msgstr ""
141
-
142
- msgid "Table view"
143
- msgstr ""
144
-
145
- msgid "Here you can control how many products will be displayed per page. These options define maximum values. If there is not enough space to show all product columns, Ecwid will adapt the number of columns to hold all products."
146
- msgstr ""
147
-
148
- msgid "Default view mode on product pages"
149
- msgstr ""
150
-
151
- msgid "Grid"
152
- msgstr ""
153
-
154
- msgid "List"
155
- msgstr ""
156
-
157
- msgid "Table"
158
- msgstr ""
159
-
160
- msgid "Default view mode on search results"
161
- msgstr ""
162
-
163
- msgid "Ecwid Shopping Cart - General settings"
164
- msgstr ""
165
-
166
- msgid "Thank you for choosing Ecwid to build your online store."
167
- msgstr ""
168
-
169
- msgid "The first step towards opening your online business: <br />Let’s get started and add a store to your WordPress website in <strong>3</strong> simple steps."
170
- msgstr ""
171
-
172
- msgid "Register at Ecwid"
173
- msgstr ""
174
-
175
- msgid "Create a new Ecwid account which you will use to manage your store and inventory. The registration is free."
176
- msgstr ""
177
-
178
- msgid "Create new Ecwid account"
179
- msgstr ""
180
-
181
- msgid "I already have Ecwid account, sign in"
182
- msgstr ""
183
-
184
- msgid "You will be able to sign up through your exising Google, Facebook or PayPal profiles as well."
185
- msgstr ""
186
-
187
- msgid "Find your Store ID"
188
- msgstr ""
189
-
190
- msgid "Store ID is a unique identifier of any Ecwid store, it consists of several digits. You can find it on the \"Dashboard\" page of Ecwid control panel. Also the Store ID will be sent in the Welcome email after the registration."
191
- msgstr ""
192
-
193
- msgid "Enter your Store ID"
194
- msgstr ""
195
-
196
- msgid "Enter your Store ID here:"
197
- msgstr ""
198
-
199
- msgid "Store ID"
200
- msgstr ""
201
-
202
- msgid "Save and connect your Ecwid store to the site"
203
- msgstr ""
204
-
205
- msgid "Questions? Visit <a href=\"http://help.ecwid.com/?source=wporg\">Ecwid support center</a>."
206
- msgstr ""
207
-
208
- msgid "Congratulations!"
209
- msgstr ""
210
-
211
- msgid "Your Ecwid store is now connected to your WordPress website."
212
- msgstr ""
213
-
214
- msgid "Greetings!"
215
- msgstr ""
216
-
217
- msgid "Your Ecwid store is connected to your WordPress website."
218
- msgstr ""
219
-
220
- msgid "Control panel"
221
- msgstr ""
222
-
223
- msgid "Account status"
224
- msgstr ""
225
-
226
- msgid "Paid"
227
- msgstr ""
228
-
229
- msgid "Free"
230
- msgstr ""
231
-
232
- msgid "Thank you for supporting Ecwid!"
233
- msgstr ""
234
-
235
- msgid "Upgrade to get access to cool premium features."
236
- msgstr ""
237
-
238
- msgid "Billing and plans"
239
- msgstr ""
240
-
241
- msgid "Upgrade"
242
- msgstr ""
243
-
244
- msgid "If you want to connect another Ecwid store, you can <a %s>disconnect the current one and change Store ID</a>."
245
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Ecwid Shopping Cart\n"
4
+ "PO-Revision-Date: 2013-11-25 17:38:21\n"
5
+ "Last-Translator: <test@example.com>\n"
6
+ "MIME-Version: 1.0\n"
7
+ "Content-Type: text/plain; charset=UTF-8\n"
8
+ "Content-Transfer-Encoding: 8bit\n"
9
+
10
+ msgid "Get help"
11
+ msgstr ""
12
+
13
+ msgid "Go to Ecwid site"
14
+ msgstr ""
15
+
16
+ msgid "Visit storefront"
17
+ msgstr ""
18
+
19
+ msgid "Manage my store"
20
+ msgstr ""
21
+
22
+ msgid "Manage plugin settings"
23
+ msgstr ""
24
+
25
+ msgid "→ Sell on Facebook"
26
+ msgstr ""
27
+
28
+ msgid "Online store powered by <a %s>Ecwid</a>"
29
+ msgstr ""
30
+
31
+ msgid "Store"
32
+ msgstr ""
33
+
34
+ msgid "<strong>Ecwid shopping cart is almost ready</strong>. Please visit <a target=\"_blank\" href=\"%s\">the created page</a> to see your store with demo products. In order to finish the installation, please go to the <a href=\"admin.php?page=ecwid\"><strong>Ecwid settings</strong></a> and configure the plugin."
35
+ msgstr ""
36
+
37
+ msgid "Do you like your Ecwid online store? We'd appreciate it if you <a %s>add your review and vote</a> for the plugin on Wordpress site. (<a id=\"hide-vote-message\">Close</a> and do not show this message anymore)"
38
+ msgstr ""
39
+
40
+ msgid "Ecwid shopping cart settings"
41
+ msgstr ""
42
+
43
+ msgid "Ecwid Store"
44
+ msgstr ""
45
+
46
+ msgid "General settings"
47
+ msgstr ""
48
+
49
+ msgid "General"
50
+ msgstr ""
51
+
52
+ msgid "Appearance settings"
53
+ msgstr ""
54
+
55
+ msgid "Appearance"
56
+ msgstr ""
57
+
58
+ msgid "Advanced settings"
59
+ msgstr ""
60
+
61
+ msgid "Advanced"
62
+ msgstr ""
63
+
64
+ msgid "Setup"
65
+ msgstr ""
66
+
67
+ msgid "Your store's minicart"
68
+ msgstr ""
69
+
70
+ msgid "Ecwid Shopping Bag (Normal)"
71
+ msgstr ""
72
+
73
+ msgid "Ecwid Shopping Bag (Mini view)"
74
+ msgstr ""
75
+
76
+ msgid "Your store's search box"
77
+ msgstr ""
78
+
79
+ msgid "Ecwid Search Box"
80
+ msgstr ""
81
+
82
+ msgid "Vertical menu of categories"
83
+ msgstr ""
84
+
85
+ msgid "Ecwid Vertical Categories"
86
+ msgstr ""
87
+
88
+ msgid "Price"
89
+ msgstr ""
90
+
91
+ msgid "Ecwid Shopping Cart - Advanced settings"
92
+ msgstr ""
93
+
94
+ msgid "Category shown by default"
95
+ msgstr ""
96
+
97
+ msgid "Store root category"
98
+ msgstr ""
99
+
100
+ msgid "Default category ID"
101
+ msgstr ""
102
+
103
+ msgid "By default, the storefront shows a list of root categories. You can override this behavior and show a different category when customers open your store for the first time. This is useful if you only have one category or want to display a specific set of items (e.g. \"Featured Products\") to new visitors."
104
+ msgstr ""
105
+
106
+ msgid "In order to set this option, <a %s>find an ID of the necessary category</a> and save it here."
107
+ msgstr ""
108
+
109
+ msgid "Single Sign-On Secret Key"
110
+ msgstr ""
111
+
112
+ msgid "Single Sign-On Secret Key is an option that allows your customers access to your WordPress site as well as the Ecwid shopping cart. When customers log in to your site, they will automatically be logged in to your Ecwid store as well. It makes sense to enable this feature if your visitors actually create accounts in your WordPress website."
113
+ msgstr ""
114
+
115
+ msgid "In order to enable this feature, opt to use a secret key. You will find this key in your Ecwid control panel, at \"System Settings > API > Single Sign-On API\" page. This feature is available for <a href=\"http://www.ecwid.com/compare-plans.html\" target=\"_blank\">paid users</a> only."
116
+ msgstr ""
117
+
118
+ msgid "Save changes"
119
+ msgstr ""
120
+
121
+ msgid "Ecwid Shopping Cart - Appearance settings"
122
+ msgstr ""
123
+
124
+ msgid "Display search box above products"
125
+ msgstr ""
126
+
127
+ msgid "Or you can add search box to your website's toolbar using <a href=\"widgets.php\">WordPress native widgets</a>."
128
+ msgstr ""
129
+
130
+ msgid "Display horizontal categories above products"
131
+ msgstr ""
132
+
133
+ msgid "Or you can add vertical categories to your website's toolbar using <a href=\"widgets.php\">WordPress native widgets</a>."
134
+ msgstr ""
135
+
136
+ msgid "Enable minicart attached to horizontal categories"
137
+ msgstr ""
138
+
139
+ msgid "You should disable this option, if you added minicart to your website's&nbsp;sidebar."
140
+ msgstr ""
141
+
142
+ msgid "Number of categories per row"
143
+ msgstr ""
144
+
145
+ msgid "Number of products per page"
146
+ msgstr ""
147
+
148
+ msgid "Grid view"
149
+ msgstr ""
150
+
151
+ msgid "List view"
152
+ msgstr ""
153
+
154
+ msgid "Table view"
155
+ msgstr ""
156
+
157
+ msgid "Here you can control how many products will be displayed per page. These options define maximum values. If there is not enough space to show all product columns, Ecwid will adapt the number of columns to hold all products."
158
+ msgstr ""
159
+
160
+ msgid "Default view mode on product pages"
161
+ msgstr ""
162
+
163
+ msgid "Grid"
164
+ msgstr ""
165
+
166
+ msgid "List"
167
+ msgstr ""
168
+
169
+ msgid "Table"
170
+ msgstr ""
171
+
172
+ msgid "Default view mode on search results"
173
+ msgstr ""
174
+
175
+ msgid "Store powered by Ecwid"
176
+ msgstr ""
177
+
178
+ msgid "Ecwid Shopping Cart - General settings"
179
+ msgstr ""
180
+
181
+ msgid "Thank you for choosing Ecwid to build your online store."
182
+ msgstr ""
183
+
184
+ msgid "The first step towards opening your online business: <br />Let’s get started and add a store to your WordPress website in <strong>3</strong> simple steps."
185
+ msgstr ""
186
+
187
+ msgid "Register at Ecwid"
188
+ msgstr ""
189
+
190
+ msgid "Create a new Ecwid account which you will use to manage your store and inventory. The registration is free."
191
+ msgstr ""
192
+
193
+ msgid "Create new Ecwid account"
194
+ msgstr ""
195
+
196
+ msgid "I already have Ecwid account, sign in"
197
+ msgstr ""
198
+
199
+ msgid "You will be able to sign up through your exising Google, Facebook or PayPal profiles as well."
200
+ msgstr ""
201
+
202
+ msgid "Find your Store ID"
203
+ msgstr ""
204
+
205
+ msgid "Store ID is a unique identifier of any Ecwid store, it consists of several digits. You can find it on the \"Dashboard\" page of Ecwid control panel. Also the Store ID will be sent in the Welcome email after the registration."
206
+ msgstr ""
207
+
208
+ msgid "Enter your Store ID"
209
+ msgstr ""
210
+
211
+ msgid "Enter your Store ID here:"
212
+ msgstr ""
213
+
214
+ msgid "Store ID"
215
+ msgstr ""
216
+
217
+ msgid "Save and connect your Ecwid store to the site"
218
+ msgstr ""
219
+
220
+ msgid "Questions? Visit <a href=\"http://help.ecwid.com/?source=wporg\">Ecwid support center</a>."
221
+ msgstr ""
222
+
223
+ msgid "Congratulations!"
224
+ msgstr ""
225
+
226
+ msgid "Your Ecwid store is now connected to your WordPress website."
227
+ msgstr ""
228
+
229
+ msgid "Greetings!"
230
+ msgstr ""
231
+
232
+ msgid "Your Ecwid store is connected to your WordPress website."
233
+ msgstr ""
234
+
235
+ msgid "Control panel"
236
+ msgstr ""
237
+
238
+ msgid "Account status"
239
+ msgstr ""
240
+
241
+ msgid "Paid"
242
+ msgstr ""
243
+
244
+ msgid "Free"
245
+ msgstr ""
246
+
247
+ msgid "Thank you for supporting Ecwid!"
248
+ msgstr ""
249
+
250
+ msgid "Upgrade to get access to cool premium features."
251
+ msgstr ""
252
+
253
+ msgid "Billing and plans"
254
+ msgstr ""
255
+
256
+ msgid "Upgrade"
257
+ msgstr ""
258
+
259
+ msgid "If you want to connect another Ecwid store, you can <a %s>disconnect the current one and change Store ID</a>."
260
+ msgstr ""
lib/EcwidCatalog.php CHANGED
@@ -2,176 +2,218 @@
2
 
3
  class EcwidCatalog
4
  {
5
- var $store_id = 0;
6
- var $store_base_url = '';
7
- var $ecwid_api = null;
8
-
9
- function __construct($store_id, $store_base_url)
10
- {
11
- $this->store_id = intval($store_id);
12
- $this->store_base_url = $store_base_url;
13
- $this->ecwid_api = new EcwidProductApi($this->store_id);
14
- }
15
-
16
- function EcwidCatalog($store_id)
17
- {
18
- if(version_compare(PHP_VERSION,"5.0.0","<"))
19
- $this->__construct($store_id);
20
- }
21
-
22
- function get_product($id)
23
- {
24
- $params = array
25
- (
26
- array("alias" => "p", "action" => "product", "params" => array("id" => $id)),
27
- array("alias" => "pf", "action" => "profile")
28
- );
29
-
30
- $batch_result = $this->ecwid_api->get_batch_request($params);
31
- $product = $batch_result["p"];
32
- $profile = $batch_result["pf"];
33
-
34
- $return = '';
35
-
36
- if (is_array($product))
37
- {
38
-
39
- $return = "<div itemscope itemtype=\"http://schema.org/Product\">";
40
- $return .= "<h1 class='ecwid_catalog_product_name' itemprop=\"name\">" . htmlentities($product["name"], ENT_COMPAT, 'UTF-8') . "</h1>";
41
- $return .= "<p class='ecwid_catalog_product_sku' itemprop=\"sku\">" . htmlentities($product["sku"], ENT_COMPAT, 'UTF-8') . "</p>";
42
-
43
- if (!empty($product["thumbnailUrl"]))
44
- {
45
- $return .= "<div class='ecwid_catalog_product_image'><img itemprop=\"image\" src='" . $product["thumbnailUrl"] . "' alt='" . htmlentities($product["sku"], ENT_COMPAT, 'UTF-8') . " " . htmlentities($product["name"], ENT_COMPAT, 'UTF-8') . "'/></div>";
46
- }
47
-
48
- if(is_array($product["categories"]))
49
- {
50
- foreach ($product["categories"] as $ecwid_category)
51
- {
52
- if($ecwid_category["defaultCategory"]==true)
53
- {
54
- $return .="<div class='ecwid_catalog_product_category' itemprop=\"category\">".$ecwid_category["name"]."</div>";
55
- }
56
- }
57
- }
58
-
59
- $return .= "<div class='ecwid_catalog_product_price' itemprop=\"offers\" itemscope itemtype=\"http://schema.org/Offer\">Price: <span itemprop=\"price\">" . $product["price"] . "</span>&nbsp;<span itemprop=\"priceCurrency\">" . $profile["currency"] . "</span></div>";
60
-
61
- if (!isset($product['quantity']) || (isset($product['quantity']) && $product['quantity'] > 0))
62
- {
63
- $return .= "<div class='ecwid_catalog_quantity' itemprop=\"availability\" itemscope itemtype=\"http://schema.org/InStock\"><span>In Stock</span></div>";
64
- }
65
- $return .= "<div class='ecwid_catalog_product_description' itemprop=\"description\">" . $product["description"] . "</div>";
66
-
67
- if (is_array($product["options"]))
68
- {
69
- foreach($product["options"] as $product_options)
70
- {
71
- if($product_options["type"]=="TEXTFIELD" || $product_options["type"]=="DATE")
72
- {
73
- $return .= "<div class='ecwid_catalog_product_options' itemprop=\"offers\"><span itemprop=\"condition\">". $product_options["name"]."</span></div>";
74
- $return .='<input type="text" size="40" name='. $product_options["name"].'>';
75
- }
76
- if($product_options["type"]=="TEXTAREA")
77
- {
78
- $return .= "<div class='ecwid_catalog_product_options' itemprop=\"offers\"><span itemprop=\"condition\">". $product_options["name"]."</span></div>";
79
- $return .='<textarea name='.$product_options["name"].'></textarea>';
80
- }
81
- if ($product_options["type"]=="SELECT")
82
- {
83
- $return .="<div class='ecwid_catalog_product_options' itemprop=\"offers\"><span itemprop=\"condition\">". $product_options["name"]."</span></div>";
84
- $return .= '<select name='. $product_options["name"].'>';
85
- foreach ($product_options["choices"] as $options_param)
86
- {
87
- $return .='<option value='. $options_param['text'].'>'. $options_param['text'].' ('.$options_param['priceModifier'].')</option>';
88
- }
89
- $return .= '</select>';
90
- }
91
- if($product_options["type"]=="RADIO")
92
- {
93
- $return .= "<div class='ecwid_catalog_product_options' itemprop=\"offers\"><span itemprop=\"condition\">". $product_options["name"]."</span></div>";
94
- foreach ($product_options["choices"] as $options_param)
95
- {
96
- $return .='<input type="radio" name='.$product_options["name"].'value='. $options_param['text'].'>'. $options_param['text'].' ('.$options_param['priceModifier'].')<br>';
97
- }
98
- }
99
- if($product_options["type"]=="CHECKBOX")
100
- {
101
- $return .= "<div class='ecwid_catalog_product_options' itemprop=\"offers\"><span itemprop=\"condition\">". $product_options["name"]."</span></div>";
102
- foreach ($product_options["choices"] as $options_param)
103
- {
104
- $return .='<input type="checkbox" name='.$product_options["name"].'value='. $options_param['text'].'>'. $options_param['text'].' ('.$options_param['priceModifier'].')<br>';
105
- }
106
- }
107
- }
108
- }
109
-
110
- if (is_array($product["galleryImages"]))
111
- {
112
- foreach ($product["galleryImages"] as $galleryimage)
113
- {
114
- if (empty($galleryimage["alt"])) $galleryimage["alt"] = htmlspecialchars($product["name"]);
115
- $return .= "<img src='" . $galleryimage["url"] . "' alt='" . htmlspecialchars($galleryimage["alt"]) ."' title='" . htmlspecialchars($galleryimage["alt"]) ."'><br />";
116
- }
117
- }
118
-
119
- $return .= "</div>" . PHP_EOL;
120
- }
121
-
122
- return $return;
123
- }
124
-
125
- function get_category($id)
126
- {
127
- $params = array
128
- (
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  array("alias" => "c", "action" => "categories", "params" => array("parent" => $id)),
130
  array("alias" => "p", "action" => "products", "params" => array("category" => $id)),
131
- array("alias" => "pf", "action" => "profile")
132
- );
133
-
134
- $batch_result = $this->ecwid_api->get_batch_request($params);
135
-
136
- $categories = $batch_result["c"];
137
- $products = $batch_result["p"];
138
- $profile = $batch_result["pf"];
139
-
140
- $return = '';
141
-
142
- if (is_array($categories))
143
- {
144
- foreach ($categories as $category)
145
- {
146
- $category_url = $this->build_url($category["url"]);
147
- $category_name = $category["name"];
148
- $return .= "<div class='ecwid_catalog_category_name'><a href='" . htmlspecialchars($category_url) . "&offset=0&sort=nameAsc'>" . $category_name . "</a><br /></div>" . PHP_EOL;
149
- }
150
- }
151
-
152
- if (is_array($products))
153
- {
154
- foreach ($products as $product)
155
- {
156
- $product_url = $this->store_base_url . "#!/~/product/category=" . $id . "&id=" . $product["id"];
157
- $this->build_url($product["url"]);
158
- $product_name = $product["name"];
159
- $product_price = $product["price"] . "&nbsp;" . $profile["currency"];
160
- $return .= "<div>";
161
- $return .= "<span class='ecwid_product_name'><a href='" . htmlspecialchars($product_url) . "'>" . $product_name . "</a></span>";
162
- $return .= "&nbsp;&nbsp;<span class='ecwid_product_price'>" . $product_price . "</span>";
163
- $return .= "</div>" . PHP_EOL;
164
- }
165
- }
166
-
167
- return $return;
168
- }
169
-
170
- function build_url($url_from_ecwid)
171
- {
172
- if (preg_match('/(.*)(#!)(.*)/', $url_from_ecwid, $matches))
173
- return $this->store_base_url . $matches[2] . $matches[3];
174
- else
175
- return '';
176
- }
 
 
 
 
 
 
 
 
 
177
  }
2
 
3
  class EcwidCatalog
4
  {
5
+ var $store_id = 0;
6
+ var $store_base_url = '';
7
+ var $ecwid_api = null;
8
+
9
+ function __construct($store_id, $store_base_url)
10
+ {
11
+ $this->store_id = intval($store_id);
12
+ $this->store_base_url = $store_base_url;
13
+ $this->ecwid_api = new EcwidProductApi($this->store_id);
14
+ }
15
+
16
+ function EcwidCatalog($store_id)
17
+ {
18
+ if(version_compare(PHP_VERSION,"5.0.0","<"))
19
+ $this->__construct($store_id);
20
+ }
21
+
22
+ function get_product($id)
23
+ {
24
+ $params = array
25
+ (
26
+ array("alias" => "p", "action" => "product", "params" => array("id" => $id)),
27
+ array("alias" => "pf", "action" => "profile")
28
+ );
29
+
30
+ $batch_result = $this->ecwid_api->get_batch_request($params);
31
+ $product = $batch_result["p"];
32
+ $profile = $batch_result["pf"];
33
+
34
+ $return = '';
35
+
36
+ if (is_array($product))
37
+ {
38
+
39
+ $return = '<div itemscope itemtype="http://schema.org/Product">';
40
+ $return .= '<h2 class="ecwid_catalog_product_name" itemprop="name">' . esc_html($product["name"]) . '</h2>';
41
+ $return .= '<p class="ecwid_catalog_product_sku" itemprop="sku">' . esc_html($product["sku"]) . '</p>';
42
+
43
+ if (!empty($product["thumbnailUrl"]))
44
+ {
45
+ $return .= sprintf(
46
+ '<div class="ecwid_catalog_product_image"><img itemprop="image" src="%s" alt="%s" /></div>',
47
+ esc_attr($product['thumbnailUrl']),
48
+ esc_attr($product['name'] . ' ' . $product['sku'])
49
+ );
50
+ }
51
+
52
+ if(is_array($product["categories"]))
53
+ {
54
+ foreach ($product["categories"] as $ecwid_category)
55
+ {
56
+ if($ecwid_category["defaultCategory"] == true)
57
+ {
58
+ $return .= '<div class="ecwid_catalog_product_category" itemprop="category">' . esc_html($ecwid_category['name']) . '</div>';
59
+ }
60
+ }
61
+ }
62
+
63
+ $return .= '<div class="ecwid_catalog_product_price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">';
64
+ $return .= __('Price', 'ecwid-shopping-cart') . ': <span itemprop="price">' . esc_html($product["price"]) . '</span>&nbsp;';
65
+ $return .= '<span itemprop="priceCurrency">' . esc_html($profile['currency']) . '</span></div>';
66
+
67
+ if (!isset($product['quantity']) || (isset($product['quantity']) && $product['quantity'] > 0))
68
+ {
69
+ $return .= '<div class="ecwid_catalog_quantity" itemprop="availability" itemscope itemtype="http://schema.org/InStock"><span>In Stock</span></div>';
70
+ }
71
+ $return .= '<div class="ecwid_catalog_product_description" itemprop="description">'
72
+ . $product['description']
73
+ . '</div>';
74
+
75
+ if (is_array($product["options"]))
76
+ {
77
+ $allowed_types = array('TEXTFIELD', 'DATE', 'TEXTAREA', 'SELECT', 'RADIO', 'CHECKBOX');
78
+ foreach($product["options"] as $product_options)
79
+ {
80
+ if (in_array($product_options['type'], $allowed_types)) {
81
+ $return .= '<div class="ecwid_catalog_product_options" itemprop="offers"><span itemprop="condition">'
82
+ . esc_html($product_options["name"])
83
+ . '</span></div>';
84
+ } else {
85
+ continue;
86
+ }
87
+ if($product_options["type"] == "TEXTFIELD" || $product_options["type"] == "DATE")
88
+ {
89
+ $return .='<input type="text" size="40" name="'. esc_attr($product_options["name"]) . '">';
90
+ }
91
+ if($product_options["type"] == "TEXTAREA")
92
+ {
93
+ $return .='<textarea name="' . esc_attr($product_options["name"]) . '></textarea>';
94
+ }
95
+ if ($product_options["type"] == "SELECT")
96
+ {
97
+ $return .= '<select name='. $product_options["name"].'>';
98
+ foreach ($product_options["choices"] as $options_param)
99
+ {
100
+ $return .= sprintf(
101
+ '<option value="%s">%s (%s)</option>',
102
+ esc_attr($options_param['text']),
103
+ esc_html($options_param['text']),
104
+ esc_html($options_param['priceModifier'])
105
+ );
106
+ }
107
+ $return .= '</select>';
108
+ }
109
+ if($product_options["type"] == "RADIO")
110
+ {
111
+ foreach ($product_options["choices"] as $options_param)
112
+ {
113
+ $return .= sprintf(
114
+ '<input type="radio" name="%s" value="%s" />%s (%s)<br />',
115
+ esc_attr($product_options['name']),
116
+ esc_attr($options_param['text']),
117
+ esc_html($options_param['text']),
118
+ esc_html($options_param['priceModifier'])
119
+ );
120
+ }
121
+ }
122
+ if($product_options["type"] == "CHECKBOX")
123
+ {
124
+ foreach ($product_options["choices"] as $options_param)
125
+ {
126
+ $return .= sprintf(
127
+ '<input type="checkbox" name="%s" value="%s" />%s (%s)<br />',
128
+ esc_attr($product_options['name']),
129
+ esc_attr($options_param['text']),
130
+ esc_html($options_param['text']),
131
+ esc_html($options_param['priceModifier'])
132
+ );
133
+ }
134
+ }
135
+ }
136
+ }
137
+
138
+ if (is_array($product["galleryImages"]))
139
+ {
140
+ foreach ($product["galleryImages"] as $galleryimage)
141
+ {
142
+ if (empty($galleryimage["alt"])) $galleryimage["alt"] = htmlspecialchars($product["name"]);
143
+ $return .= sprintf(
144
+ '<img src="%s" alt="%s" title="%s" /><br />',
145
+ esc_attr($galleryimage['url']),
146
+ esc_attr($galleryimage['alt']),
147
+ esc_attr($galleryimage['alt'])
148
+ );
149
+ }
150
+ }
151
+
152
+ $return .= "</div>" . PHP_EOL;
153
+ }
154
+
155
+ return $return;
156
+ }
157
+
158
+ function get_category($id)
159
+ {
160
+ $params = array
161
+ (
162
  array("alias" => "c", "action" => "categories", "params" => array("parent" => $id)),
163
  array("alias" => "p", "action" => "products", "params" => array("category" => $id)),
164
+ array("alias" => "pf", "action" => "profile")
165
+ );
166
+ if ($id > 0) {
167
+ $params[] = array('alias' => 'category', "action" => "category", "params" => array("id" => $id));
168
+ }
169
+
170
+ $batch_result = $this->ecwid_api->get_batch_request($params);
171
+
172
+ $category = $batch_result["category"];
173
+ $categories = $batch_result["c"];
174
+ $products = $batch_result["p"];
175
+ $profile = $batch_result["pf"];
176
+
177
+ $return = '<h2>' . esc_html($category['name']) . '</h2>';
178
+ $return .= '<div>' . $category['description'] . '</div';
179
+
180
+ if (is_array($categories))
181
+ {
182
+ foreach ($categories as $category)
183
+ {
184
+ $category_url = $this->build_url($category["url"]);
185
+ $category_name = $category["name"];
186
+ $return .= sprintf(
187
+ '<div class="ecwid_catalog_category_name"><a href="%s">%s</a></div>' . PHP_EOL,
188
+ esc_attr($category_url . '&offset=0&sort=nameAsc'),
189
+ esc_html($category_name)
190
+ );
191
+ }
192
+ }
193
+
194
+ if (is_array($products))
195
+ {
196
+ foreach ($products as $product)
197
+ {
198
+ $product_url = $this->store_base_url . "#!/~/product/category=" . $id . "&id=" . $product["id"];
199
+ $this->build_url($product["url"]);
200
+ $product_name = $product["name"];
201
+ $product_price = $product["price"] . "&nbsp;" . $profile["currency"];
202
+ $return .= "<div>";
203
+ $return .= "<span class='ecwid_product_name'><a href='" . esc_attr($product_url) . "'>" . esc_html($product_name) . "</a></span>";
204
+ $return .= "&nbsp;&nbsp;<span class='ecwid_product_price'>" . esc_html($product_price) . "</span>";
205
+ $return .= "</div>" . PHP_EOL;
206
+ }
207
+ }
208
+
209
+ return $return;
210
+ }
211
+
212
+ function build_url($url_from_ecwid)
213
+ {
214
+ if (preg_match('/(.*)(#!)(.*)/', $url_from_ecwid, $matches))
215
+ return $this->store_base_url . $matches[2] . $matches[3];
216
+ else
217
+ return '';
218
+ }
219
  }
lib/ecwid_product_api.php CHANGED
@@ -98,17 +98,32 @@ class EcwidProductApi {
98
  }
99
 
100
  function get_product($product_id) {
 
 
101
  $product_id = intval($product_id);
 
 
 
 
 
102
  $api_url = $this->ECWID_PRODUCT_API_ENDPOINT . "/" . $this->store_id . "/product?id=" . $product_id;
103
- $product = $this->process_request($api_url);
104
- return $product;
 
105
  }
106
 
107
  function get_category($category_id) {
 
 
108
  $category_id = intval($category_id);
 
 
 
 
109
  $api_url = $this->ECWID_PRODUCT_API_ENDPOINT . "/" . $this->store_id . "/category?id=" . $category_id;
110
- $category = $this->process_request($api_url);
111
- return $category;
 
112
  }
113
 
114
  function get_batch_request($params) {
98
  }
99
 
100
  function get_product($product_id) {
101
+ static $cached;
102
+
103
  $product_id = intval($product_id);
104
+
105
+ if (isset($cached[$product_id])) {
106
+ return $cached[$product_id];
107
+ }
108
+
109
  $api_url = $this->ECWID_PRODUCT_API_ENDPOINT . "/" . $this->store_id . "/product?id=" . $product_id;
110
+ $cached[$product_id] = $this->process_request($api_url);
111
+
112
+ return $cached[$product_id];
113
  }
114
 
115
  function get_category($category_id) {
116
+ static $cached = array();
117
+
118
  $category_id = intval($category_id);
119
+
120
+ if (isset($cached[$category_id])) {
121
+ return $cached[$category_id];
122
+ }
123
  $api_url = $this->ECWID_PRODUCT_API_ENDPOINT . "/" . $this->store_id . "/category?id=" . $category_id;
124
+ $cached[$category_id] = $this->process_request($api_url);
125
+
126
+ return $cached[$category_id];
127
  }
128
 
129
  function get_batch_request($params) {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Ecwid Team
3
  Tags: ecwid, shopping cart, ecommerce, wordpress ecommerce, wp e-commerce, paypal, e-commerce, online store, store, shop, cart, online shop, shopping, digital goods, downloadable products, product catalog, ecomerce, products, facebook, f-commerce
4
  Requires at least: 2.8
5
  Tested up to: 3.7
6
- Stable tag: 2.0
7
 
8
  Ecwid is a free full-featured shopping cart that can easily be added to any blog
9
  and takes less than 5 minutes to set up.
@@ -32,18 +32,18 @@ Links
32
 
33
  == Installation ==
34
 
35
- **Automatic installation (the easiest way).**
36
 
37
  1. Go to your WP admin panel → Plugins → Add New
38
  2. Under Search, type in 'Ecwid', click Search
39
  3. In the search results find the 'Ecwid Shopping Cart' plugin and click 'Install now' to install it
40
  4. When plugin is installed click 'Activate Plugin' link
41
- 5. Log in into Ecwid control panel at https://my.ecwid.com and copy your numeric Store ID. Go to 'SettingsEcwid shopping cart' page in WP admin panel and paste Store ID in the corresponding field.
42
 
43
- **IMPORTANT**: when the plugin is installed, you will need to activate it on the Plugins page (click 'Activate' link) and configure it on the 'SettingsEcwid shopping cart' page (at least, you will need to set your store ID there).
44
 
45
 
46
- **Alternative ways:**
47
 
48
  **Uploading the plugin zip archive in your admin panel**
49
 
@@ -78,6 +78,16 @@ http://codex.wordpress.org/Managing_Plugins#Installing_Plugins
78
  - Knowledge Base: [http://kb.ecwid.com](http://kb.ecwid.com)
79
 
80
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
81
  = 2.0 =
82
  - **New revamped plugin settings**: the new settings layout makes the plugin easy and intuitive for starters, yet powerful and advanced for experienced merchants.
83
 
3
  Tags: ecwid, shopping cart, ecommerce, wordpress ecommerce, wp e-commerce, paypal, e-commerce, online store, store, shop, cart, online shop, shopping, digital goods, downloadable products, product catalog, ecomerce, products, facebook, f-commerce
4
  Requires at least: 2.8
5
  Tested up to: 3.7
6
+ Stable tag: 2.1
7
 
8
  Ecwid is a free full-featured shopping cart that can easily be added to any blog
9
  and takes less than 5 minutes to set up.
32
 
33
  == Installation ==
34
 
35
+ = Automatic installation (the easiest way) =
36
 
37
  1. Go to your WP admin panel → Plugins → Add New
38
  2. Under Search, type in 'Ecwid', click Search
39
  3. In the search results find the 'Ecwid Shopping Cart' plugin and click 'Install now' to install it
40
  4. When plugin is installed click 'Activate Plugin' link
41
+ 5. Log in into Ecwid control panel at https://my.ecwid.com and copy your numeric Store ID. Go to 'Ecwid Store General' page in WP admin panel and paste Store ID in the corresponding field.
42
 
43
+ **IMPORTANT**: when the plugin is installed, you will need to activate it on the Plugins page (click 'Activate' link) and configure it on the 'Ecwid Store General' page (at least, you will need to set your store ID there).
44
 
45
 
46
+ = Alternative ways =
47
 
48
  **Uploading the plugin zip archive in your admin panel**
49
 
78
  - Knowledge Base: [http://kb.ecwid.com](http://kb.ecwid.com)
79
 
80
  == Changelog ==
81
+ = 2.1 =
82
+ - Our plugin backend is now available in Italian, Russian and English. Thanks to Luciano Del Fico for the great help with the Italian translation.
83
+
84
+ - Improvements and bug fixes, including
85
+ - Better SEO for store pages: search engines will now index product options list and category descriptions
86
+ - Compatibility with WP Minify (Wordpress sites optimization plugin)
87
+ - Improved compatibility with Yoast WP SEO plugin: Ecwid SEO page titles are shown properly with enabled Yoast's "Force Rewrite Titles" option
88
+ - Minor text and design tweaks of the plugin settings pages
89
+
90
+
91
  = 2.0 =
92
  - **New revamped plugin settings**: the new settings layout makes the plugin easy and intuitive for starters, yet powerful and advanced for experienced merchants.
93
 
templates/advanced-settings.php CHANGED
@@ -42,7 +42,7 @@
42
  />
43
  <?php endif; ?>
44
  <div class="note">
45
- <?php _e('By default, the storefront shows a list of root categories. You can override this behaviour and show a different category when customers open your store for the first time. It is useful if you have one category only or want to display a specific set of items (e.g. "Featured products") to all new visitors.', 'ecwid-shopping-cart'); ?>
46
  </div>
47
  <div class="note">
48
  <?php if (!ecwid_is_paid_account()): ?>
@@ -59,22 +59,22 @@
59
 
60
  <div class="pure-control-group last">
61
  <label for="ecwid_sso_secret_key">
62
- <?php _e('Single Sign-on Secret Key', 'ecwid-shopping-cart'); ?>
63
  </label>
64
 
65
  <input
66
  id="ecwid_sso_secret_key"
67
  type="text"
68
  name="ecwid_sso_secret_key"
69
- placeholder="<?php _e('Single Sign-on Secret Key', 'ecwid-shopping-cart'); ?>"
70
  value="<?php echo esc_attr(get_option('ecwid_sso_secret_key')); ?>"
71
  />
72
 
73
  <div class="note">
74
- <?php _e("This optional feature allows enabling Single Sign-On : when customers are logged in to your site, they are automatically logged in to your Ecwid store as well, even if they didn't have an account in the store before. It makes sense to enable this feature, if your visitors actually create accounts in your WordPress website.", 'ecwid-shopping-cart'); ?>
75
  </div>
76
  <div class="note grayed-links">
77
- <?php _e('In order to enable this feature you should submit a secret key. You will find this key in your Ecwid control panel, at "System Settings > API > Single Sign-on API" page . This feature is available for <a href="http://www.ecwid.com/compare-plans.html" target="_blank">paid users</a> only.', 'ecwid-shopping-cart'); ?>
78
  </div>
79
  </div>
80
 
42
  />
43
  <?php endif; ?>
44
  <div class="note">
45
+ <?php _e('By default, the storefront shows a list of root categories. You can override this behavior and show a different category when customers open your store for the first time. This is useful if you only have one category or want to display a specific set of items (e.g. "Featured Products") to new visitors.', 'ecwid-shopping-cart'); ?>
46
  </div>
47
  <div class="note">
48
  <?php if (!ecwid_is_paid_account()): ?>
59
 
60
  <div class="pure-control-group last">
61
  <label for="ecwid_sso_secret_key">
62
+ <?php _e('Single Sign-On Secret Key', 'ecwid-shopping-cart'); ?>
63
  </label>
64
 
65
  <input
66
  id="ecwid_sso_secret_key"
67
  type="text"
68
  name="ecwid_sso_secret_key"
69
+ placeholder="<?php _e('Single Sign-On Secret Key', 'ecwid-shopping-cart'); ?>"
70
  value="<?php echo esc_attr(get_option('ecwid_sso_secret_key')); ?>"
71
  />
72
 
73
  <div class="note">
74
+ <?php _e('Single Sign-On Secret Key is an option that allows your customers access to your WordPress site as well as the Ecwid shopping cart. When customers log in to your site, they will automatically be logged in to your Ecwid store as well. It makes sense to enable this feature if your visitors actually create accounts in your WordPress website.', 'ecwid-shopping-cart'); ?>
75
  </div>
76
  <div class="note grayed-links">
77
+ <?php _e('In order to enable this feature, opt to use a secret key. You will find this key in your Ecwid control panel, at "System Settings > API > Single Sign-On API" page. This feature is available for <a href="http://www.ecwid.com/compare-plans.html" target="_blank">paid users</a> only.', 'ecwid-shopping-cart'); ?>
78
  </div>
79
  </div>
80