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

Version Description

  • bugfix: some output not properly sanitized
  • bugfix: update only these attributes option doesn't work in some cases
  • bugfix: import attributes with < and > characters doesn't work properly
  • bugfix: not possible to import "0" as an attribute value
Download this release

Release Info

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

Code changes from version 1.5.0 to 1.5.1

actions/pmxi_do_not_update_existing.php CHANGED
@@ -7,7 +7,7 @@
7
  * @throws \Exception
8
  */
9
  function pmwi_pmxi_do_not_update_existing($post_to_update_id, $import_id, $iteration) {
10
-
11
  if ( 'product_variation' == get_post_type($post_to_update_id) ) {
12
 
13
  $args = array(
@@ -60,4 +60,4 @@ function pmwi_pmxi_do_not_update_existing($post_to_update_id, $import_id, $itera
60
 
61
  }
62
  }
63
- }
7
  * @throws \Exception
8
  */
9
  function pmwi_pmxi_do_not_update_existing($post_to_update_id, $import_id, $iteration) {
10
+
11
  if ( 'product_variation' == get_post_type($post_to_update_id) ) {
12
 
13
  $args = array(
60
 
61
  }
62
  }
63
+ }
libraries/XmlImportWooCommerceService.php CHANGED
@@ -160,6 +160,9 @@ final class XmlImportWooCommerceService {
160
  */
161
  public function syncVariableProductData($parentID) {
162
  $product = new \WC_Product_Variable($parentID);
 
 
 
163
  $variations = array();
164
  $variationIDs = $product->get_children();
165
  // Collect product variations.
@@ -198,6 +201,17 @@ final class XmlImportWooCommerceService {
198
  $terms[] = $term->term_taxonomy_id;
199
  }
200
  }
 
 
 
 
 
 
 
 
 
 
 
201
  } else {
202
  $terms = explode("|", $parentAttribute['value']);
203
  $terms = array_filter($terms);
@@ -276,7 +290,7 @@ final class XmlImportWooCommerceService {
276
  $parentMeta = get_post_meta($product->get_id(), '');
277
  if ("manual" !== $this->getImport()->options['duplicate_matching']) {
278
  foreach ($this->getImport()->options['custom_name'] as $customFieldName) {
279
- if ($this->isUpdateCustomField($customFieldName)) {
280
  update_post_meta($firstVariationID, $customFieldName, maybe_unserialize($parentMeta[$customFieldName][0]));
281
  }
282
  }
@@ -345,6 +359,12 @@ final class XmlImportWooCommerceService {
345
  // Sync product data in case variations weren't created for this product.
346
  $simpleProduct = new \WC_Product_Simple($product->get_id());
347
  $simpleProduct->set_stock_status($parsedData['stock_status']);
 
 
 
 
 
 
348
  $simpleProduct->save();
349
  }
350
  if (empty($price)) {
@@ -616,8 +636,8 @@ final class XmlImportWooCommerceService {
616
  public static function getLogger() {
617
  $logger = FALSE;
618
  if (PMXI_Plugin::is_ajax()) {
619
- $logger = function($m) {echo "<div class='progress-msg'>[". date("H:i:s") ."] $m</div>\n";flush();};
620
  }
621
  return $logger;
622
  }
623
- }
160
  */
161
  public function syncVariableProductData($parentID) {
162
  $product = new \WC_Product_Variable($parentID);
163
+
164
+ do_action('wp_all_import_before_variable_product_import', $product->get_id());
165
+
166
  $variations = array();
167
  $variationIDs = $product->get_children();
168
  // Collect product variations.
201
  $terms[] = $term->term_taxonomy_id;
202
  }
203
  }
204
+ if (!empty($parentAttribute['value'])) {
205
+ $parent_terms = explode("|", $parentAttribute['value']);
206
+ $parent_terms = array_filter($parent_terms);
207
+ if (!empty($parent_terms)) {
208
+ foreach ($parent_terms as $parent_term) {
209
+ if ( ! in_array($parent_term, $terms) ) {
210
+ $terms[] = $parent_term;
211
+ }
212
+ }
213
+ }
214
+ }
215
  } else {
216
  $terms = explode("|", $parentAttribute['value']);
217
  $terms = array_filter($terms);
290
  $parentMeta = get_post_meta($product->get_id(), '');
291
  if ("manual" !== $this->getImport()->options['duplicate_matching']) {
292
  foreach ($this->getImport()->options['custom_name'] as $customFieldName) {
293
+ if ($isNewProduct || $this->isUpdateCustomField($customFieldName)) {
294
  update_post_meta($firstVariationID, $customFieldName, maybe_unserialize($parentMeta[$customFieldName][0]));
295
  }
296
  }
359
  // Sync product data in case variations weren't created for this product.
360
  $simpleProduct = new \WC_Product_Simple($product->get_id());
361
  $simpleProduct->set_stock_status($parsedData['stock_status']);
362
+ if (isset($parsedData['downloadable']) && ($isNewProduct || $this->isUpdateCustomField('_downloadable'))) {
363
+ $simpleProduct->set_downloadable($parsedData['downloadable']);
364
+ }
365
+ if (isset($parsedData['virtual']) && ($isNewProduct || $this->isUpdateCustomField('_virtual'))) {
366
+ $simpleProduct->set_virtual($parsedData['virtual']);
367
+ }
368
  $simpleProduct->save();
369
  }
370
  if (empty($price)) {
636
  public static function getLogger() {
637
  $logger = FALSE;
638
  if (PMXI_Plugin::is_ajax()) {
639
+ $logger = function($m) {echo "<div class='progress-msg'>[". date("H:i:s") ."] ".wp_all_import_filter_html_kses($m)."</div>\n";flush();};
640
  }
641
  return $logger;
642
  }
643
+ }
libraries/services/XmlImportWooServiceBase.php CHANGED
@@ -46,8 +46,8 @@ abstract class XmlImportWooServiceBase {
46
  public function getLogger() {
47
  $logger = FALSE;
48
  if (PMXI_Plugin::is_ajax()) {
49
- $logger = function($m) {echo "<div class='progress-msg'>[". date("H:i:s") ."] $m</div>\n";flush();};
50
  }
51
  return $logger;
52
  }
53
- }
46
  public function getLogger() {
47
  $logger = FALSE;
48
  if (PMXI_Plugin::is_ajax()) {
49
+ $logger = function($m) {echo "<div class='progress-msg'>[". date("H:i:s") ."] ".wp_all_import_filter_html_kses($m)."</div>\n";flush();};
50
  }
51
  return $logger;
52
  }
53
+ }
plugin.php CHANGED
@@ -3,9 +3,9 @@
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
  */
10
 
11
  if ( ! function_exists( 'is_plugin_active' ) ) {
@@ -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.5.0');
29
 
30
  define('PMWI_EDITION', 'free');
31
 
@@ -680,6 +680,7 @@ else {
680
  'is_default_attributes' => 0,
681
  'default_attributes_type' => 'first',
682
  'disable_sku_matching' => 1,
 
683
  'disable_prepare_price' => 1,
684
  'prepare_price_to_woo_format' => 0,
685
  'convert_decimal_separator' => 1,
@@ -846,4 +847,4 @@ else {
846
  }
847
 
848
  PMWI_Plugin::getInstance();
849
- }
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.1
7
  Author: Soflyy
8
+ WC tested up to: 7.0
9
  */
10
 
11
  if ( ! function_exists( 'is_plugin_active' ) ) {
25
  }
26
  else {
27
 
28
+ define('PMWI_FREE_VERSION', '1.5.1');
29
 
30
  define('PMWI_EDITION', 'free');
31
 
680
  'is_default_attributes' => 0,
681
  'default_attributes_type' => 'first',
682
  'disable_sku_matching' => 1,
683
+ 'default_attributes_xpath' => '',
684
  'disable_prepare_price' => 1,
685
  'prepare_price_to_woo_format' => 0,
686
  'convert_decimal_separator' => 1,
847
  }
848
 
849
  PMWI_Plugin::getInstance();
850
+ }
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Import Products from any XML or CSV to WooCommerce ===
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
@@ -11,12 +11,12 @@ Easily import products from any XML or CSV file to WooCommerce with the WooComme
11
 
12
  == Description ==
13
 
14
- *“I've been doing eCommerce sites for almost a decade. The combination of WP All Import and WooCommerce is a game changer! I can now get clients into eCommerce sites that could never afford the time/energy or money it took to administrate a site. It has opened up a whole new client base for me.”*
15
  **Mike Tidmore** -Founder, Successful Online Stores
16
 
17
  The WooCommerce add-on for [WP All Import](http://wordpress.org/plugins/wp-all-import/) makes it easy to bulk import your products to WooCommerce in less than 10 minutes.
18
 
19
- The left side of the plugin looks just like WooCommerce, and the right side displays a product from your XML/CSV file.
20
 
21
  **Drag & drop the data from your XML or CSV into the WooCommerce fields to import it.**
22
 
@@ -27,7 +27,7 @@ WooCommerce CSV imports? WooCommerce XML imports? They are EASY with WP All Impo
27
  Here's why you should use the WooCommerce add-on for WP All Import:
28
 
29
  - Supports files in any format and structure. There are no requirements that the data in your file be organized in a certain way. WooCommerce CSV imports are easy, no matter the structure of your file. WooCommerce XML imports are flexible and work with any XML file.
30
- - Supports files of practically unlimited size by automatically splitting them into chunks. Import 200Mb+ product catalogs with ease, even on shared hosting.
31
 
32
  = WooCommerce Add-On Professional Edition =
33
  [youtube http://www.youtube.com/watch?v=7kCmESmKGro]
@@ -40,7 +40,7 @@ The Pro edition of *WP All Import + the WooCommerce add-on* is a paid upgrade th
40
 
41
  * Import Grouped products
42
 
43
- * Import files from a URL - Download and import files from external websites, even if they are password protected with HTTP authentication.
44
 
45
  * Cron Job/Recurring Imports - WP All Import pro can check periodically check a file for updates, and add, edit, delete, and update the stock status of the imported products accordingly.
46
 
@@ -64,6 +64,14 @@ When importing CSV files, you should use UTF-8 encoding (which is very standard)
64
 
65
  This importer is the best option for WooCommerce CSV import tasks - our importer is extremely flexible when doing CSV imports because you don't need to edit your CSV files to import them to WooCommerce. WP All Import can import ANY CSV file to WooCommerce. You don't need to layout your data in a specific way, and you don't need your CSV to have specific column names. WP All Import's drag & drop interface provides you with a visual way to map the columns in your CSV file to the appropriate fields in WooCommerce.
66
 
 
 
 
 
 
 
 
 
67
  == Installation ==
68
 
69
  First, install [WP All Import](http://wordpress.org/plugins/wp-all-import "WordPress XML & CSV Import").
@@ -83,6 +91,12 @@ The WooCommerce add-on will appear in the Step 4 of WP All Import.
83
 
84
  == Changelog ==
85
 
 
 
 
 
 
 
86
  = 1.5.0 =
87
  * bug fix: attributes with < and > characters weren't imported correctly
88
 
@@ -136,7 +150,7 @@ The WooCommerce add-on will appear in the Step 4 of WP All Import.
136
  * bug fix: recount product terms when updating post status
137
 
138
  = 1.3.7 =
139
- * improvement: added new filter wp_all_import_recount_terms_after_import
140
  * bug fix: compatibility with woo commerce 2.6
141
  * bug fix: do not update stock_status if _stock is not set to update
142
 
@@ -174,7 +188,7 @@ The WooCommerce add-on will appear in the Step 4 of WP All Import.
174
  * fixed ucwords attributes names
175
  * fixed tooltips & css for woo 2.6 compatibility
176
 
177
- = 1.2.8 =
178
  * fixed updating stock qty with disabled manage_stock import
179
 
180
  = 1.2.7 =
@@ -187,7 +201,7 @@ The WooCommerce add-on will appear in the Step 4 of WP All Import.
187
  = 1.2.5 =
188
  * fixed conflict between options [update only these custom fields & update only these attributes]
189
  * added feature to dynamically set attribute options
190
- * added new option "Convert decimal separator to a period"
191
 
192
  = 1.2.4 =
193
  * added Variation Description field
@@ -206,7 +220,7 @@ The WooCommerce add-on will appear in the Step 4 of WP All Import.
206
  * fixed css styles
207
  * added compatibility with woocommerce 2.3
208
 
209
- = 1.2.0 =
210
  * IMPORTANT: WP All Import v4 (3.2.0) is a MAJOR update. Read this post before upgrading: (http://www.wpallimport.com/2014/11/free-version-wordpress-org-update-information)
211
  * speed up the import of taxonomies/categories
212
  * updated design
@@ -224,7 +238,7 @@ The WooCommerce add-on will appear in the Step 4 of WP All Import.
224
 
225
  = 1.1.4 =
226
  * fixed automatic fixing of improperly formatted prices
227
- * fixed php notices
228
  * updated css for compatibility with wocommerce 2.1
229
  * added download type option
230
  * added file names option
1
  === Import Products from any XML or CSV to WooCommerce ===
2
+ Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
+ Tested up to: 6.1
5
+ Stable tag: 1.5.1
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
11
 
12
  == Description ==
13
 
14
+ *“I've been doing eCommerce sites for almost a decade. The combination of WP All Import and WooCommerce is a game changer! I can now get clients into eCommerce sites that could never afford the time/energy or money it took to administrate a site. It has opened up a whole new client base for me.”*
15
  **Mike Tidmore** -Founder, Successful Online Stores
16
 
17
  The WooCommerce add-on for [WP All Import](http://wordpress.org/plugins/wp-all-import/) makes it easy to bulk import your products to WooCommerce in less than 10 minutes.
18
 
19
+ The left side of the plugin looks just like WooCommerce, and the right side displays a product from your XML/CSV file.
20
 
21
  **Drag & drop the data from your XML or CSV into the WooCommerce fields to import it.**
22
 
27
  Here's why you should use the WooCommerce add-on for WP All Import:
28
 
29
  - Supports files in any format and structure. There are no requirements that the data in your file be organized in a certain way. WooCommerce CSV imports are easy, no matter the structure of your file. WooCommerce XML imports are flexible and work with any XML file.
30
+ - Supports files of practically unlimited size by automatically splitting them into chunks. Import 200Mb+ product catalogs with ease, even on shared hosting.
31
 
32
  = WooCommerce Add-On Professional Edition =
33
  [youtube http://www.youtube.com/watch?v=7kCmESmKGro]
40
 
41
  * Import Grouped products
42
 
43
+ * Import files from a URL - Download and import files from external websites, even if they are password protected with HTTP authentication.
44
 
45
  * Cron Job/Recurring Imports - WP All Import pro can check periodically check a file for updates, and add, edit, delete, and update the stock status of the imported products accordingly.
46
 
64
 
65
  This importer is the best option for WooCommerce CSV import tasks - our importer is extremely flexible when doing CSV imports because you don't need to edit your CSV files to import them to WooCommerce. WP All Import can import ANY CSV file to WooCommerce. You don't need to layout your data in a specific way, and you don't need your CSV to have specific column names. WP All Import's drag & drop interface provides you with a visual way to map the columns in your CSV file to the appropriate fields in WooCommerce.
66
 
67
+ = Related Plugins =
68
+ [Export any WordPress data to XML/CSV](https://wordpress.org/plugins/wp-all-export/)
69
+ [Import any XML or CSV File to WordPress](https://wordpress.org/plugins/wp-all-import/)
70
+ [Export Products to CSV/XML for WooCommerce](https://wordpress.org/plugins/product-export-for-woocommerce/)
71
+ [Custom Product Tabs for WooCommerce WP All Import Add-on](https://wordpress.org/plugins/custom-product-tabs-wp-all-import-add-on/)
72
+ [Export Orders to CSV/XML for WooCommerce](https://wordpress.org/plugins/order-export-for-woocommerce/)
73
+ [Export WordPress Users to CSV/XML](https://wordpress.org/plugins/export-wp-users-xml-csv/)
74
+
75
  == Installation ==
76
 
77
  First, install [WP All Import](http://wordpress.org/plugins/wp-all-import "WordPress XML & CSV Import").
91
 
92
  == Changelog ==
93
 
94
+ = 1.5.1 =
95
+ * bugfix: some output not properly sanitized
96
+ * bugfix: update only these attributes option doesn't work in some cases
97
+ * bugfix: import attributes with < and > characters doesn't work properly
98
+ * bugfix: not possible to import "0" as an attribute value
99
+
100
  = 1.5.0 =
101
  * bug fix: attributes with < and > characters weren't imported correctly
102
 
150
  * bug fix: recount product terms when updating post status
151
 
152
  = 1.3.7 =
153
+ * improvement: added new filter wp_all_import_recount_terms_after_import
154
  * bug fix: compatibility with woo commerce 2.6
155
  * bug fix: do not update stock_status if _stock is not set to update
156
 
188
  * fixed ucwords attributes names
189
  * fixed tooltips & css for woo 2.6 compatibility
190
 
191
+ = 1.2.8 =
192
  * fixed updating stock qty with disabled manage_stock import
193
 
194
  = 1.2.7 =
201
  = 1.2.5 =
202
  * fixed conflict between options [update only these custom fields & update only these attributes]
203
  * added feature to dynamically set attribute options
204
+ * added new option "Convert decimal separator to a period"
205
 
206
  = 1.2.4 =
207
  * added Variation Description field
220
  * fixed css styles
221
  * added compatibility with woocommerce 2.3
222
 
223
+ = 1.2.0 =
224
  * IMPORTANT: WP All Import v4 (3.2.0) is a MAJOR update. Read this post before upgrading: (http://www.wpallimport.com/2014/11/free-version-wordpress-org-update-information)
225
  * speed up the import of taxonomies/categories
226
  * updated design
238
 
239
  = 1.1.4 =
240
  * fixed automatic fixing of improperly formatted prices
241
+ * fixed php notices
242
  * updated css for compatibility with wocommerce 2.1
243
  * added download type option
244
  * added file names option