diff --git a/README.md b/README.md index c6e2e2f..92fbdcf 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Requires Import WP: 2.11.6 -**Version: 2.3.5** +**Version: 2.3.6** ![WooCommerce Product Importer](./assets/iwp-addon-woocommerce.png) @@ -52,6 +52,10 @@ The WooCommerce Product Importer Addon can currently only be installed by downlo ## Changelog +### 2.3.6 + +- FIX - Skip attribute if no attribute name is passed. + ### 2.3.5 - ADD - Add new field for "GTIN, UPC, EAN, or ISBN". diff --git a/class/Importer/Template/ProductTemplate.php b/class/Importer/Template/ProductTemplate.php index e25d287..ed9c6ed 100644 --- a/class/Importer/Template/ProductTemplate.php +++ b/class/Importer/Template/ProductTemplate.php @@ -1024,6 +1024,11 @@ public function set_variation_data(&$variation, ParsedData $data) $prefix = 'attributes.' . $i . '.'; $name = $raw_attributes[$prefix . 'name']; + + if (empty($name)) { + continue; + } + $terms = $raw_attributes[$prefix . 'terms']; $global = $raw_attributes[$prefix . 'global']; $visible = $raw_attributes[$prefix . 'visible']; @@ -1392,6 +1397,11 @@ protected function get_variation_parent_attributes($raw_attributes, $parent) for ($i = 0; $i < $record_count; $i++) { $prefix = 'attributes.' . $i . '.'; $name = $raw_attributes[$prefix . 'name']; + + if (empty($name)) { + continue; + } + $terms = $raw_attributes[$prefix . 'terms']; $global = $raw_attributes[$prefix . 'global']; $visible = $raw_attributes[$prefix . 'visible']; diff --git a/woocommerce.php b/woocommerce.php index 15cd0b8..09aa12b 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -5,7 +5,7 @@ * Plugin URI: https://www.importwp.com * Description: Allow Import WP to import WooCommerce Products. * Author: James Collings - * Version: 2.3.5 + * Version: 2.3.6 * Author URI: https://www.importwp.com * Network: True */