Ecwid Ecommerce Shopping Cart - Version 6.8.10

Version Description

  • Dec 26, 2019 =
  • Several fixes and improvements for the "Import from WooCommerce" tool. The import tool now works faster and has a neat interface.
  • Improved compatibility with popular WordPress cache plugins. The Ecwid ecommerce plugin now works better on sites with WP Super Cache, Autoptimize and WP-Rocket. If you have one of those plugins installed and noticed any issue, it should be fixed now. If you still see a problem, please let us know.
  • Minor fixes for improved compatiblity with the Elementor pagebuilder plugin.
Download this release

Release Info

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

Code changes from version 6.8.9 to 6.8.10

css/importer.css CHANGED
@@ -1,50 +1,19 @@
1
- .ecwid-importer .importer-state {
2
- display: none;
3
- }
4
-
5
- .ecwid-importer.state-no-token .importer-state-no-token,
6
- .ecwid-importer.state-woo-initial .importer-state-woo-initial,
7
- .ecwid-importer.state-woo-in-progress .importer-state-woo-in-progress,
8
- .ecwid-importer.state-woo-complete .importer-state-woo-complete
9
- {
10
- display: block;
11
- }
12
-
13
- .ecwid-importer .readonly {
14
- color: lightgray;
15
- }
16
-
17
- .ecwid-importer .readonly input {
18
- background-color: lightgray;
19
- }
20
-
21
- .ecwid-importer .errors {
22
- display: none;
23
- }
24
- .ecwid-importer .errors .btn-details {
25
- cursor: pointer;
26
- }
27
-
28
- .ecwid-importer .errors .details {
29
- display: none;
30
- border: 1px solid gray;
31
- background: rgba(255,255,255,.5);
32
- padding: 5px;
33
  }
34
 
35
- .plan-limit-message {
36
  display: none;
37
  }
38
 
39
- .log-entry, .log-entry-product {
40
- margin-left: 20px;
41
- margin-bottom: 10px;
42
  }
43
 
44
- .log-entry .log-entry-product {
45
  display: none;
46
  }
47
 
48
- .log-entry.expanded .log-entry-product {
49
  display: block;
50
  }
1
+ .settings-page input[type=checkbox]:disabled:before {
2
+ content: '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  }
4
 
5
+ .ec-importer-alert-warning, .ec-importer-alert-warning {
6
  display: none;
7
  }
8
 
9
+ .a-card-stack[data-ec-importer-card-stack], [data-ec-importer-card-stack] .a-card {
10
+ transition: none;
 
11
  }
12
 
13
+ [data-ec-importer-state] {
14
  display: none;
15
  }
16
 
17
+ [data-ec-importer-state="default"] {
18
  display: block;
19
  }
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 Ecommerce
8
- Version: 6.8.9
9
  Author URI: https://ecwid.to/ecwid-site
10
  */
11
 
@@ -71,7 +71,7 @@ if ( is_admin() ) {
71
 
72
  add_action( 'admin_head', 'ecwid_ie8_fonts_inclusion' );
73
  add_action( 'get_footer', 'ecwid_admin_get_footer' );
74
- add_action( 'template_redirect', 'ecwid_process_oauth_params' );
75
  add_action( 'admin_notices', 'ecwid_show_admin_messages' );
76
  add_filter( 'plugin_action_links_' . ECWID_PLUGIN_BASENAME, 'ecwid_plugin_actions' );
77
  add_filter( 'tiny_mce_before_init', 'ecwid_tinymce_init' );
@@ -193,6 +193,7 @@ function ecwid_init_integrations()
193
  'sitepress-multilingual-cms/sitepress.php' => 'wpml',
194
  'pwa/pwa.php' => 'pwa',
195
  'polylang/polylang.php' => 'polylang',
 
196
  );
197
 
198
  $old_wordpress = version_compare( get_bloginfo( 'version' ), '5.0', '<' );
@@ -2023,6 +2024,14 @@ function ecwid_register_admin_styles($hook_suffix) {
2023
  // We already connected and disconnected the store, no need for fancy landing
2024
  wp_enqueue_script('ecwid-connect-js', ECWID_PLUGIN_URL . 'js/dashboard.js', array(), get_option('ecwid_plugin_version'));
2025
  }
 
 
 
 
 
 
 
 
2026
  }
2027
  }
2028
 
@@ -2603,7 +2612,7 @@ function ecwid_get_debug_file() {
2603
 
2604
 
2605
  ecwid_debug_do_page();
2606
- wp_die();
2607
  }
2608
 
2609
  function get_ecwid_store_id() {
5
  Description: Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.
6
  Text Domain: ecwid-shopping-cart
7
  Author: Ecwid Ecommerce
8
+ Version: 6.8.10
9
  Author URI: https://ecwid.to/ecwid-site
10
  */
11
 
71
 
72
  add_action( 'admin_head', 'ecwid_ie8_fonts_inclusion' );
73
  add_action( 'get_footer', 'ecwid_admin_get_footer' );
74
+ add_action( 'admin_init', 'ecwid_process_oauth_params' );
75
  add_action( 'admin_notices', 'ecwid_show_admin_messages' );
76
  add_filter( 'plugin_action_links_' . ECWID_PLUGIN_BASENAME, 'ecwid_plugin_actions' );
77
  add_filter( 'tiny_mce_before_init', 'ecwid_tinymce_init' );
193
  'sitepress-multilingual-cms/sitepress.php' => 'wpml',
194
  'pwa/pwa.php' => 'pwa',
195
  'polylang/polylang.php' => 'polylang',
196
+ 'wp-rocket/wp-rocket.php' => 'wprocket',
197
  );
198
 
199
  $old_wordpress = version_compare( get_bloginfo( 'version' ), '5.0', '<' );
2024
  // We already connected and disconnected the store, no need for fancy landing
2025
  wp_enqueue_script('ecwid-connect-js', ECWID_PLUGIN_URL . 'js/dashboard.js', array(), get_option('ecwid_plugin_version'));
2026
  }
2027
+
2028
+ $pages_with_ecwid_app_ui = array(
2029
+ Ecwid_Import_Page::PAGE_SLUG_WOO,
2030
+ );
2031
+ if( in_array( $_GET['page'], $pages_with_ecwid_app_ui ) ) {
2032
+ wp_enqueue_style('ecwid-app-ui', 'https://djqizrxa6f10j.cloudfront.net/ecwid-sdk/css/1.3.7/ecwid-app-ui.css', array(), get_option('ecwid_plugin_version'));
2033
+ wp_enqueue_script('ecwid-app-ui', 'https://djqizrxa6f10j.cloudfront.net/ecwid-sdk/css/1.3.6/ecwid-app-ui.min.js', array(), get_option('ecwid_plugin_version'), 'in_footer');
2034
+ }
2035
  }
2036
  }
2037
 
2612
 
2613
 
2614
  ecwid_debug_do_page();
2615
+ die();
2616
  }
2617
 
2618
  function get_ecwid_store_id() {
includes/importer/class-ecwid-import-page.php CHANGED
@@ -9,7 +9,7 @@ class Ecwid_Import_Page
9
 
10
  const AJAX_ACTION_CHECK_IMPORT = 'ec-store-check-import';
11
  const AJAX_ACTION_DO_WOO_IMPORT = 'ec-store-do-woo-import';
12
- const ACTION_DO_RECONNECT = 'ec-store-do-reconnect';
13
 
14
  const PARAM_FROM_IMPORT_ONBOARDING = 'from-woo-import-message';
15
 
@@ -21,6 +21,7 @@ class Ecwid_Import_Page
21
  add_action( 'wp_ajax_' . self::AJAX_ACTION_CHECK_IMPORT, array( $this, 'check_import') );
22
  add_action( 'wp_ajax_' . self::AJAX_ACTION_DO_WOO_IMPORT, array( $this, 'do_woo_import') );
23
  add_action( 'current_screen', array( $this, 'do_reconnect') );
 
24
  }
25
 
26
  public function process_woo_onboarding_redirect()
@@ -59,8 +60,8 @@ class Ecwid_Import_Page
59
 
60
  public function enqueue_scripts()
61
  {
62
- wp_enqueue_style( 'ecwid-importer', ECWID_PLUGIN_URL . '/css/importer.css' );
63
- wp_enqueue_script( 'ecwid-importer', ECWID_PLUGIN_URL . '/js/importer.js' );
64
  wp_localize_script( 'ecwid-importer', 'ecwid_importer', array(
65
  'check_token_action' => self::AJAX_ACTION_CHECK_IMPORT,
66
  'do_woo_import_action' => self::AJAX_ACTION_DO_WOO_IMPORT
@@ -184,4 +185,32 @@ class Ecwid_Import_Page
184
  );
185
  }
186
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  }
9
 
10
  const AJAX_ACTION_CHECK_IMPORT = 'ec-store-check-import';
11
  const AJAX_ACTION_DO_WOO_IMPORT = 'ec-store-do-woo-import';
12
+ const ACTION_GET_WOO_IMPORT_LOG = 'ec-store-get-woo-import-log';
13
 
14
  const PARAM_FROM_IMPORT_ONBOARDING = 'from-woo-import-message';
15
 
21
  add_action( 'wp_ajax_' . self::AJAX_ACTION_CHECK_IMPORT, array( $this, 'check_import') );
22
  add_action( 'wp_ajax_' . self::AJAX_ACTION_DO_WOO_IMPORT, array( $this, 'do_woo_import') );
23
  add_action( 'current_screen', array( $this, 'do_reconnect') );
24
+ add_action( 'admin_post_' . self::ACTION_GET_WOO_IMPORT_LOG, array( $this, 'get_woo_import_log') );
25
  }
26
 
27
  public function process_woo_onboarding_redirect()
60
 
61
  public function enqueue_scripts()
62
  {
63
+ wp_enqueue_style( 'ecwid-importer', ECWID_PLUGIN_URL . 'css/importer.css' );
64
+ wp_enqueue_script( 'ecwid-importer', ECWID_PLUGIN_URL . 'js/importer.js' );
65
  wp_localize_script( 'ecwid-importer', 'ecwid_importer', array(
66
  'check_token_action' => self::AJAX_ACTION_CHECK_IMPORT,
67
  'do_woo_import_action' => self::AJAX_ACTION_DO_WOO_IMPORT
185
  );
186
  }
187
  }
188
+
189
+ public function get_woo_import_log() {
190
+ if (!current_user_can('manage_options')) {
191
+ return;
192
+ }
193
+
194
+ header("Content-Disposition: attachment; filename=ec-woo-import-log.txt");
195
+
196
+ $error_log = get_option( Ecwid_Importer::OPTION_ERROR_LOG, false );
197
+
198
+ if( !$error_log ) {
199
+ die();
200
+ }
201
+
202
+ foreach ($error_log as $type => $messages) {
203
+ echo sprintf( "ERROR TYPE: %s\r\n", $type );
204
+
205
+ foreach ($messages as $message => $data) {
206
+ echo "*** \r\n";
207
+ echo $message . "\r\n";
208
+ echo 'Data: ' . var_export($data, true) . "\r\n";
209
+ }
210
+
211
+ echo "\r\n";
212
+ }
213
+
214
+ die();
215
+ }
216
  }
includes/importer/class-ecwid-importer.php CHANGED
@@ -10,6 +10,7 @@ class Ecwid_Importer
10
  const OPTION_WOO_CATALOG_IMPORTED = 'ecwid_imported_from_woo';
11
  const OPTION_SETTINGS = 'ecwid_importer_settings';
12
  const OPTION_DEMO_PRODUCTS = 'woo_importer_demo_products';
 
13
 
14
  const TICK_LENGTH = 20;
15
 
@@ -30,10 +31,17 @@ class Ecwid_Importer
30
  update_option( self::OPTION_PRODUCTS, array() );
31
  update_option( self::OPTION_TASKS, array() );
32
  update_option( self::OPTION_STATUS, array() );
 
33
  $this->_start();
34
 
35
  $api = new Ecwid_Api_V3();
 
 
 
 
 
36
  $this->_set_settings( $settings );
 
37
  $this->_maybe_set_forced_settings();
38
  $this->_set_tasks(array());
39
 
@@ -122,7 +130,10 @@ class Ecwid_Importer
122
  } else {
123
  $progress['success'][] = $task_data['type'];
124
  }
125
- update_option( self::OPTION_STATUS, $status );
 
 
 
126
  } else {
127
  $progress['error'][] = $task_data['type'];
128
  $progress['plan_limit_hit'][] = $task_data['type'];
@@ -171,6 +182,15 @@ class Ecwid_Importer
171
  }
172
  }
173
 
 
 
 
 
 
 
 
 
 
174
  if( $progress['status'] == 'in_progress' ) {
175
  $progress['tasks'] = $this->_tasks;
176
  return $progress;
@@ -178,13 +198,19 @@ class Ecwid_Importer
178
 
179
  $this->_set_tasks( null );
180
 
 
 
 
 
 
 
181
  $progress['status'] = 'complete';
182
 
183
  update_option( self::OPTION_WOO_CATALOG_IMPORTED, 'true' );
184
 
185
  return $progress;
186
  }
187
-
188
 
189
  public function append_batch( $batch_item ) {
190
  $this->_batch[] = $batch_item;
10
  const OPTION_WOO_CATALOG_IMPORTED = 'ecwid_imported_from_woo';
11
  const OPTION_SETTINGS = 'ecwid_importer_settings';
12
  const OPTION_DEMO_PRODUCTS = 'woo_importer_demo_products';
13
+ const OPTION_ERROR_LOG = 'ecwid_importer_error_log';
14
 
15
  const TICK_LENGTH = 20;
16
 
31
  update_option( self::OPTION_PRODUCTS, array() );
32
  update_option( self::OPTION_TASKS, array() );
33
  update_option( self::OPTION_STATUS, array() );
34
+ update_option( self::OPTION_ERROR_LOG, array() );
35
  $this->_start();
36
 
37
  $api = new Ecwid_Api_V3();
38
+
39
+ $settings = array(
40
+ self::SETTING_UPDATE_BY_SKU => true,
41
+ self::SETTING_DELETE_DEMO => true
42
+ );
43
  $this->_set_settings( $settings );
44
+
45
  $this->_maybe_set_forced_settings();
46
  $this->_set_tasks(array());
47
 
130
  } else {
131
  $progress['success'][] = $task_data['type'];
132
  }
133
+
134
+ if( is_array($status['plan_limit']) && count($status['plan_limit']) ) {
135
+ update_option( self::OPTION_STATUS, $status );
136
+ }
137
  } else {
138
  $progress['error'][] = $task_data['type'];
139
  $progress['plan_limit_hit'][] = $task_data['type'];
182
  }
183
  }
184
 
185
+ if( isset( $progress['error_messages'] ) ) {
186
+ $error_log = get_option( self::OPTION_ERROR_LOG, array() );
187
+
188
+ if( count($error_log) ) {
189
+ $progress['error_messages'] = array_merge( $progress['error_messages'], $error_log );
190
+ }
191
+ update_option( self::OPTION_ERROR_LOG, $progress['error_messages'] );
192
+ }
193
+
194
  if( $progress['status'] == 'in_progress' ) {
195
  $progress['tasks'] = $this->_tasks;
196
  return $progress;
198
 
199
  $this->_set_tasks( null );
200
 
201
+ $status = get_option( self::OPTION_STATUS, array() );
202
+ if( isset($status['plan_limit']) ) {
203
+ $progress['plan_limit_hit'] = $status['plan_limit'];
204
+ }
205
+
206
+ $progress['error_messages'] = get_option( self::OPTION_ERROR_LOG, array() );
207
  $progress['status'] = 'complete';
208
 
209
  update_option( self::OPTION_WOO_CATALOG_IMPORTED, 'true' );
210
 
211
  return $progress;
212
  }
213
+
214
 
215
  public function append_batch( $batch_item ) {
216
  $this->_batch[] = $batch_item;
includes/importer/task/class-ecwid-importer-task-batch-status.php CHANGED
@@ -31,9 +31,7 @@ class Ecwid_Importer_Task_Batch_Status extends Ecwid_Importer_Task_Product_Base
31
  }
32
 
33
  if ( $batch->status == self::STATUS_COMPLETED ) {
34
-
35
- $status = get_option( Ecwid_Importer::OPTION_STATUS, array( 'plan_limit' => array() ) );
36
-
37
  foreach($batch->responses as $response) {
38
 
39
  $params = explode( '|', $response->id );
@@ -72,6 +70,8 @@ class Ecwid_Importer_Task_Batch_Status extends Ecwid_Importer_Task_Product_Base
72
 
73
  if ( $response->httpStatusCode == 402 ) {
74
  $status['plan_limit'][$type] = true;
 
 
75
  }
76
 
77
  continue;
@@ -84,6 +84,11 @@ class Ecwid_Importer_Task_Batch_Status extends Ecwid_Importer_Task_Product_Base
84
  $ecwid_id = $response->httpBody->id;
85
 
86
  if ($type == 'create_product' ) {
 
 
 
 
 
87
  update_post_meta( $woo_id, '_ecwid_product_id', $ecwid_id );
88
  $exporter->save_ecwid_product_id( $woo_id, $ecwid_id );
89
 
@@ -97,12 +102,38 @@ class Ecwid_Importer_Task_Batch_Status extends Ecwid_Importer_Task_Product_Base
97
  }
98
 
99
  if ($type == 'create_variation' ) {
100
- update_post_meta( $woo_id, '_ecwid_variation_id', $ecwid_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  }
102
 
103
  }
104
-
105
- update_option( Ecwid_Importer::OPTION_STATUS, $status );
106
  }
107
 
108
  if( isset( $task_data['timeout'] ) && $task_data['timeout'] > 0 ) {
31
  }
32
 
33
  if ( $batch->status == self::STATUS_COMPLETED ) {
34
+
 
 
35
  foreach($batch->responses as $response) {
36
 
37
  $params = explode( '|', $response->id );
70
 
71
  if ( $response->httpStatusCode == 402 ) {
72
  $status['plan_limit'][$type] = true;
73
+ update_option( Ecwid_Importer::OPTION_STATUS, $status );
74
+ // $exporter->_batch_progress['plan_limit_hit'][] = $type;
75
  }
76
 
77
  continue;
84
  $ecwid_id = $response->httpBody->id;
85
 
86
  if ($type == 'create_product' ) {
87
+
88
+ if( isset($response->httpBody->updateCount) ) {
89
+ $ecwid_id = $params[2];
90
+ }
91
+
92
  update_post_meta( $woo_id, '_ecwid_product_id', $ecwid_id );
93
  $exporter->save_ecwid_product_id( $woo_id, $ecwid_id );
94
 
102
  }
103
 
104
  if ($type == 'create_variation' ) {
105
+
106
+ $variation_id = $params[2];
107
+
108
+ $p = wc_get_product( $woo_id );
109
+ if ( $p instanceof WC_Product_Variable ) {
110
+
111
+ $vars = $p->get_available_variations();
112
+
113
+ foreach ( $vars as $var ) {
114
+ if( $variation_id != $var['variation_id'] ) {
115
+ continue;
116
+ }
117
+
118
+ if ( $var['image_id'] && $var['image_id'] != $p->get_image_id() ) {
119
+
120
+ $exporter->append_task(
121
+ Ecwid_Importer_Task_Upload_Product_Variation_Image::build(
122
+ array(
123
+ 'product_id' => $woo_id,
124
+ 'variation_id' => $var['variation_id']
125
+ )
126
+ )
127
+ );
128
+ }
129
+
130
+ update_post_meta( $var['variation_id'], '_ecwid_variation_id', $ecwid_id );
131
+ }
132
+ }
133
+
134
  }
135
 
136
  }
 
 
137
  }
138
 
139
  if( isset( $task_data['timeout'] ) && $task_data['timeout'] > 0 ) {
includes/importer/task/class-ecwid-importer-task-create-product-variation.php CHANGED
@@ -63,7 +63,7 @@ class Ecwid_Importer_Task_Create_Product_Variation extends Ecwid_Importer_Task_P
63
  break;
64
  }
65
 
66
- $batch_item_id = self::$type . '|' . $this->_woo_product_id;
67
 
68
  $batch_item = $api->batch_create_product_variation( $variation_data, $this->_ecwid_product_id, $batch_item_id );
69
  $exporter->append_batch( $batch_item );
63
  break;
64
  }
65
 
66
+ $batch_item_id = self::$type . '|' . $this->_woo_product_id . '|' . $data['variation_id'];
67
 
68
  $batch_item = $api->batch_create_product_variation( $variation_data, $this->_ecwid_product_id, $batch_item_id );
69
  $exporter->append_batch( $batch_item );
includes/importer/task/class-ecwid-importer-task-delete-products.php CHANGED
@@ -5,13 +5,42 @@ class Ecwid_Importer_Task_Delete_Products extends Ecwid_Importer_Task
5
  public static $type = 'delete_products';
6
 
7
  public function execute( Ecwid_Importer $exporter, array $data ) {
8
- $api = new Ecwid_Api_V3();
9
-
10
  $ids = $data['ids'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- $result = $api->delete_products( $ids );
 
 
13
 
14
- return self::_process_api_result( $result, $data );
15
  }
16
 
17
  public static function build( array $ids ) {
5
  public static $type = 'delete_products';
6
 
7
  public function execute( Ecwid_Importer $exporter, array $data ) {
8
+
 
9
  $ids = $data['ids'];
10
+ $exporter->clear_batch();
11
+
12
+ foreach ( $ids as $id ) {
13
+ $api = new Ecwid_Api_V3();
14
+ $batch_item = null;
15
+
16
+ $batch_item_id = self::$type . '|' . $id;
17
+ $batch_item = $api->batch_delete_product( $id, $batch_item_id );
18
+
19
+ $exporter->append_batch( $batch_item );
20
+ }
21
+
22
+ $batch = $exporter->get_batch();
23
+ if( count( $batch ) ) {
24
+
25
+ $api = new Ecwid_Api_V3();
26
+ $result = $api->create_batch( $batch );
27
+
28
+ if( $result['response']['code'] == '200' ) {
29
+
30
+ $data = json_decode( $result['body'] );
31
+ $ticket = $data->ticket;
32
+
33
+ $exporter->append_child(
34
+ Ecwid_Importer_Task_Batch_Status::build(
35
+ array( 'ticket' => $ticket )
36
+ )
37
+ );
38
 
39
+ $exporter->clear_batch();
40
+ }
41
+ }
42
 
43
+ return $this->_result_success();
44
  }
45
 
46
  public static function build( array $ids ) {
includes/importer/task/class-ecwid-importer-task-import-woo-product.php CHANGED
@@ -42,17 +42,6 @@ class Ecwid_Importer_Task_Import_Woo_Product extends Ecwid_Importer_Task_Product
42
  )
43
  )
44
  );
45
-
46
- if ( $var['image_id'] && $var['image_id'] != $p->get_image_id() ) {
47
- $importer->append_task(
48
- Ecwid_Importer_Task_Upload_Product_Variation_Image::build(
49
- array(
50
- 'product_id' => $product['woo_id'],
51
- 'variation_id' => $var['variation_id']
52
- )
53
- )
54
- );
55
- }
56
  }
57
  }
58
 
42
  )
43
  )
44
  );
 
 
 
 
 
 
 
 
 
 
 
45
  }
46
  }
47
 
includes/importer/task/class-ecwid-importer-task-import-woo-products-batch.php CHANGED
@@ -23,6 +23,7 @@ class Ecwid_Importer_Task_Import_Woo_Products_Batch extends Ecwid_Importer_Task
23
 
24
  $api = new Ecwid_Api_V3();
25
  $batch_item = null;
 
26
 
27
  $task_create_product = new Ecwid_Importer_Task_Create_Product();
28
  $data = $task_create_product->get_batch_data( $importer, $id );
@@ -36,7 +37,15 @@ class Ecwid_Importer_Task_Import_Woo_Products_Batch extends Ecwid_Importer_Task
36
 
37
  if ( $ecwid_products->total > 0 ) {
38
  $ecwid_id = $ecwid_products->items[0]->id;
 
 
 
39
  $batch_item = $api->batch_update_product( $data, $ecwid_id, $batch_item_id );
 
 
 
 
 
40
  }
41
  }
42
 
@@ -45,6 +54,10 @@ class Ecwid_Importer_Task_Import_Woo_Products_Batch extends Ecwid_Importer_Task
45
  }
46
 
47
  $importer->append_batch( $batch_item );
 
 
 
 
48
  }
49
 
50
  $batch = $importer->get_batch();
23
 
24
  $api = new Ecwid_Api_V3();
25
  $batch_item = null;
26
+ $batch_item_gallery = null;
27
 
28
  $task_create_product = new Ecwid_Importer_Task_Create_Product();
29
  $data = $task_create_product->get_batch_data( $importer, $id );
37
 
38
  if ( $ecwid_products->total > 0 ) {
39
  $ecwid_id = $ecwid_products->items[0]->id;
40
+
41
+ $batch_item_id .= '|' . $ecwid_id;
42
+
43
  $batch_item = $api->batch_update_product( $data, $ecwid_id, $batch_item_id );
44
+
45
+ if( count($ecwid_products->items[0]->galleryImages) > 0 ) {
46
+ $batch_item_gallery_id = 'delete_all_gallery_image|' . $ecwid_id;
47
+ $batch_item_gallery = $api->batch_delete_all_gallery_image( $ecwid_id, $batch_item_gallery_id );
48
+ }
49
  }
50
  }
51
 
54
  }
55
 
56
  $importer->append_batch( $batch_item );
57
+
58
+ if ( $batch_item_gallery ) {
59
+ $importer->append_batch( $batch_item_gallery );
60
+ }
61
  }
62
 
63
  $batch = $importer->get_batch();
includes/importer/task/class-ecwid-importer-task-upload-product-gallery-image.php CHANGED
@@ -14,7 +14,7 @@ class Ecwid_Importer_Task_Upload_Product_Gallery_Image extends Ecwid_Importer_Ta
14
  return array(
15
  'status' => 'error',
16
  'data' => 'skipped',
17
- 'message' => 'Parent product was not imported'
18
  );
19
  }
20
 
14
  return array(
15
  'status' => 'error',
16
  'data' => 'skipped',
17
+ 'message' => 'Parent product was not imported #' . $this->_woo_product_id
18
  );
19
  }
20
 
includes/integrations/class-ecwid-integration-autoptimize.php CHANGED
@@ -23,11 +23,13 @@ class Ecwid_Integration_Autoptimize
23
  }
24
 
25
  public function hook_js_exclude($exclude) {
26
- $code = ecwid_get_search_js_code();
27
 
28
- if ( Ecwid_Static_Page::is_enabled_static_home_page() ) {
29
- $code .= ", " . Ecwid_Static_Page::HANDLE_STATIC_PAGE . ".js";
30
- }
 
 
31
 
32
  return $exclude . ", $code";
33
  }
23
  }
24
 
25
  public function hook_js_exclude($exclude) {
26
+ $code= ecwid_get_search_js_code();
27
 
28
+ $code .= ', ecwid_html, ecwid_body';
29
+
30
+ $code .= ", " . Ecwid_Static_Page::HANDLE_STATIC_PAGE . ".js";
31
+ $code .= ", EcStaticPageUtils";
32
+ $code .= ", createClass";
33
 
34
  return $exclude . ", $code";
35
  }
includes/integrations/class-ecwid-integration-wprocket.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecwid_Integration_WPRocket
4
+ {
5
+ public function __construct()
6
+ {
7
+ add_filter( 'rocket_excluded_inline_js_content', array( $this, 'hook_excluded_inline_js' ) );
8
+ }
9
+
10
+ public function hook_excluded_inline_js($inline_js) {
11
+ $code = ecwid_get_search_js_code();
12
+
13
+ if ( Ecwid_Static_Page::is_enabled_static_home_page() ) {
14
+ $exclude_defer_js[] = 'EcStaticPageUtils';
15
+ $exclude_defer_js[] = 'window.ec.storefront';
16
+ } else {
17
+ $exclude_defer_js[] = 'createClass';
18
+ }
19
+
20
+ return $exclude_defer_js;
21
+ }
22
+ }
23
+
24
+ $ecwid_integration_wprocket = new Ecwid_Integration_WPRocket();
js/frontend.js CHANGED
@@ -13,13 +13,17 @@ jQuery(document).ready(function() {
13
 
14
  var page = jQuery(this).data('ecwid-page');
15
  if (page == '/') {
 
 
 
 
16
  var id = jQuery('[data-ecwid-default-category-id]').data('ecwid-default-category-id');
17
  if (id) {
18
  Ecwid.openPage('category', {id:id});
19
  } else {
20
  Ecwid.openPage('category', 0);
21
  }
22
- } if (page == 'category' ) {
23
  if (ecwidParams.useJsApiToOpenStoreCategoriesPages) {
24
  Ecwid.openPage('category', {id:jQuery(this).data('ecwid-category-id')});
25
  jQuery(this).hide().blur().show();
13
 
14
  var page = jQuery(this).data('ecwid-page');
15
  if (page == '/') {
16
+ if (!ecwidParams.useJsApiToOpenStoreCategoriesPages) {
17
+ return;
18
+ }
19
+
20
  var id = jQuery('[data-ecwid-default-category-id]').data('ecwid-default-category-id');
21
  if (id) {
22
  Ecwid.openPage('category', {id:id});
23
  } else {
24
  Ecwid.openPage('category', 0);
25
  }
26
+ } else if (page == 'category' ) {
27
  if (ecwidParams.useJsApiToOpenStoreCategoriesPages) {
28
  Ecwid.openPage('category', {id:jQuery(this).data('ecwid-category-id')});
29
  jQuery(this).hide().blur().show();
js/importer.js CHANGED
@@ -1,325 +1,153 @@
1
- /* var sample = {"success":["main","import-woo-categories","create_category","create_category","upload_category_image","upload_category_image","import-woo-products","import-woo-products-batch","import-woo-product","import-woo-product","import-woo-product","create_product","create_product","create_variation","create_variation"],"error":["create_product","create_variation","create_variation","create_variation","create_variation","create_variation"],"total":21,"current":20,"error_messages":{"create_product":{"400 Bad Request:Negative numbers are not allowed: -4.0":[{"woo_id":21,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=21&action=edit","name":"neg price"}]},"create_variation":{"400 Bad Request:Stock settings are not same for product and combination. Please set the combination's SKU":[{"woo_id":9,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=9&action=edit","name":"test","ecwid_id":139559751,"ecwid_link":"http://localhost/wordpress/woocommerce/wp-admin/admin.php?page=ec-store&ec-store-page=product%3Amode%3Dedit%26id%3D139559751","variation_id":14},{"woo_id":9,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=9&action=edit","name":"test","ecwid_id":139559751,"ecwid_link":"http://localhost/wordpress/woocommerce/wp-admin/admin.php?page=ec-store&ec-store-page=product%3Amode%3Dedit%26id%3D139559751","variation_id":15},{"woo_id":9,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=9&action=edit","name":"test","ecwid_id":139559751,"ecwid_link":"http://localhost/wordpress/woocommerce/wp-admin/admin.php?page=ec-store&ec-store-page=product%3Amode%3Dedit%26id%3D139559751","variation_id":16}],"409 Conflict:New combination duplicates existing combination or the base product: {}":[{"woo_id":11,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=11&action=edit","name":"Test Var atts without value","ecwid_id":139559752,"ecwid_link":"http://localhost/wordpress/woocommerce/wp-admin/admin.php?page=ec-store&ec-store-page=product%3Amode%3Dedit%26id%3D139559752","variation_id":20}],"409 Conflict:New combination duplicates existing combination or the base product: {size**ZZZ=l}":[{"woo_id":11,"woo_link":"http://localhost/wordpress/woocommerce/wp-admin/post.php?post=11&action=edit","name":"Test Var atts without value","ecwid_id":139559752,"ecwid_link":"http://localhost/wordpress/woocommerce/wp-admin/admin.php?page=ec-store&ec-store-page=product%3Amode%3Dedit%26id%3D139559752","variation_id":12}]}},"status":"complete"}
2
- jQuery(document).ready(function() {
3
- jQuery('h2').after(renderImportLog(buildImportLog(sample)));
4
-
5
- });
6
-
7
- */
8
 
9
- function renderImportLog(log) {
10
- var logContainer = jQuery('<div>');
11
- for ( var type in log ) {
12
-
13
- var entryTypeContainer = jQuery('<div>').append('<h4>' + type + '</h4>').appendTo(logContainer);
14
- entryTypeContainer.append(
15
- renderImportLogEntryType(type, log[type])
16
- ).appendTo(logContainer);
17
- }
18
-
19
- return logContainer;
20
- }
21
- function renderImportLogEntryType(type, data) {
22
-
23
- var items = [];
24
- for ( var error in data ) {
25
- var item = jQuery('<div class="log-entry">');
26
- var code = error.substr(0, error.indexOf(':'));
27
- var errorText = error.substr(error.indexOf(':') + 1);
28
- item.append('<div class="hidden">' + code + '</div>').append(errorText);
29
- item.append(' ');
30
- jQuery('<a href="#">')
31
- .append('(' + Object.keys(data[error]).length + " total)" )
32
- .click(function() {jQuery(this).closest('.log-entry').toggleClass('expanded'); return false;})
33
- .appendTo(item);
34
-
35
- item.append( renderProductLogEntries(data[error]) );
36
-
37
- items[items.length] = item;
38
- }
39
- return items;
40
- }
41
-
42
- function renderProductLogEntries(data) {
43
- var products = [];
44
- for ( var i in data ) {
45
- var entry = data[i];
46
- var productContainer = jQuery('<div class="log-entry-product">');
47
-
48
- var woo_link = jQuery('<a>').attr('href', entry.woo_link).append(entry.name).appendTo(productContainer);
49
 
50
- if (entry.ecwid_link) {
51
- var ecwid_link = jQuery('<a>').attr('href', entry.ecwid_link).append("Product at Ecwid");
52
- productContainer.append(' (').append(ecwid_link).append( ' )');
53
- }
54
-
55
- if ( typeof entry.variations == 'array' && entry.variations.length > 0 ) {
56
- productContainer.append(" Variations ");
57
- for ( var j = 0; j < entry.variations.length; j++ ) {
58
- productContainer.append('#' + entry.variations[j]);
59
-
60
- if ( j + 1 < entry.variations.length ) {
61
- productContainer.append(', ');
62
- }
 
 
 
63
  }
64
- }
65
- products[products.length] = productContainer;
66
  }
67
-
68
- return products;
69
- }
70
 
71
- function buildImportLog(data) {
72
-
73
- var log = {};
74
-
75
- for ( var type in data.error_messages) {
76
- if ( typeof log[type] == 'undefined' ) {
77
- log[type] = {};
78
- }
79
-
80
- for ( var message in data.error_messages[type] ) {
81
- if ( typeof log[type][message] == 'undefined' ) {
82
- log[type][message] = [];
83
- }
84
- log[type][message].concat( buildProductErrorLog( log[type][message], data.error_messages[type][message] ) );
85
- }
86
- }
87
-
88
- return log;
89
- }
90
 
91
- function buildProductErrorLog(log, items) {
92
-
93
- for (var i = 0; i < items.length; i++) {
94
- var item = items[i];
95
- if (!log[item.woo_id]) {
96
- var entry = {
97
- name: item.name,
98
- type: 'variation',
99
- woo_link: item.woo_link,
100
- ecwid_link: item.ecwid_link,
101
- variations: []
102
- };
103
- } else {
104
- entry = log[item.woo_id];
105
- }
106
-
107
- if ( item.variation_id ) {
108
- entry.variations[entry.variations.length] = item.variation_id;
109
  }
110
- log[item.woo_id] = entry;
111
- }
112
-
113
- return log;
114
- }
115
 
116
- jQuery(document).ready(function() {
117
- $wrapper = jQuery('.ecwid-importer');
118
-
119
- var status = {
120
- 'success' : [],
121
- 'error': [],
122
- 'errorMessages': {},
123
- 'planLimitHit': false
124
- };
125
-
126
- jQuery('#reconnect-button').click(function() {
127
- var url = this.href;
128
- var settings = {};
129
- jQuery('input[type=checkbox].import-settings').each(function(idx, el) {
130
- if (el.checked) {
131
- settings[el.name] = true;
132
- }
133
- });
134
-
135
- for ( var i in settings ) {
136
- url += '&' + i + '=true';
137
- }
138
-
139
- location.href = url;
140
-
141
- return false;
142
- });
143
-
144
-
145
- jQuery('#ecwid-importer-woo').click(function() {
146
-
147
- window.location.hash="woo";
148
-
149
- jQuery.getJSON(ajaxurl, { action: ecwid_importer.check_token_action }, function(data) {
150
- if (data.has_good_token == false) {
151
- $wrapper.removeClass('state-landing').addClass('state-no-token');
152
- } else {
153
- $wrapper.removeClass('state-landing').addClass('state-woo');
154
- jQuery('.ecwid-total-products', '.state-woo').text(data.ecwid_total_products);
155
- jQuery('.ecwid-total-categories', '.state-woo').text(data.ecwid_total_categories);
156
- jQuery('.woo-total-products', '.state-woo').text(data.woo_total_products);
157
- jQuery('.woo-total-categories', '.state-woo').text(data.woo_total_categories);
158
- }
159
- console.log(data);
160
- })
161
- .done(function() {
162
- console.log( "second success" );
163
- })
164
- .fail(function() {
165
- console.log( "error" );
166
- })
167
- .always(function() {
168
- console.log( "complete" );
169
- });
170
- });
171
 
172
- startWooImport = function() {
173
- $wrapper.removeClass('state-woo-initial').addClass('state-woo-in-progress');
174
- jQuery('input[type=checkbox].import-settings').attr('onclick', 'return false').closest('label').addClass('readonly');
175
 
176
- var settings = {};
177
- jQuery('input[type=checkbox].import-settings').each(function(idx, el) {
178
- if (el.checked) {
179
- settings[el.name] = true;
180
- }
181
- jQuery(el).attr('onclick', 'return false').closest('label').addClass('readonly');
182
- });
183
-
184
- do_import = function (start = null) {
185
-
186
- var data = {'action': ecwid_importer.do_woo_import_action, settings: settings};
187
- if (start) {
188
- data.reset = 1
189
- }
190
- jQuery.ajax({
191
- 'url': ajaxurl,
192
- 'data': data,
193
- 'success': function(json) {
194
- try {
195
- data = jQuery.parseJSON(json);
196
- } catch(e) {
197
- status.errorMessages['json_failed'] = [];
198
- status.errorMessages['json_failed'][json] = 1;
199
- doImportComplete(status);
200
- }
201
-
202
- processImportProgress(data);
203
- },
204
- 'error': function(jqXHR, textStatus, errorThrown) {
205
- status.errorMessages[textStatus] = [];
206
- status.errorMessages[textStatus][errorThrown] = 1;
207
- doImportComplete(status);
208
- }
209
- });
210
- };
211
 
212
- processImportProgress = function (data) {
213
-
214
- for (var i = 0; i < data.success.length; i++) {
215
- if (typeof status.success[data.success[i]] == 'undefined') {
216
- status.success[data.success[i]] = 1;
217
- } else {
218
- status.success[data.success[i]]++;
219
- }
220
- }
221
 
 
 
222
 
223
- for (var i = 0; i < data.error.length; i++) {
224
- if (typeof status.error[data.error[i]] == 'undefined') {
225
- status.error[data.error[i]] = 1;
226
- } else {
227
- status.error[data.error[i]]++;
228
- }
229
- }
230
 
231
- status.planLimitHit |= typeof data.plan_limit_hit != 'undefined';
 
 
 
232
 
233
- if (data.error_messages) {
234
- for (var import_type in data.error_messages) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
 
236
- var messages = data.error_messages[import_type];
237
 
238
- if ( !status.errorMessages[import_type] ) {
239
- status.errorMessages[import_type] = {};
240
- }
241
 
242
- for ( var message in messages ) {
243
- if ( !status.errorMessages[import_type].hasOwnProperty(message) ) {
244
- status.errorMessages[import_type][message] = '';
245
- }
 
 
 
246
 
247
- status.errorMessages[import_type][message] += messages[message];
 
 
 
 
 
 
248
 
 
249
 
250
- }
251
- }
252
- }
253
 
254
- jQuery('#import-progress-current').text((status.success.create_category || 0) + (status.success.create_product || 0));
255
 
256
- if (data.status == 'complete') {
 
 
257
 
258
- doImportComplete(data, status);
259
- } else {
260
- do_import();
261
- }
262
- }
263
-
264
- do_import( true );
265
 
266
- doImportComplete = function( data, status ) {
267
- jQuery('#import-results-products').text(status.success.create_product || 0);
268
- jQuery('#import-results-categories').text(status.success.create_category || 0);
269
- $wrapper.removeClass('state-woo-in-progress').addClass('state-woo-complete');
270
 
271
- if (status.planLimitHit) {
272
- jQuery('plan-limit-message').show();
273
- }
274
-
275
- var log = buildImportLog(data);
276
- jQuery('#fancy-errors').append(renderImportLog(log));
277
 
278
- for(var type in log) {
279
- delete status.errorMessages[type];
280
- }
 
 
 
281
 
282
- var errorContent = '';
283
- for (var importType in status.errorMessages) {
284
- errorContent += importType + "\n";
285
- for (var message in status.errorMessages[importType]) {
286
- errorContent += ' ' + message + ':' + status.errorMessages[importType][message] + "\n";
287
- }
288
- }
289
-
290
- if (errorContent.length > 0) {
291
- jQuery('.ecwid-importer .errors').find('pre').text(errorContent).show();
292
- }
293
-
294
- if ( jQuery('pre.details').text().length || jQuery('#fancy-errors').text().length) {
295
- jQuery('.ecwid-importer .errors').show();
296
- }
297
- }
298
- };
299
-
300
- jQuery('#ecwid-importer-woo-go').click(startWooImport);
301
 
302
- jQuery('.ecwid-importer .errors .btn-details').click(function() {
303
- jQuery('.ecwid-importer .errors .details').each(function(idx, el) {if (jQuery(el).text().length) jQuery(el).toggle() });
304
- });
305
-
306
 
307
- if (window.location.hash.indexOf('start') != -1) {
308
-
309
- var params = location.hash.split('&');
310
-
311
- for ( var i in params ){
312
- var name = params[i].split('=');
313
- name = name[0];
314
-
315
- var el = jQuery( 'input[name="' + name + '"]' );
316
- if ( el.length == 1 ) {
317
- el.prop('checked', true);
318
  }
 
 
319
  }
 
 
 
 
 
320
 
 
 
321
  window.location.hash = '';
322
-
323
  startWooImport();
324
  }
325
  });
 
 
 
 
 
 
 
1
 
2
+ jQuery(document).ready(function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
+ var status = {
5
+ 'success' : [],
6
+ 'error': [],
7
+ 'errorMessages': {},
8
+ 'planLimitHit': false
9
+ };
10
+
11
+ switchWooImportState = function( state ) {
12
+ jQuery('[data-ec-importer-state]').hide();
13
+ jQuery('[data-ec-importer-state=' + state +']').show();
14
+
15
+ jQuery('[data-ec-importer-card-stack]').each(function(){
16
+ if( jQuery(this).find('.a-card:visible').length > 1 ) {
17
+ jQuery(this).addClass('a-card-stack');
18
+ } else {
19
+ jQuery(this).removeClass('a-card-stack');
20
  }
21
+ });
 
22
  }
 
 
 
23
 
24
+ showWooImportAlert = function( alert_type ) {
25
+ var block = jQuery('#ec-importer-alert'),
26
+ block_status = 'success';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
+ if( alert_type == 'warning' || alert_type == 'limit' ) {
29
+ block_status = 'warning';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  }
 
 
 
 
 
31
 
32
+ block.find('[data-ec-importer-alert]').hide();
33
+ block.find('[data-ec-importer-alert=' + block_status +']').show();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
+ block.addClass( 'a-card--' + block_status );
36
+ block.find('.iconable-block').addClass( 'iconable-block--' + block_status );
 
37
 
38
+ if( alert_type == 'limit' ) {
39
+ block.find('[data-ec-importer-alert=limit]').show();
40
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
+ block.show();
43
+ }
 
 
 
 
 
 
 
44
 
45
+ startWooImport = function() {
46
+ var settings = {};
47
 
48
+ do_import = function (start = null) {
49
+ switchWooImportState('process');
 
 
 
 
 
50
 
51
+ var data = {'action': ecwid_importer.do_woo_import_action, settings: settings};
52
+ if (start) {
53
+ data.reset = 1
54
+ }
55
 
56
+ jQuery.ajax({
57
+ 'url': ajaxurl,
58
+ 'data': data,
59
+ 'success': function(json) {
60
+ try {
61
+ data = jQuery.parseJSON(json);
62
+ processImportProgress(data);
63
+ } catch(e) {
64
+ status.errorMessages['json_failed'] = [];
65
+ status.errorMessages['json_failed'][json] = 1;
66
+ doImportComplete(status);
67
+ }
68
+ },
69
+ 'error': function(jqXHR, textStatus, errorThrown) {
70
+ status.errorMessages[textStatus] = [];
71
+ status.errorMessages[textStatus][errorThrown] = 1;
72
+ doImportComplete(status);
73
+ }
74
+ });
75
+ };
76
 
77
+ do_import( true );
78
 
79
+ processImportProgress = function (data) {
 
 
80
 
81
+ for (var i = 0; i < data.success.length; i++) {
82
+ if (typeof status.success[data.success[i]] == 'undefined') {
83
+ status.success[data.success[i]] = 1;
84
+ } else {
85
+ status.success[data.success[i]]++;
86
+ }
87
+ }
88
 
89
+ for (var i = 0; i < data.error.length; i++) {
90
+ if (typeof status.error[data.error[i]] == 'undefined') {
91
+ status.error[data.error[i]] = 1;
92
+ } else {
93
+ status.error[data.error[i]]++;
94
+ }
95
+ }
96
 
97
+ status.planLimitHit |= typeof data.plan_limit_hit != 'undefined';
98
 
99
+ if (data.error_messages) {
100
+ for (var import_type in data.error_messages) {
 
101
 
102
+ var messages = data.error_messages[import_type];
103
 
104
+ if ( !status.errorMessages[import_type] ) {
105
+ status.errorMessages[import_type] = {};
106
+ }
107
 
108
+ for ( var message in messages ) {
109
+ if ( !status.errorMessages[import_type].hasOwnProperty(message) ) {
110
+ status.errorMessages[import_type][message] = '';
111
+ }
 
 
 
112
 
113
+ status.errorMessages[import_type][message] += messages[message];
114
+ }
115
+ }
116
+ }
117
 
118
+ jQuery('#import-progress-current').text((status.success.create_category || 0) + (status.success.create_product || 0));
 
 
 
 
 
119
 
120
+ if (data.status == 'complete') {
121
+ doImportComplete(status);
122
+ } else {
123
+ do_import();
124
+ }
125
+ }
126
 
127
+ doImportComplete = function( status ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
+ jQuery('#import-results-products').text(status.success.create_product || 0);
130
+ jQuery('#import-results-categories').text(status.success.create_category || 0);
 
 
131
 
132
+ if (status.planLimitHit) {
133
+ showWooImportAlert( 'limit' );
134
+ } else if ( Object.keys( status.error ).length > 0 || Object.keys( status.errorMessages ).length > 0 ) {
135
+ showWooImportAlert( 'warning' );
136
+ } else {
137
+ showWooImportAlert( 'success' );
 
 
 
 
 
138
  }
139
+
140
+ switchWooImportState( 'complete' );
141
  }
142
+ };
143
+
144
+ jQuery('#ec-importer-woo-go').click(function(){
145
+ startWooImport();
146
+ });
147
 
148
+ // Autostart import
149
+ if (window.location.hash.indexOf('start') != -1) {
150
  window.location.hash = '';
 
151
  startWooImport();
152
  }
153
  });
languages/ecwid-shopping-cart-pt_BR.po CHANGED
@@ -855,10 +855,6 @@ msgstr "Entre em contato conosco"
855
  msgid "Still have questions about Ecwid? Let us know!"
856
  msgstr "Ainda tem dúvidas sobre o Ecwid? Nos informe!"
857
 
858
- #: templates/help.php:211
859
- msgid "https://www.ecwid.com/forums"
860
- msgstr "https://www.ecwid.com/forums"
861
-
862
  #: templates/help.php:211
863
  msgid "Forums"
864
  msgstr "Fóruns"
855
  msgid "Still have questions about Ecwid? Let us know!"
856
  msgstr "Ainda tem dúvidas sobre o Ecwid? Nos informe!"
857
 
 
 
 
 
858
  #: templates/help.php:211
859
  msgid "Forums"
860
  msgstr "Fóruns"
languages/ecwid-shopping-cart-ru_RU.po CHANGED
@@ -860,10 +860,6 @@ msgstr "Связь с техподдержкой"
860
  msgid "Still have questions about Ecwid? Let us know!"
861
  msgstr "Есть вопросы? Свяжитесь с нами, мы будем рады вам помочь."
862
 
863
- #: templates/help.php:211
864
- msgid "https://www.ecwid.com/forums"
865
- msgstr "https://www.ecwid.com/forums/forumdisplay.php?f=10"
866
-
867
  #: templates/help.php:211
868
  msgid "Forums"
869
  msgstr "Форум"
860
  msgid "Still have questions about Ecwid? Let us know!"
861
  msgstr "Есть вопросы? Свяжитесь с нами, мы будем рады вам помочь."
862
 
 
 
 
 
863
  #: templates/help.php:211
864
  msgid "Forums"
865
  msgstr "Форум"
languages/ecwid-shopping-cart.pot CHANGED
@@ -896,10 +896,6 @@ msgstr ""
896
  msgid "Still have questions about Ecwid? Let us know!"
897
  msgstr ""
898
 
899
- #: templates/help.php:211
900
- msgid "https://www.ecwid.com/forums"
901
- msgstr ""
902
-
903
  #: templates/help.php:211
904
  msgid "Forums"
905
  msgstr ""
896
  msgid "Still have questions about Ecwid? Let us know!"
897
  msgstr ""
898
 
 
 
 
 
899
  #: templates/help.php:211
900
  msgid "Forums"
901
  msgstr ""
lib/ecwid_api_v3.php CHANGED
@@ -1023,7 +1023,6 @@ class Ecwid_Api_V3
1023
  return $result;
1024
  }
1025
 
1026
- // TO-DO create class for batch methods
1027
  public function compose_batch_item( $path, $method = 'GET', $body = false, $batch_id = false ) {
1028
  $result = array(
1029
  'path' => $path,
@@ -1059,6 +1058,15 @@ class Ecwid_Api_V3
1059
  );
1060
  }
1061
 
 
 
 
 
 
 
 
 
 
1062
  public function batch_upload_category_image( $params, $category_id, $batch_id = false ) {
1063
  $url = $this->build_request_url('/categories/' . $product_id . '/image', $params);
1064
 
@@ -1091,6 +1099,16 @@ class Ecwid_Api_V3
1091
  $batch_id
1092
  );
1093
  }
 
 
 
 
 
 
 
 
 
 
1094
 
1095
  public function batch_upload_product_variation_image( $params, $product_id, $variation_id, $batch_id = false ) {
1096
  $url = $this->build_request_url('/products/' . $product_id . '/combinations/' . $variation_id . '/image', $params);
1023
  return $result;
1024
  }
1025
 
 
1026
  public function compose_batch_item( $path, $method = 'GET', $body = false, $batch_id = false ) {
1027
  $result = array(
1028
  'path' => $path,
1058
  );
1059
  }
1060
 
1061
+ public function batch_delete_product( $product_id, $batch_id = false ) {
1062
+ return $this->compose_batch_item(
1063
+ '/products/' . $product_id,
1064
+ 'DELETE',
1065
+ false,
1066
+ $batch_id
1067
+ );
1068
+ }
1069
+
1070
  public function batch_upload_category_image( $params, $category_id, $batch_id = false ) {
1071
  $url = $this->build_request_url('/categories/' . $product_id . '/image', $params);
1072
 
1099
  $batch_id
1100
  );
1101
  }
1102
+
1103
+ public function batch_delete_all_gallery_image( $product_id, $batch_id = false ) {
1104
+
1105
+ return $this->compose_batch_item(
1106
+ '/products/' . $product_id . '/gallery',
1107
+ 'DELETE',
1108
+ false,
1109
+ $batch_id
1110
+ );
1111
+ }
1112
 
1113
  public function batch_upload_product_variation_image( $params, $product_id, $variation_id, $batch_id = false ) {
1114
  $url = $this->build_request_url('/products/' . $product_id . '/combinations/' . $variation_id . '/image', $params);
readme.txt CHANGED
@@ -3,26 +3,26 @@ Contributors: Ecwid
3
  Tags: ecommerce, e-commerce, storefront, online store, sell
4
  Requires at least: 3.7
5
  Tested up to: 5.3
6
- Stable tag: 6.8.9
7
 
8
  Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
10
  == Description ==
11
  Ecwid Ecommerce Shopping Cart is everything you need to add an online store to your WordPress site. Powerful, easy-to-use and Gutenberg-friendly. Over 1 million sellers in 175 countries, 45 languages supported. PayPal, Stripe and 40 more payment options. Real-time shipping integrations. Selling on Instagram and Facebook.
12
 
13
- = Automatic Shipping and Taxes =
14
 
15
  The Ecwid ecommerce plugin integrates with major carriers including USPS, UPS, FedEx, Canada Post, Australia Post, and others to automatically calculate shipping rates. Taxes are also automated and can be set-up in a few clicks. Automated tax rate calculations are available for the U.S., Canada, and EU VAT. Additionally, integration with TaxJar provides automatic sales tax reporting and filing in the U.S.
16
 
17
- = Sell on Facebook and Instagram =
18
 
19
  Add your online store to Facebook and sell to millions of Facebook and Instagram users. No addons needed. Ecwid will automatically synchronize your products, customers, orders and inventory between your WordPress and Facebook storefronts. Ecwid is the **#1 e-commerce app on Facebook**. Join!
20
 
21
- = eCommerce Mobile Apps =
22
 
23
  Ecwid Shopping Cart provides free mobile applications for iOS and Android to manage your store and sell on the go. Scan products, track inventory, manage sales and accept payments using your mobile device as a POS station. Your ecommerce data is automatically synchronized with your Wordpress shopping cart, Facebook store and other online storefronts.
24
 
25
- = Unlimited Storage, Automatic Backups and Seamless Upgrades =
26
 
27
  With the Ecwid Shopping Cart, your online store data is fully hosted on our secure servers. Regardless of the WordPress hosting service you use, your Ecwid online store includes:
28
 
@@ -32,38 +32,38 @@ With the Ecwid Shopping Cart, your online store data is fully hosted on our secu
32
 
33
  So you don't need to worry about software updates, security patches and server maintenance – we do that for you. Your online store gets all the new ecommerce features and bug fixes automatically.
34
 
35
- = PCI DSS validated Level 1 Service Provider =
36
 
37
  Ecwid Shopping Cart is PCI DSS Level 1 certified, which is the gold standard for e-commerce solutions worldwide. This means that Ecwid helps your online store meet the security requirements of the bank you do business with.
38
 
39
- = Superb Support =
40
 
41
  Friendly and knowledgeable support experts available 24/5 so you can get immediate help when you need it. Support options include email, e-commerce community forums, chat and phone support.
42
 
43
- = Sell Everywhere =
44
 
45
  With Ecwid, you can include your ecommerce shop on multiple websites, blogs, social sites and ecommerce marketplaces like *Amazon*, *eBay* and *Google Shopping* and sell simultaneously everywhere. Add your online store to as many sites as you want, manage it from one place.
46
 
47
- = Mobile Responsive Design =
48
 
49
  Ecwid works great on any Wordpress site, especially those running on mobile-optimized themes. Your online store looks perfect on smartphones and automatically adapts to your customer’s screen size: laptops, tablets, smart TVs or smart watches. Check out this [demo](https://ecwid.to/ecwid-demo-store)
50
 
51
- = Hundreds of extensions and powerful API =
52
 
53
  There is a lot of in-house and third party extensions built on the Ecwid Ecommerce APIs. You can find a ready made plugin extending features of your online storefront the way you want or build a custom addon yourself. The existing family of third party plugins include tax automation apps like TaxJar, fulfilment services like ShipStation, customer support tools like LiveChat and many others.
54
 
55
- = Your Favorite Free Plugin =
56
 
57
  Ecwid offers a free plan that’s always available with no hidden setup charges or transaction fees. Get your online store up and running at zero cost. As your online shop grows, Ecwid grows with you. When the time is right, consider upgrading to one of our premium plans to get more robust features and preferred support. See also: [Ecwid plan and pricing](https://ecwid.to/ecwid-pricing)
58
 
59
 
60
- = See Ecwid In Action =
61
 
62
  * [Demo Store](https://ecwid.to/ecwid-demo-store "Ecwid demo")
63
  * [Ecwid Ecommerce Control panel](https://ecwid.to/ecwid-store-control-panel "Ecwid Control Panel") (you will be able to create a free Ecwid account)
64
  * [Showcase](https://ecwid.to/ecwid-wp-site)
65
 
66
- = Ecwid Site =
67
 
68
  * [www.ecwid.com](https://ecwid.to/ecwid-wp-site "Ecwid site")
69
 
@@ -74,7 +74,7 @@ Ecwid offers a free plan that’s always available with no hidden setup charges
74
 
75
  == Installation ==
76
 
77
- = Automatic installation (the easiest way) =
78
 
79
  1. In your Wordpress admin backend, navigate to *Plugins → Add New*
80
  1. Under Search, type in `Ecwid` and click *Search*
@@ -83,7 +83,7 @@ Ecwid offers a free plan that’s always available with no hidden setup charges
83
  1. Navigate to *Ecwid Store → General* page in your Wordpress admin backend and follow the instruction provided there
84
 
85
 
86
- = Alternative ways =
87
 
88
  **Uploading the plugin zip archive in Wordpress admin backend**
89
 
@@ -148,15 +148,19 @@ To create a sitemap for your WordPress shop, we recommend using the fully compat
148
 
149
  You can add the store categories menu to your site menu to help your customers easily navigate your online shop. Just 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.
150
 
151
- = How do I migrate my shop from Shopify, WooCommerce or BigCommerce? =
152
 
153
  You can use Ecwid’s built-in import tools to copy your store products from any other shopping cart to Ecwid. Find more details in the [Import-Export article in the Ecwid shopping cart help center]( https://support.ecwid.com/hc/en-us/articles/360000049040-Migrating-to-Ecwid-from-WooCommerce).
154
 
155
 
156
  * [Ecwid Help Center](http://help.ecwid.com/?source=wporg-plugin-site "Ecwid Help")
157
- * [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
158
 
159
  == Changelog ==
 
 
 
 
 
160
  = 6.8.9 - Dec 4, 2019 =
161
  - **Several fixes and improvements for the "Import from WooCommerce" tool.** If you import your products from WooCommerce to Ecwid, the import process now should work faster. We also added import of product sale prices from WooCommerce import "Sale Price". In the storefront, this price will be struck out to demonstrate the discount and the ON SALE label will appear on the product.
162
  - Avada, SimplyNews, Twenty Twenty themes improved compatibility. Even though Ecwid is compatible with every WordPress theme by design, some slight fixes and improvements are sometimes needed to make storefront look better. That’s why we are always monitoring how Ecwid pages look and behave in WordPress ecommerce themes.
3
  Tags: ecommerce, e-commerce, storefront, online store, sell
4
  Requires at least: 3.7
5
  Tested up to: 5.3
6
+ Stable tag: 6.8.10
7
 
8
  Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
9
 
10
  == Description ==
11
  Ecwid Ecommerce Shopping Cart is everything you need to add an online store to your WordPress site. Powerful, easy-to-use and Gutenberg-friendly. Over 1 million sellers in 175 countries, 45 languages supported. PayPal, Stripe and 40 more payment options. Real-time shipping integrations. Selling on Instagram and Facebook.
12
 
13
+ ### Automatic Shipping and Taxes
14
 
15
  The Ecwid ecommerce plugin integrates with major carriers including USPS, UPS, FedEx, Canada Post, Australia Post, and others to automatically calculate shipping rates. Taxes are also automated and can be set-up in a few clicks. Automated tax rate calculations are available for the U.S., Canada, and EU VAT. Additionally, integration with TaxJar provides automatic sales tax reporting and filing in the U.S.
16
 
17
+ ### Sell on Facebook and Instagram
18
 
19
  Add your online store to Facebook and sell to millions of Facebook and Instagram users. No addons needed. Ecwid will automatically synchronize your products, customers, orders and inventory between your WordPress and Facebook storefronts. Ecwid is the **#1 e-commerce app on Facebook**. Join!
20
 
21
+ ### eCommerce Mobile Apps
22
 
23
  Ecwid Shopping Cart provides free mobile applications for iOS and Android to manage your store and sell on the go. Scan products, track inventory, manage sales and accept payments using your mobile device as a POS station. Your ecommerce data is automatically synchronized with your Wordpress shopping cart, Facebook store and other online storefronts.
24
 
25
+ ### Unlimited Storage, Automatic Backups and Seamless Upgrades
26
 
27
  With the Ecwid Shopping Cart, your online store data is fully hosted on our secure servers. Regardless of the WordPress hosting service you use, your Ecwid online store includes:
28
 
32
 
33
  So you don't need to worry about software updates, security patches and server maintenance – we do that for you. Your online store gets all the new ecommerce features and bug fixes automatically.
34
 
35
+ ### PCI DSS validated Level 1 Service Provider
36
 
37
  Ecwid Shopping Cart is PCI DSS Level 1 certified, which is the gold standard for e-commerce solutions worldwide. This means that Ecwid helps your online store meet the security requirements of the bank you do business with.
38
 
39
+ ### Superb Support
40
 
41
  Friendly and knowledgeable support experts available 24/5 so you can get immediate help when you need it. Support options include email, e-commerce community forums, chat and phone support.
42
 
43
+ ### Sell Everywhere
44
 
45
  With Ecwid, you can include your ecommerce shop on multiple websites, blogs, social sites and ecommerce marketplaces like *Amazon*, *eBay* and *Google Shopping* and sell simultaneously everywhere. Add your online store to as many sites as you want, manage it from one place.
46
 
47
+ ### Mobile Responsive Design
48
 
49
  Ecwid works great on any Wordpress site, especially those running on mobile-optimized themes. Your online store looks perfect on smartphones and automatically adapts to your customer’s screen size: laptops, tablets, smart TVs or smart watches. Check out this [demo](https://ecwid.to/ecwid-demo-store)
50
 
51
+ ### Hundreds of extensions and powerful API
52
 
53
  There is a lot of in-house and third party extensions built on the Ecwid Ecommerce APIs. You can find a ready made plugin extending features of your online storefront the way you want or build a custom addon yourself. The existing family of third party plugins include tax automation apps like TaxJar, fulfilment services like ShipStation, customer support tools like LiveChat and many others.
54
 
55
+ ### Your Favorite Free Plugin
56
 
57
  Ecwid offers a free plan that’s always available with no hidden setup charges or transaction fees. Get your online store up and running at zero cost. As your online shop grows, Ecwid grows with you. When the time is right, consider upgrading to one of our premium plans to get more robust features and preferred support. See also: [Ecwid plan and pricing](https://ecwid.to/ecwid-pricing)
58
 
59
 
60
+ ### See Ecwid In Action
61
 
62
  * [Demo Store](https://ecwid.to/ecwid-demo-store "Ecwid demo")
63
  * [Ecwid Ecommerce Control panel](https://ecwid.to/ecwid-store-control-panel "Ecwid Control Panel") (you will be able to create a free Ecwid account)
64
  * [Showcase](https://ecwid.to/ecwid-wp-site)
65
 
66
+ ### Ecwid Site
67
 
68
  * [www.ecwid.com](https://ecwid.to/ecwid-wp-site "Ecwid site")
69
 
74
 
75
  == Installation ==
76
 
77
+ ### Automatic installation (the easiest way)
78
 
79
  1. In your Wordpress admin backend, navigate to *Plugins → Add New*
80
  1. Under Search, type in `Ecwid` and click *Search*
83
  1. Navigate to *Ecwid Store → General* page in your Wordpress admin backend and follow the instruction provided there
84
 
85
 
86
+ ### Alternative ways
87
 
88
  **Uploading the plugin zip archive in Wordpress admin backend**
89
 
148
 
149
  You can add the store categories menu to your site menu to help your customers easily navigate your online shop. Just 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.
150
 
151
+ = How do I migrate my shop from Shopify, WooCommerce, BigCommerce, Selz or Easy Digital Downloads? =
152
 
153
  You can use Ecwid’s built-in import tools to copy your store products from any other shopping cart to Ecwid. Find more details in the [Import-Export article in the Ecwid shopping cart help center]( https://support.ecwid.com/hc/en-us/articles/360000049040-Migrating-to-Ecwid-from-WooCommerce).
154
 
155
 
156
  * [Ecwid Help Center](http://help.ecwid.com/?source=wporg-plugin-site "Ecwid Help")
 
157
 
158
  == Changelog ==
159
+ = 6.8.10 - Dec 26, 2019 =
160
+ - **Several fixes and improvements for the "Import from WooCommerce" tool.** The import tool now works faster and has a neat interface.
161
+ - **Improved compatibility with popular WordPress cache plugins**. The Ecwid ecommerce plugin now works better on sites with WP Super Cache, Autoptimize and WP-Rocket. If you have one of those plugins installed and noticed any issue, it should be fixed now. If you still see a problem, please let us know.
162
+ - Minor fixes for improved compatiblity with the Elementor pagebuilder plugin.
163
+
164
  = 6.8.9 - Dec 4, 2019 =
165
  - **Several fixes and improvements for the "Import from WooCommerce" tool.** If you import your products from WooCommerce to Ecwid, the import process now should work faster. We also added import of product sale prices from WooCommerce import "Sale Price". In the storefront, this price will be struck out to demonstrate the discount and the ON SALE label will appear on the product.
166
  - Avada, SimplyNews, Twenty Twenty themes improved compatibility. Even though Ecwid is compatible with every WordPress theme by design, some slight fixes and improvements are sometimes needed to make storefront look better. That’s why we are always monitoring how Ecwid pages look and behave in WordPress ecommerce themes.
templates/help.php CHANGED
@@ -177,12 +177,6 @@
177
  <p><?php _e( 'Still have questions about Ecwid? Let us know!', 'ecwid-shopping-cart' ); ?> </p>
178
  </div>
179
  </li>
180
- <li>
181
- <div class="block-help-item">
182
- <a href="<?php _e( 'https://www.ecwid.com/forums', 'ecwid-shopping-cart'); ?>" target="_blank"><?php _e( 'Forums', 'ecwid-shopping-cart' ); ?> </a>
183
- <p><?php _e( 'Join the Ecwid community. Discuss support topics and store ideas with other Ecwid users.', 'ecwid-shopping-cart' ); ?> </p>
184
- </div>
185
- </li>
186
  </ul>
187
  </div>
188
  </div>
177
  <p><?php _e( 'Still have questions about Ecwid? Let us know!', 'ecwid-shopping-cart' ); ?> </p>
178
  </div>
179
  </li>
 
 
 
 
 
 
180
  </ul>
181
  </div>
182
  </div>
templates/importer/import-no-token.tpl.php CHANGED
@@ -1 +1,8 @@
1
- <a class="button button-primary" id="reconnect-button" href="admin.php?page=<?php echo self::PAGE_SLUG_WOO; ?>&action=reconnect"><?php _e( 'Connect', 'ecwid-shopping-cart' ); ?></a>
 
 
 
 
 
 
 
1
+ <div class="feature-element__content">
2
+ <div class="feature-element__text">
3
+ <p><?php _e('Click the connect button to get rights to update the product catalog', 'ecwid-shopping-cart'); ?></p>
4
+ </div>
5
+ <div class="feature-element__action">
6
+ <a class="btn btn-primary btn-medium" id="reconnect-button" href="admin.php?page=<?php echo self::PAGE_SLUG_WOO; ?>&action=reconnect"><?php _e( 'Connect', 'ecwid-shopping-cart' ); ?></a>
7
+ </div>
8
+ </div>
templates/importer/import-picture-feature.png ADDED
Binary file
templates/importer/woo-complete-alert.tpl.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="a-card a-card--compact" id="ec-importer-alert" style="display: none;">
2
+ <div class="a-card__paddings">
3
+
4
+ <div class="iconable-block iconable-block--hide-in-mobile">
5
+ <div class="iconable-block__infographics">
6
+
7
+ <span class="iconable-block__icon" data-ec-importer-alert="warning"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70 70" focusable="false"><path d="M34.5 67C16.58 67 2 52.42 2 34.5S16.58 2 34.5 2 67 16.58 67 34.5 52.42 67 34.5 67zm0-62C18.23 5 5 18.23 5 34.5S18.23 64 34.5 64 64 50.77 64 34.5 50.77 5 34.5 5z"></path><path d="M34.5 49c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5zM35.5 38.57h-2l-1-14c0-1.17.89-2.07 2-2.07s2 .9 2 2l-1 14.07z"></path></svg></span>
8
+
9
+ <span class="iconable-block__icon" data-ec-importer-alert="success"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70 70"><path d="M34.5 67h-.13c-8.68-.03-16.83-3.45-22.94-9.61C5.32 51.23 1.97 43.06 2 34.38 2.07 16.52 16.65 2 34.5 2h.13c8.68.03 16.83 3.45 22.94 9.61 6.12 6.16 9.46 14.34 9.43 23.02C66.93 52.48 52.35 67 34.5 67zm0-62C18.3 5 5.06 18.18 5 34.39c-.03 7.88 3.01 15.3 8.56 20.89 5.55 5.59 12.95 8.69 20.83 8.72h.12c16.2 0 29.44-13.18 29.5-29.39.03-7.88-3.01-15.3-8.56-20.89C49.89 8.13 42.49 5.03 34.61 5h-.11z"></path><path d="M32.17 46.67l-10.7-10.08c-.6-.57-.63-1.52-.06-2.12.57-.6 1.52-.63 2.12-.06l8.41 7.92 14.42-16.81c.54-.63 1.49-.7 2.12-.16.63.54.7 1.49.16 2.12L32.17 46.67z"></path></svg></span>
10
+
11
+ </div>
12
+ <div class="iconable-block__content">
13
+ <div class="cta-block">
14
+ <div class="cta-block__central">
15
+ <div class="cta-block__title"><?php _e( 'Import completed', 'ecwid-shopping-cart' ); ?></div>
16
+ <div class="cta-block__content">
17
+ <?php
18
+ echo sprintf( __( 'Imported <b>%s</b> products', 'ecwid-shopping-cart' ), '<span id="import-results-products">0</span>' );
19
+ if ( ecwid_is_paid_account() ) {
20
+ echo ", ";
21
+ echo sprintf( __( '<b>%s</b> categories', 'ecwid-shopping-cart' ), '<span id="import-results-categories">0</span>' );
22
+ }
23
+ ?>
24
+ </div>
25
+
26
+ <div class="cta-block__content" data-ec-importer-alert="warning">
27
+ <?php _e( 'Some of the items could not be imported.', 'ecwid-shopping-cart' ); ?>
28
+
29
+ <span data-ec-importer-alert="limit">
30
+ <?php
31
+ echo sprintf(
32
+ __( 'Part of the products have not been copied to %1$s, because you reached the products limit on your pricing plan in %1$s. If you want to import more products, please consider <nobr><a %2$s>upgrading your %1$s plan.</a></nobr>', 'ecwid-shopping-cart' ),
33
+ Ecwid_Config::get_brand(),
34
+ 'href="' . $this->_get_billing_page_url() .'"'
35
+ );
36
+ ?>
37
+ </span>
38
+ </div>
39
+
40
+ <div class="cta-block__content" data-ec-importer-alert="warning">
41
+ <?php
42
+ echo sprintf(
43
+ __( 'Download <a href="%s">import log</a>', 'ecwid-shopping-cart' ),
44
+ 'admin-post.php?action=' . Ecwid_Import_Page::ACTION_GET_WOO_IMPORT_LOG
45
+ );
46
+ ?>
47
+ </div>
48
+
49
+ </div>
50
+ <div class="cta-block__cta">
51
+ <a class="btn btn-primary btn-medium" href="admin.php?page=<?php echo Ecwid_Admin::ADMIN_SLUG; ?>-admin-products">
52
+ <?php echo sprintf( __('Go to Your %s Products', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
53
+ </a>
54
+ </div>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </div>
templates/importer/woo-main.tpl.php CHANGED
@@ -1,73 +1,137 @@
1
- <div class="wrap ecwid-importer state-<?php echo $this->_is_token_ok() ? 'woo-initial' : 'no-token'; ?>">
2
- <h1><?php echo sprintf( __( 'Import your products from WooCommerce to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></h1>
 
 
 
 
 
 
 
 
3
 
4
- <p><?php echo sprintf( __( 'This import will copy your WooCommerce products and categories to your %s store.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></p>
 
 
 
 
 
5
 
6
- <?php if ( !Ecwid_Config::is_wl() ): ?>
7
- <p><?php echo sprintf( __( '<b>Important note:</b> import creates new products. please mind the maximum number of products and categories you can add to your store. This import tool will automatically stop when you reach the limit. To learn the current store limit or increase it, please see the "<a %s>Billing & Plans</a>" page in your store control panel. ', 'ecwid-shopping-cart' ), 'href="admin.php?page=ec-store-admin-billing"' ); ?></p>
8
- <?php endif; ?>
9
-
10
- <h2><?php _e( 'Import summary.', 'ecwid-shopping-cart' ); ?></h2>
11
- <p>
12
  <?php
13
- _e( 'Your WooCommerce store has ', 'ecwid-shopping-cart' );
14
- echo $this->_get_products_categories_message(
15
- Ecwid_Importer::count_woo_products(),
16
- Ecwid_Importer::count_woo_categories()
17
- );
18
  ?>
19
- </p>
20
- <p>
21
- <?php
22
- printf(
23
- __( 'Your %s store has ', 'ecwid-shopping-cart' ),
24
- Ecwid_Config::get_brand()
25
- );
26
- echo $this->_get_products_categories_message(
27
- Ecwid_Importer::count_ecwid_products(),
28
- Ecwid_Importer::count_ecwid_categories()
29
- );
30
- ?>
31
- </p>
32
- <p>
33
- <?php
34
- echo sprintf(
35
- __( 'After import, your %s store will have ', 'ecwid-shopping-cart' ),
36
- Ecwid_Config::get_brand()
37
- );
38
- echo $this->_get_products_categories_message(
39
- Ecwid_Importer::count_ecwid_products() + Ecwid_Importer::count_woo_products(),
40
- Ecwid_Importer::count_ecwid_categories() + Ecwid_Importer::count_woo_categories()
41
- );
42
- ?>
43
- </p>
44
-
45
- <?php if ( count( Ecwid_Importer::get_ecwid_demo_products() ) > 0 && Ecwid_Importer::count_ecwid_demo_products() < Ecwid_Importer::count_ecwid_products() ): ?>
46
- <h2><?php _e( 'Import settings.', 'ecwid-shopping-cart' ); ?></h2>
47
- <p>
48
- <label><input type="checkbox" class="import-settings" name="<?php echo Ecwid_Importer::SETTING_DELETE_DEMO; ?>"><?php _e( 'Remove demo products', 'ecwid-shopping-cart' ); ?></label>
49
- </p>
50
- <?php endif; ?>
51
-
52
- <?php if ( Ecwid_Importer::count_ecwid_demo_products() < Ecwid_Importer::count_ecwid_products() ): ?>
53
- <p>
54
- <label><input type="checkbox" class="import-settings" name="<?php echo Ecwid_Importer::SETTING_UPDATE_BY_SKU; ?>"><?php _e( 'Overwrite existing products with matching SKU', 'ecwid-shopping-cart' ); ?></label>
55
- </p>
56
- <?php endif; ?>
57
-
58
- <div class="importer-state importer-state-woo-initial">
59
- <?php require __DIR__ . '/woo-initial.tpl.php'; ?>
60
- </div>
61
 
62
- <div class="importer-state importer-state-no-token">
63
- <?php require __DIR__ . '/import-no-token.tpl.php'; ?>
64
- </div>
65
 
66
- <div class="importer-state importer-state-woo-in-progress">
67
- <?php require __DIR__ . '/woo-in-progress.tpl.php'; ?>
68
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
- <div class="importer-state importer-state-woo-complete">
71
- <?php require __DIR__ . '/woo-complete.tpl.php'; ?>
72
  </div>
73
- </div>
1
+ <script type='text/javascript'>//<![CDATA[
2
+ jQuery(document.body).addClass('ecwid-no-padding');
3
+ jQuery(document.body).css({
4
+ 'font-size': '13px'
5
+ });
6
+ jQuery('#wpbody').css({
7
+ 'background-color': 'rgb(240, 242, 244)'
8
+ });
9
+ //]]>
10
+ </script>
11
 
12
+ <div class="settings-page">
13
+ <div class="settings-page__header">
14
+ <div class="settings-page__titles settings-page__titles--left">
15
+ <h1 class="settings-page__title"><?php echo sprintf( __( 'Import Your Products From Woocommerce to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></h1>
16
+ <div class="settings-page__subtitle"></div>
17
+ </div>
18
 
 
 
 
 
 
 
19
  <?php
20
+ if( $this->_is_token_ok() ) {
21
+ require __DIR__ . '/woo-complete-alert.tpl.php';
22
+ }
 
 
23
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
 
 
 
25
 
26
+ <div class="named-area">
27
+ <div class="named-area__header">
28
+ <div class="named-area__titles">
29
+ <div class="named-area__title"><?php _e( 'Update your catalog', 'ecwid-shopping-cart' ); ?></div>
30
+ <div class="named-area__subtitle"><?php echo sprintf( __( 'This import will copy your WooCommerce products and categories to your %s store.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></div>
31
+ </div>
32
+ </div>
33
+ <div class="named-area__body">
34
+
35
+ <div class="a-card-stack" data-ec-importer-card-stack>
36
+
37
+ <div class="a-card a-card--normal">
38
+ <div class="a-card__paddings">
39
+ <div class="feature-element has-picture">
40
+ <div class="feature-element__core">
41
+ <div class="feature-element__data">
42
+
43
+ <div class="feature-element__title" data-ec-importer-state="default"><?php echo sprintf( __( 'Import your products from Woocommerce to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></div>
44
+
45
+ <div class="feature-element__title" data-ec-importer-state="process"><?php _e( 'Import is in Progress', 'ecwid-shopping-cart' ); ?></div>
46
+
47
+ <div class="feature-element__title" data-ec-importer-state="complete"><?php echo sprintf( __( 'Import your products from WooCommerce to %s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?></div>
48
+
49
+ <?php
50
+ if( !$this->_is_token_ok() ) {
51
+ require __DIR__ . '/import-no-token.tpl.php';
52
+ }
53
+ ?>
54
+
55
+ <?php if( $this->_is_token_ok() ){?>
56
+
57
+ <div class="feature-element__status" data-ec-importer-state="complete">
58
+ <span class="feature-element__status-title success">
59
+ <?php
60
+ echo sprintf(
61
+ __( 'Import completed. <a href="%s">Run again.</a>', 'ecwid-shopping-cart' ),
62
+ admin_url( 'admin.php?page=' . Ecwid_Import_Page::PAGE_SLUG_WOO )
63
+ );
64
+ ?>
65
+ </span>
66
+ </div>
67
+
68
+ <div class="feature-element__status" data-ec-importer-state="process">
69
+ <div class="canonical-status canonical-status--has-icon canonical-status--loading canonical-status--prepend-icon canonical-status--warning">
70
+ <div class="canonical-status__text">
71
+ <?php _e( 'Copying products and categories.', 'ecwid-shopping-cart' ); ?>
72
+ <?php echo sprintf(
73
+ __( 'Importing %s of %s items', 'ecwid-shopping-cart' ),
74
+ '<span id="import-progress-current">0</span>',
75
+ '<span id="import-progress-total">' . (Ecwid_Importer::count_woo_products() + Ecwid_Importer::count_woo_categories()) . '</span>' );
76
+ ?>
77
+ </div>
78
+ <div class="canonical-status__icon">
79
+ <span>
80
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"
81
+ focusable="false">
82
+ <path d="M14,27C6.83,27,1,21.17,1,14c0-1.56,0.27-3.08,0.81-4.52C2.1,8.7,2.96,8.31,3.74,8.59c0.78,0.29,1.17,1.15,0.88,1.93 C4.21,11.63,4,12.8,4,14c0,5.51,4.49,10,10,10c5.51,0,10-4.49,10-10c0-5.51-4.49-10-10-10c-0.83,0-1.5-0.67-1.5-1.5S13.17,1,14,1 c7.17,0,13,5.83,13,13C27,21.17,21.17,27,14,27z"></path>
83
+ </svg>
84
+ </span>
85
+ </div>
86
+ </div>
87
+ </div>
88
+
89
+ <div class="feature-element__content">
90
+ <div class="feature-element__text">
91
+ <p>
92
+ <?php
93
+ _e( 'Import creates new products and update the existing products with matching SKUs.', 'ecwid-shopping-cart' );
94
+ ?>
95
+
96
+ <?php
97
+ if ( !Ecwid_Config::is_wl() ) {
98
+ echo sprintf( __( 'Please mind the maximum number of products and categories you can have in your Ecwid store. This import tool will automatically stop when the store products limit is reached. To check the current store limit or increase it, please see the <nobr><a %s target="_blank">"Billing & Plans"</a></nobr> page in your Ecwid store control panel.', 'ecwid-shopping-cart'),
99
+ 'href="admin.php?page=ec-store-admin-billing"'
100
+ );
101
+ }
102
+ ?>
103
+ </p>
104
+ </div>
105
+
106
+ <div class="feature-element__action" data-ec-importer-state="default">
107
+ <button type="button" class="btn btn-primary btn-medium" id="ec-importer-woo-go">
108
+ <span><?php _e( 'Start Import', 'ecwid-shopping-cart' ); ?></span>
109
+ </button>
110
+ </div>
111
+ </div>
112
+
113
+ <?php }?>
114
+
115
+ </div>
116
+ <div class="feature-element__picture">
117
+ <img src="<?php echo( esc_attr( ECWID_PLUGIN_URL )); ?>templates/importer/import-picture-feature.png" alt="" />
118
+ </div>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ </div>
123
+
124
+ <?php
125
+ if( $this->_is_token_ok() ) {
126
+ require __DIR__ . '/woo-summary.tpl.php';
127
+ }
128
+ ?>
129
+
130
+
131
+ </div>
132
+ </div>
133
+ </div>
134
+
135
 
 
 
136
  </div>
137
+ </div>
templates/importer/woo-summary.tpl.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="a-card a-card--normal" data-ec-importer-state="default">
2
+ <div class="a-card__paddings">
3
+
4
+ <ul class="titled-items-list">
5
+ <li class="titled-items-list__item titled-item">
6
+ <div class="titled-item__title"><?php _e( 'Import summary', 'ecwid-shopping-cart' ); ?></div>
7
+ <div class="titled-item__content">
8
+ &mdash;
9
+ <?php
10
+ _e( 'Your WooCommerce store has ', 'ecwid-shopping-cart' );
11
+ echo $this->_get_products_categories_message(
12
+ Ecwid_Importer::count_woo_products(),
13
+ Ecwid_Importer::count_woo_categories()
14
+ );
15
+ ?>
16
+ </div>
17
+ <div class="titled-item__content">
18
+ &mdash;
19
+ <?php
20
+ printf(
21
+ __( 'Your %s store has ', 'ecwid-shopping-cart' ),
22
+ Ecwid_Config::get_brand()
23
+ );
24
+ echo $this->_get_products_categories_message(
25
+ Ecwid_Importer::count_ecwid_products(),
26
+ Ecwid_Importer::count_ecwid_categories()
27
+ );
28
+ ?>
29
+ </div>
30
+ <div class="titled-item__content">
31
+ &mdash;
32
+ <?php
33
+ echo sprintf(
34
+ __( 'After import, your %s store will have ', 'ecwid-shopping-cart' ),
35
+ Ecwid_Config::get_brand()
36
+ );
37
+ echo $this->_get_products_categories_message(
38
+ Ecwid_Importer::count_ecwid_products() + Ecwid_Importer::count_woo_products(),
39
+ Ecwid_Importer::count_ecwid_categories() + Ecwid_Importer::count_woo_categories()
40
+ );
41
+ ?>
42
+ </div>
43
+ </li>
44
+ </ul>
45
+
46
+ </div>
47
+ </div>