How to fix it
- Set Type to variable on the parent row, and list its attributes and all their values there.
- If the parent is already in your store as a simple product, change it to "Variable product" on the product edit screen first.
- Check that the Parent cell on each variation row is exactly the parent's SKU.
- Import the file again.
Example
A file with this problem
Type,SKU,Name,Published,Visibility in catalog,Tax status,In stock?,Stock,Regular price,Images,Parent,Attribute 1 name,Attribute 1 value(s... simple,TEE,Tee,1,visible,taxable,1,5,20.00,,,Size,"S, M",0 variation,TEE-S,Tee S,1,visible,taxable,1,3,20.00,,TEE,Size,S,0
What the checker says about it
- Line 3: "Tee S": the Parent "TEE" (line 2) has Type "simple", not variable. Variations only show on a variable product, so change the parent's Type to variable.
Once the listed rows are fixed, check the file again; the checker also looks for the other problems in WooCommerce's import code, so you do not trade one error for the next.
Questions
- What does "A new variation can only be created for a variable parent product." mean in WooCommerce?
- Since WooCommerce 11.1 this appears when "Update existing products" is ticked and a variation row has a SKU that is not in your store yet. WooCommerce looks up the product in the Parent column and skips the row because that product is not a variable product, for example a simple one. Reading the code, a Parent SKU that matches no product gives the same message: WooCommerce makes a temporary simple "Import placeholder" product for it, and a simple product cannot take variations.
- How do I fix it?
- Set Type to variable on the parent row, and list its attributes and all their values there. If the parent is already in your store as a simple product, change it to "Variable product" on the product edit screen first. Check that the Parent cell on each variation row is exactly the parent's SKU. Import the file again.
- The parent row is in my file as variable. Why do I still see this?
- With "Update existing products" ticked, WooCommerce only updates products already in your store. Reading the code, a new parent row with a SKU is skipped with "No matching product exists to update.", so its new variations find no variable parent. Import new products with the box unticked, then use the update import for changes.
Other WooCommerce import errors
- Sorry, you are not allowed to upload this file type.
- Invalid file type. The importer supports CSV and TXT file formats.
- The file is empty or using a different encoding than UTF-8, please try again with a new file.
- The uploaded file exceeds the upload_max_filesize directive in php.ini.
- A product with this SKU already exists.
- A product with this ID already exists.
- All checks
Sources
- WooCommerce 11.2.2 source: class-wc-product-csv-importer.php, lines 1270-1277 (the message): https://github.com/woocommerce/woocommerce/blob/11.2.2/plugins/woocommerce/includes/import/class-wc-product-csv-importer.php#L1270-L1277
- WooCommerce 11.2.2 source: class-wc-product-csv-importer.php, lines 302-321 (placeholder for an unknown Parent SKU): https://github.com/woocommerce/woocommerce/blob/11.2.2/plugins/woocommerce/includes/import/class-wc-product-csv-importer.php#L302-L321
- WooCommerce 11.2.2 source: class-wc-product-csv-importer.php, lines 1456-1491 (when the check runs): https://github.com/woocommerce/woocommerce/blob/11.2.2/plugins/woocommerce/includes/import/class-wc-product-csv-importer.php#L1456-L1491
Based on WooCommerce 11.2.2's import code and documentation. Not tested on a live store.