Import Products from any XML or CSV to WooCommerce - Version 1.5.0

Version Description

  • bug fix: attributes with < and > characters weren't imported correctly
Download this release

Release Info

Developer soflyy
Plugin Icon 128x128 Import Products from any XML or CSV to WooCommerce
Version 1.5.0
Comparing to
See all releases

Code changes from version 1.4.9 to 1.5.0

actions/admin_notices.php CHANGED
@@ -43,7 +43,7 @@ function pmwi_admin_notices() {
43
  deactivate_plugins( PMWI_ROOT_DIR . '/wpai-woocommerce-add-on.php');
44
  }
45
 
46
- if ( class_exists( 'Woocommerce' ) and defined('WOOCOMMERCE_VERSION') and version_compare(WOOCOMMERCE_VERSION, '2.1') <= 0 ) {
47
  ?>
48
  <div class="error"><p>
49
  <?php printf(
43
  deactivate_plugins( PMWI_ROOT_DIR . '/wpai-woocommerce-add-on.php');
44
  }
45
 
46
+ if ( class_exists( 'Woocommerce' ) and defined('WOOCOMMERCE_VERSION') and version_compare(WOOCOMMERCE_VERSION, '3.0') <= 0 ) {
47
  ?>
48
  <div class="error"><p>
49
  <?php printf(
libraries/XmlImportWooCommerceService.php CHANGED
@@ -321,6 +321,9 @@ final class XmlImportWooCommerceService {
321
  */
322
  public function maybeMakeProductSimple($product, $variationIDs) {
323
  $isNewProduct = get_post_meta($product->get_id(), self::FLAG_IS_NEW_PRODUCT, true);
 
 
 
324
  if ($this->isUpdateDataAllowed('is_update_product_type', $isNewProduct) && $this->getImport()->options['make_simple_product']) {
325
  do_action('wp_all_import_before_make_product_simple', $product->get_id(), $this->getImport()->id);
326
  $product_type_term = is_exists_term('simple', 'product_type', 0);
321
  */
322
  public function maybeMakeProductSimple($product, $variationIDs) {
323
  $isNewProduct = get_post_meta($product->get_id(), self::FLAG_IS_NEW_PRODUCT, true);
324
+ if (empty($isNewProduct)) {
325
+ $isNewProduct = FALSE;
326
+ }
327
  if ($this->isUpdateDataAllowed('is_update_product_type', $isNewProduct) && $this->getImport()->options['make_simple_product']) {
328
  do_action('wp_all_import_before_make_product_simple', $product->get_id(), $this->getImport()->id);
329
  $product_type_term = is_exists_term('simple', 'product_type', 0);
libraries/importer/products/ImportProduct.php CHANGED
@@ -356,7 +356,7 @@ abstract class ImportProduct extends ImportProductBase {
356
  $values = $attribute['value'];
357
  if ( $isTaxonomy ) {
358
  if ( isset( $attribute['value']) ) {
359
- $values = array_map('stripslashes', array_map( 'strip_tags', explode( $attributes_delimiter, $attribute['value'])));
360
  // Remove empty items in the array.
361
  $values = array_filter( $values, [$this, "filtering"] );
362
  if (intval($attribute['is_create_taxonomy_terms'])){
@@ -424,10 +424,10 @@ abstract class ImportProduct extends ImportProductBase {
424
  $isAddNew = TRUE;
425
  }
426
  }
427
- $name = $attribute->is_taxonomy() ? $attributeName : $attribute->get_name();
428
  if (!$this->getImportService()->isUpdateAttribute($name, $this->isNewProduct()) || $isAddNew) {
429
  $productAttributes[$attributeName] = array(
430
- 'name' => $attribute->is_taxonomy() ? urldecode_deep($attributeName) : $attribute->get_name(),
431
  'value' => $attribute->is_taxonomy() ? $attribute->get_options() : implode("|", $attribute->get_options()),
432
  'is_visible' => $attribute->get_visible(),
433
  'in_variation' => $attribute->get_variation(),
356
  $values = $attribute['value'];
357
  if ( $isTaxonomy ) {
358
  if ( isset( $attribute['value']) ) {
359
+ $values = array_map('stripslashes', explode( $attributes_delimiter, $attribute['value']));
360
  // Remove empty items in the array.
361
  $values = array_filter( $values, [$this, "filtering"] );
362
  if (intval($attribute['is_create_taxonomy_terms'])){
424
  $isAddNew = TRUE;
425
  }
426
  }
427
+ $name = $attribute->is_taxonomy() ? urldecode_deep($attributeName) : $attribute->get_name();
428
  if (!$this->getImportService()->isUpdateAttribute($name, $this->isNewProduct()) || $isAddNew) {
429
  $productAttributes[$attributeName] = array(
430
+ 'name' => $name,
431
  'value' => $attribute->is_taxonomy() ? $attribute->get_options() : implode("|", $attribute->get_options()),
432
  'is_visible' => $attribute->get_visible(),
433
  'in_variation' => $attribute->get_variation(),
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP All Import - WooCommerce Add-On
4
  Plugin URI: http://www.wpallimport.com/woocommerce-product-import/?utm_source=import-wooco-products-addon-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
5
  Description: An extremely easy, drag & drop importer to import WooCommerce simple products. A paid upgrade is available for premium support and support for Variable, Grouped, and External/Affiliate products
6
- Version: 1.4.9
7
  Author: Soflyy
8
  WC tested up to: 5.5.1
9
  */
@@ -25,7 +25,7 @@ if ( is_plugin_active('wpai-woocommerce-add-on/wpai-woocommerce-add-on.php') ) {
25
  }
26
  else {
27
 
28
- define('PMWI_FREE_VERSION', '1.4.9');
29
 
30
  define('PMWI_EDITION', 'free');
31
 
3
  Plugin Name: WP All Import - WooCommerce Add-On
4
  Plugin URI: http://www.wpallimport.com/woocommerce-product-import/?utm_source=import-wooco-products-addon-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
5
  Description: An extremely easy, drag & drop importer to import WooCommerce simple products. A paid upgrade is available for premium support and support for Variable, Grouped, and External/Affiliate products
6
+ Version: 1.5.0
7
  Author: Soflyy
8
  WC tested up to: 5.5.1
9
  */
25
  }
26
  else {
27
 
28
+ define('PMWI_FREE_VERSION', '1.5.0');
29
 
30
  define('PMWI_EDITION', 'free');
31
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
  Tested up to: 5.8
5
- Stable tag: 1.4.9
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
  Tags: woocommerce xml import, woocommerce csv import, woocommerce, import, xml, csv, wp all import, csv import, import csv, xml import, import xml, woocommerce csv importer, woocommerce xml importer, csv importer, csv import suite
@@ -83,6 +83,9 @@ The WooCommerce add-on will appear in the Step 4 of WP All Import.
83
 
84
  == Changelog ==
85
 
 
 
 
86
  = 1.4.9 =
87
  * bug fix: product_shipping_class taxonomy not updated
88
 
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
  Tested up to: 5.8
5
+ Stable tag: 1.5.0
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
  Tags: woocommerce xml import, woocommerce csv import, woocommerce, import, xml, csv, wp all import, csv import, import csv, xml import, import xml, woocommerce csv importer, woocommerce xml importer, csv importer, csv import suite
83
 
84
  == Changelog ==
85
 
86
+ = 1.5.0 =
87
+ * bug fix: attributes with < and > characters weren't imported correctly
88
+
89
  = 1.4.9 =
90
  * bug fix: product_shipping_class taxonomy not updated
91