Product Import Export for WooCommerce - Version 1.5.9

Version Description

  • Tested OK with WC 3.6.1
  • Bug Fix: SKU check.
Download this release

Release Info

Developer webtoffee
Plugin Icon 128x128 Product Import Export for WooCommerce
Version 1.5.9
Comparing to
See all releases

Code changes from version 1.5.8 to 1.5.9

includes/importer/class-wf-prodimpexpcsv-product-import.php CHANGED
@@ -833,10 +833,19 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
833
  return;
834
  }
835
  */
 
 
 
 
 
 
 
 
 
836
 
837
  $existing_product = '';
838
  if (isset($processing_product_sku) && !empty($processing_product_sku)) {
839
- $existing_product = wc_get_product_id_by_sku($processing_product_sku);
840
  }
841
  if ($existing_product) {
842
  if ($this->delete_products == 1) {
@@ -846,7 +855,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
846
  // if no sku , no id and no merge and has same title in DB -> just give message
847
  $usr_msg = 'Product with same title already exists.';
848
  } else {
849
- $usr_msg = 'Product already exists.';
850
  }
851
  $this->add_import_result('skipped', __($usr_msg, 'product-import-export-for-woo'), $existing_product, $processing_product_title, $processing_product_sku);
852
  $this->hf_log_data_change('csv-import', sprintf(__('> “%s”' . $usr_msg, 'product-import-export-for-woo'), esc_html($processing_product_title)).' with post ID:'.$existing_product, true);
@@ -855,7 +864,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
855
  }
856
 
857
  if ( $processing_product_id && is_string( get_post_status( $processing_product_id ) ) ) {
858
- $this->add_import_result( 'skipped', __( 'Importing post ID conflicts with an existing post ID', 'product-import-export-for-woo' ), $processing_product_id, get_the_title( $processing_product_id ), '' );
859
  $this->hf_log_data_change( 'csv-import', sprintf( __('> “%s” ID already exists.', 'product-import-export-for-woo'), esc_html( $processing_product_id ) ), true );
860
  unset( $post );
861
  return;
@@ -894,7 +903,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
894
  // Check post type to avoid conflicts with IDs
895
  $is_post_exist_in_db = get_post_type( $processing_product_id );
896
  if ( $merging && $processing_product_id && !empty($is_post_exist_in_db) && ($is_post_exist_in_db !== $post['post_type'] )) {
897
- $this->add_import_result( 'skipped', __( 'Post is not a product', 'product-import-export-for-woo' ), $processing_product_id, $processing_product_title, $processing_product_sku );
898
  $this->hf_log_data_change( 'csv-import', sprintf( __('> “%s” is not a product.', 'product-import-export-for-woo'), esc_html($processing_product_id) ), true );
899
  unset( $post );
900
  return;
@@ -1255,7 +1264,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1255
  add_post_meta( $post_id, 'total_sales', 0 );
1256
 
1257
  if ( $merging ) {
1258
- $this->add_import_result( 'merged', 'Merge successful', $post_id, $processing_product_title, $processing_product_sku );
1259
  $this->hf_log_data_change( 'csv-import', sprintf( __('> Finished merging post ID %s.', 'product-import-export-for-woo'), $post_id ) );
1260
  } else {
1261
  $this->add_import_result( 'imported', 'Import successful', $post_id, $processing_product_title, $processing_product_sku );
833
  return;
834
  }
835
  */
836
+
837
+ $is_post_type_product = get_post_type($processing_product_id);
838
+ if (!empty($processing_product_id) && (in_array($is_post_type_product, array('product','product_variation')))) {
839
+ $usr_msg = 'Product with same ID already exists.';
840
+ $this->add_import_result('skipped', __($usr_msg, 'wf_csv_import_export'), $processing_product_id, $processing_product_title, $processing_product_sku);
841
+ $this->hf_log_data_change('csv-import', sprintf(__('> “%s”' . $usr_msg, 'wf_csv_import_export'), esc_html($processing_product_title)), true);
842
+ unset($post);
843
+ return;
844
+ }
845
 
846
  $existing_product = '';
847
  if (isset($processing_product_sku) && !empty($processing_product_sku)) {
848
+ $existing_product = $this->wf_get_product_id_by_sku($processing_product_sku);
849
  }
850
  if ($existing_product) {
851
  if ($this->delete_products == 1) {
855
  // if no sku , no id and no merge and has same title in DB -> just give message
856
  $usr_msg = 'Product with same title already exists.';
857
  } else {
858
+ $usr_msg = 'Product with same SKU already exists.';
859
  }
860
  $this->add_import_result('skipped', __($usr_msg, 'product-import-export-for-woo'), $existing_product, $processing_product_title, $processing_product_sku);
861
  $this->hf_log_data_change('csv-import', sprintf(__('> “%s”' . $usr_msg, 'product-import-export-for-woo'), esc_html($processing_product_title)).' with post ID:'.$existing_product, true);
864
  }
865
 
866
  if ( $processing_product_id && is_string( get_post_status( $processing_product_id ) ) ) {
867
+ $this->add_import_result( 'skipped', __( 'Importing product(ID) conflicts with an existing post.', 'product-import-export-for-woo' ), $processing_product_id, get_the_title( $processing_product_id ), '' );
868
  $this->hf_log_data_change( 'csv-import', sprintf( __('> “%s” ID already exists.', 'product-import-export-for-woo'), esc_html( $processing_product_id ) ), true );
869
  unset( $post );
870
  return;
903
  // Check post type to avoid conflicts with IDs
904
  $is_post_exist_in_db = get_post_type( $processing_product_id );
905
  if ( $merging && $processing_product_id && !empty($is_post_exist_in_db) && ($is_post_exist_in_db !== $post['post_type'] )) {
906
+ $this->add_import_result( 'skipped', __( 'Importing product(ID) conflicts with an existing post which is not a product.', 'product-import-export-for-woo' ), $processing_product_id, $processing_product_title, $processing_product_sku );
907
  $this->hf_log_data_change( 'csv-import', sprintf( __('> “%s” is not a product.', 'product-import-export-for-woo'), esc_html($processing_product_id) ), true );
908
  unset( $post );
909
  return;
1264
  add_post_meta( $post_id, 'total_sales', 0 );
1265
 
1266
  if ( $merging ) {
1267
+ $this->add_import_result( 'merged', 'Product updated successfully', $post_id, $processing_product_title, $processing_product_sku );
1268
  $this->hf_log_data_change( 'csv-import', sprintf( __('> Finished merging post ID %s.', 'product-import-export-for-woo'), $post_id ) );
1269
  } else {
1270
  $this->add_import_result( 'imported', 'Import successful', $post_id, $processing_product_title, $processing_product_sku );
product-import-export-for-woo.php CHANGED
@@ -5,8 +5,8 @@
5
  Description: Import and Export Products From and To your WooCommerce Store.
6
  Author: WebToffee
7
  Author URI: https://www.webtoffee.com/product/product-import-export-woocommerce/
8
- Version: 1.5.8
9
- WC tested up to: 3.5.7
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Text Domain: product-import-export-for-woo
@@ -18,7 +18,7 @@ if (!defined('ABSPATH') || !is_admin()) {
18
 
19
 
20
  if (!defined('WF_PIPE_CURRENT_VERSION')) {
21
- define("WF_PIPE_CURRENT_VERSION", "1.5.8");
22
  }
23
  if (!defined('WF_PROD_IMP_EXP_ID')) {
24
  define("WF_PROD_IMP_EXP_ID", "wf_prod_imp_exp");
5
  Description: Import and Export Products From and To your WooCommerce Store.
6
  Author: WebToffee
7
  Author URI: https://www.webtoffee.com/product/product-import-export-woocommerce/
8
+ Version: 1.5.9
9
+ WC tested up to: 3.6.1
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Text Domain: product-import-export-for-woo
18
 
19
 
20
  if (!defined('WF_PIPE_CURRENT_VERSION')) {
21
+ define("WF_PIPE_CURRENT_VERSION", "1.5.9");
22
  }
23
  if (!defined('WF_PROD_IMP_EXP_ID')) {
24
  define("WF_PROD_IMP_EXP_ID", "wf_prod_imp_exp");
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.webtoffee.com/plugins/
4
  Tags: woocommerce product import, woocommerce import products, woocommerce export products, export woocommerce products, import products into woocommerce
5
  Requires at least: 3.0.1
6
  Tested up to: 5.1.1
7
- Stable tag: 1.5.8
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -20,7 +20,7 @@ Are you trying to import products into WooCommerce store or export WooCommerce p
20
 
21
  🔸 Export Simple Products in to a CSV file.
22
  🔸 Import Simple Products in CSV format in to WooCommerce Store.
23
- 🔸 Tested OK with WooCommerce 3.5.7.
24
 
25
 
26
  Highlights: WooCommerce Product Export, WooCommerce Product CSV Import Suite, WooCommerce bulk product upload, WooCommerce import products with images, import amazon products to WooCommerce, Export Products to xls. Pro Version supports both Simple and Variable products.
@@ -148,6 +148,10 @@ LibreOffice.
148
  3. Premium Export Settings Screen
149
 
150
  == Changelog ==
 
 
 
 
151
  = 1.5.8 =
152
  * Banner Update.
153
  * Content Update.
@@ -300,6 +304,6 @@ LibreOffice.
300
 
301
  == Upgrade Notice ==
302
 
303
- = 1.5.8 =
304
- * Banner Update.
305
- * Content Update.
4
  Tags: woocommerce product import, woocommerce import products, woocommerce export products, export woocommerce products, import products into woocommerce
5
  Requires at least: 3.0.1
6
  Tested up to: 5.1.1
7
+ Stable tag: 1.5.9
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
20
 
21
  🔸 Export Simple Products in to a CSV file.
22
  🔸 Import Simple Products in CSV format in to WooCommerce Store.
23
+ 🔸 Tested OK with WooCommerce 3.6.1.
24
 
25
 
26
  Highlights: WooCommerce Product Export, WooCommerce Product CSV Import Suite, WooCommerce bulk product upload, WooCommerce import products with images, import amazon products to WooCommerce, Export Products to xls. Pro Version supports both Simple and Variable products.
148
  3. Premium Export Settings Screen
149
 
150
  == Changelog ==
151
+ = 1.5.9 =
152
+ * Tested OK with WC 3.6.1
153
+ * Bug Fix: SKU check.
154
+
155
  = 1.5.8 =
156
  * Banner Update.
157
  * Content Update.
304
 
305
  == Upgrade Notice ==
306
 
307
+ = 1.5.9 =
308
+ * Tested OK with WC 3.6.1
309
+ * Bug Fix: SKU check.