Product Import Export for WooCommerce - Version 1.5.6

Version Description

  • Updates: Tested OK with WC 3.5.6 and WP 5.1.1
  • Bug Fix:- Updating Stock status based on stock quantity.
Download this release

Release Info

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

Code changes from version 1.5.5 to 1.5.6

images/sample_csv.png ADDED
Binary file
images/setup.png ADDED
Binary file
includes/importer/class-wf-csv-parser.php CHANGED
@@ -253,9 +253,23 @@ class WF_CSV_Parser {
253
 
254
  // Get custom fields
255
  foreach ($this->postmeta_defaults as $column => $default) {
256
- if (isset($item[$column]))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
  $postmeta[$column] = (string) $item[$column];
258
- elseif (isset($item['_' . $column]))
259
  $postmeta[$column] = (string) $item['_' . $column];
260
 
261
  // Check custom fields are valid
@@ -354,6 +368,60 @@ class WF_CSV_Parser {
354
  }
355
  }
356
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
 
358
  // Put set core product postmeta into product array
359
  foreach ($postmeta as $key => $value) {
253
 
254
  // Get custom fields
255
  foreach ($this->postmeta_defaults as $column => $default) {
256
+ if (isset($item[$column])){
257
+
258
+ //Handle stock status if it is given like (Instock, In stock , out of stock, Out of Stock), make them as (instock, outofstock)
259
+ if( 'stock_status' == $column )
260
+ {
261
+ $value=strtolower($item[$column]);
262
+ if ( in_array($value,array(1,'1',TRUE,'true','instock','in stock'),TRUE)) {
263
+ $item[$column] = 'instock';
264
+ } elseif (in_array($value,array(0,'0',FALSE,'false','outofstock','out of stock','out stock','outstock' ),TRUE)) {
265
+ $item[$column] = 'outofstock';
266
+ }else{
267
+ $item[$column] = strtolower( preg_replace('/\s+/', '', $item[$column]) );
268
+ }
269
+ }
270
+
271
  $postmeta[$column] = (string) $item[$column];
272
+ }elseif (isset($item['_' . $column]))
273
  $postmeta[$column] = (string) $item['_' . $column];
274
 
275
  // Check custom fields are valid
368
  }
369
  }
370
  }
371
+
372
+ //Automatically Update the Product Inventory stock status based on out of stock threshold value
373
+ //For both Merging or Inserting
374
+ if (XA_INVENTORY_STOCK_STATUS == 'yes') {
375
+ //if( $merging && empty( $postmeta['stock_status'] ))
376
+ if ($merging) {
377
+ $temp_product = wc_get_product($post_id);
378
+ if ((!empty($temp_product)) && $temp_product->managing_stock()) {
379
+ if ((!empty($postmeta['stock'])) && XA_INVENTORY_STOCK_THRESHOLD < $postmeta['stock']) {
380
+ $postmeta['stock_status'] = 'instock';
381
+ } elseif ((!empty($postmeta['stock'])) && XA_INVENTORY_STOCK_THRESHOLD >= $postmeta['stock']) {
382
+ $postmeta['stock_status'] = 'outofstock';
383
+ }
384
+
385
+ if ((empty($postmeta['stock']) || XA_INVENTORY_STOCK_THRESHOLD >= $postmeta['stock'] ) && (!empty($postmeta['manage_stock'])) && $postmeta['manage_stock'] == 'yes') {
386
+ if ( 'onbackorder' === $postmeta['stock_status']) {
387
+ $postmeta['stock_status'] = 'onbackorder';
388
+ }else{
389
+ $postmeta['stock_status'] = 'outofstock';
390
+ }
391
+ }
392
+ } elseif ((!empty($temp_product)) && (!empty($postmeta['manage_stock'])) && $postmeta['manage_stock'] == 'yes') {
393
+ $temp_product_quantity = (!empty($postmeta['stock'])) ? $postmeta['stock'] : $temp_product->get_stock_quantity();
394
+ if (XA_INVENTORY_STOCK_THRESHOLD < $temp_product_quantity) {
395
+ $postmeta['stock_status'] = 'instock';
396
+ } elseif (XA_INVENTORY_STOCK_THRESHOLD >= $temp_product_quantity) {
397
+ $postmeta['stock_status'] = 'outofstock';
398
+ }
399
+
400
+ if ((empty($postmeta['stock']) || XA_INVENTORY_STOCK_THRESHOLD >= $postmeta['stock'] ) && (!empty($postmeta['manage_stock'])) && $postmeta['manage_stock'] == 'yes') {
401
+ if ( 'onbackorder' === $postmeta['stock_status']) {
402
+ $postmeta['stock_status'] = 'onbackorder';
403
+ }else{
404
+ $postmeta['stock_status'] = 'outofstock';
405
+ }
406
+ }
407
+ }
408
+ }
409
+ //elseif( ! $merging && empty($postmeta['stock_status']) )
410
+ elseif (!$merging) {
411
+
412
+ if ((!empty($postmeta['manage_stock']) ) && $postmeta['manage_stock'] == 'yes') {
413
+ if ((!empty($postmeta['stock']) ) && XA_INVENTORY_STOCK_THRESHOLD < $postmeta['stock']) {
414
+ $postmeta['stock_status'] = 'instock';
415
+ } elseif ($postmeta['stock'] <= XA_INVENTORY_STOCK_THRESHOLD && 'onbackorder' === $postmeta['stock_status']) {
416
+ $postmeta['stock_status'] = 'onbackorder';
417
+ } else {
418
+ $postmeta['stock_status'] = 'outofstock';
419
+ }
420
+ }
421
+ }
422
+ } elseif ((!$merging ) && empty($postmeta['stock_status'])) {
423
+ $postmeta['stock_status'] = 'instock';
424
+ }
425
 
426
  // Put set core product postmeta into product array
427
  foreach ($postmeta as $key => $value) {
includes/importer/class-wf-prodimpexpcsv-product-import.php CHANGED
@@ -573,6 +573,12 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
573
  */
574
  public function import() {
575
  global $woocommerce, $wpdb;
 
 
 
 
 
 
576
 
577
  wp_suspend_cache_invalidation( true );
578
 
573
  */
574
  public function import() {
575
  global $woocommerce, $wpdb;
576
+ if (!defined('XA_INVENTORY_STOCK_STATUS')) {
577
+ define('XA_INVENTORY_STOCK_STATUS', get_option('woocommerce_manage_stock'));
578
+ }
579
+ if (!defined('XA_INVENTORY_STOCK_THRESHOLD')) {
580
+ define('XA_INVENTORY_STOCK_THRESHOLD', get_option('woocommerce_notify_no_stock_amount'));
581
+ }
582
 
583
  wp_suspend_cache_invalidation( true );
584
 
includes/views/html-wf-help-guide.php CHANGED
@@ -27,7 +27,7 @@ if ( ! defined( 'ABSPATH' ) ) {
27
  <div id="tab-help" class="coltwo-col panel help-guide">
28
  <div class="cols">
29
  <div class="inner-panel" style="">
30
- <img src="<?php echo plugins_url(basename(plugin_dir_path(WF_ProdImpExpCsv_FILE))) . '/images/video.png'; ?>"/>
31
  <h3><?php _e('How-to-setup', 'wf_csv_import_export'); ?></h3>
32
  <p style=""><?php _e('Get to know about our product in 3 minutes with this video', 'wf_csv_import_export'); ?></p>
33
  <a href="https://www.webtoffee.com/setting-up-product-import-export-plugin-for-woocommerce/" target="_blank" class="button button-primary">
27
  <div id="tab-help" class="coltwo-col panel help-guide">
28
  <div class="cols">
29
  <div class="inner-panel" style="">
30
+ <img src="<?php echo plugins_url(basename(plugin_dir_path(WF_ProdImpExpCsv_FILE))) . '/images/setup.png'; ?>"/>
31
  <h3><?php _e('How-to-setup', 'wf_csv_import_export'); ?></h3>
32
  <p style=""><?php _e('Get to know about our product in 3 minutes with this video', 'wf_csv_import_export'); ?></p>
33
  <a href="https://www.webtoffee.com/setting-up-product-import-export-plugin-for-woocommerce/" target="_blank" class="button button-primary">
includes/views/market.php CHANGED
@@ -4,10 +4,10 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  }
5
  ?>
6
  <div class="market-box table-box-main">
7
- <div class="getting-started-video">
8
  <h2><?php _e('Watch getting started video', 'wf_csv_import_export');?></h2>
9
  <iframe src="https://www.youtube.com/embed/L-01qI1EZWE?rel=0&showinfo=0" frameborder="0" allowfullscreen="allowfullscreen" align="center"></iframe>
10
- </div>
11
  <div class="pipe-review-widget">
12
  <?php
13
  echo sprintf(__('<div class=""><p><i>If you like the plugin please leave us a %1$s review!</i><p></div>', 'wf_csv_import_export'), '<a href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews?rate=5#new-post" target="_blank" class="xa-pipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'wf_csv_import_export') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>');
4
  }
5
  ?>
6
  <div class="market-box table-box-main">
7
+ <?php /*<div class="getting-started-video">
8
  <h2><?php _e('Watch getting started video', 'wf_csv_import_export');?></h2>
9
  <iframe src="https://www.youtube.com/embed/L-01qI1EZWE?rel=0&showinfo=0" frameborder="0" allowfullscreen="allowfullscreen" align="center"></iframe>
10
+ </div> */ ?>
11
  <div class="pipe-review-widget">
12
  <?php
13
  echo sprintf(__('<div class=""><p><i>If you like the plugin please leave us a %1$s review!</i><p></div>', 'wf_csv_import_export'), '<a href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews?rate=5#new-post" target="_blank" class="xa-pipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'wf_csv_import_export') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>');
product-csv-import-export.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.5
9
- WC tested up to: 3.5.5
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Text Domain: wf_csv_import_export
@@ -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.5");
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.6
9
+ WC tested up to: 3.5.6
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Text Domain: wf_csv_import_export
18
 
19
 
20
  if (!defined('WF_PIPE_CURRENT_VERSION')) {
21
+ define("WF_PIPE_CURRENT_VERSION", "1.5.6");
22
  }
23
  if (!defined('WF_PROD_IMP_EXP_ID')) {
24
  define("WF_PROD_IMP_EXP_ID", "wf_prod_imp_exp");
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webtoffee
3
  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
7
- Stable tag: 1.5.5
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
  &#128312; Export Simple Products in to a CSV file.
22
  &#128312; Import Simple Products in CSV format in to WooCommerce Store.
23
- &#128312; Tested OK with WooCommerce 3.5.5.
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.5 =
152
  * Updates: Tested OK with WC 3.5.5 and WP 5.1
153
  * Bug Fix:- Import process getting stuck randomly.
@@ -287,6 +291,6 @@ LibreOffice.
287
 
288
  == Upgrade Notice ==
289
 
290
- = 1.5.5 =
291
- * Updates: Tested OK with WC 3.5.5 and WP 5.1
292
- * Bug Fix:- Import process getting stuck randomly.
3
  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.6
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
20
 
21
  &#128312; Export Simple Products in to a CSV file.
22
  &#128312; Import Simple Products in CSV format in to WooCommerce Store.
23
+ &#128312; Tested OK with WooCommerce 3.5.6.
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.6 =
152
+ * Updates: Tested OK with WC 3.5.6 and WP 5.1.1
153
+ * Bug Fix:- Updating Stock status based on stock quantity.
154
+
155
  = 1.5.5 =
156
  * Updates: Tested OK with WC 3.5.5 and WP 5.1
157
  * Bug Fix:- Import process getting stuck randomly.
291
 
292
  == Upgrade Notice ==
293
 
294
+ = 1.5.6 =
295
+ * Updates: Tested OK with WC 3.5.6 and WP 5.1.1
296
+ * Bug Fix:- Updating Stock status based on stock quantity.