How to fix it
- Add the attribute to the parent row, for example Attribute 1 name "Colour" and Attribute 1 value(s) "Red, Blue", with every value the variations use.
- If the parent is already in your store, add the attribute to it on the product edit screen, under Attributes.
- Check the spelling: capital letters do not matter, but "Colour" and "Color" are two different attributes.
- 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... variable,TEE,Tee,1,visible,taxable,1,,,,,Size,"S, M",0 variation,TEE-RED,Tee Red,1,visible,taxable,1,3,20.00,,TEE,Colour,Red,0
What the checker says about it
- Line 3: "Tee Red": the attribute "Colour" is not on the parent "TEE" (line 2). WooCommerce drops it from the variation, which then matches any value. Add "Colour" with all its values to the parent row.
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 cannot be created because the parent product has no "%s" attribute." mean in WooCommerce?
- This is a message template in WooCommerce's import code: %s is replaced by the attribute name from your row, such as "Colour". Since WooCommerce 11.1 it appears when "Update existing products" is ticked and a variation row has a SKU that is not in your store yet. WooCommerce tries to create that variation, sees that the parent product has no attribute with that name, and skips the row. On a normal import of new products there is no message: the attribute is dropped and the variation matches any choice.
- How do I fix it?
- Add the attribute to the parent row, for example Attribute 1 name "Colour" and Attribute 1 value(s) "Red, Blue", with every value the variations use. If the parent is already in your store, add the attribute to it on the product edit screen, under Attributes. Check the spelling: capital letters do not matter, but "Colour" and "Color" are two different attributes. Import the file again.
- Why do I only see this when updating products?
- WooCommerce runs this check only when "Update existing products" is ticked and the variation is new. On a new-products import it does not stop the row. It drops the attribute instead, so the variation imports but matches any choice. The fix is the same in both cases.
Other WooCommerce import errors
- A new variation cannot be created because "%1$s" is not an option of the parent product's "%2$s" attribute.
- A new variation can only be created for a variable parent product.
- 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.
- All checks
Sources
- WooCommerce 11.2.2 source: class-wc-product-csv-importer.php, lines 1323-1334 (the message): https://github.com/woocommerce/woocommerce/blob/11.2.2/plugins/woocommerce/includes/import/class-wc-product-csv-importer.php#L1323-L1334
- 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.