How to fix it
- Add the value to the parent's list, for example Attribute 1 value(s) "S, M, XL" on the parent row.
- Or change the variation's value to one the parent already has.
- For a custom attribute (Attribute 1 global is 0) WooCommerce compares the text exactly, so "xl" and "XL" are different. Copy the value from the parent row.
- 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-XL,Tee XL,1,visible,taxable,1,3,20.00,,TEE,Size,XL,0
What the checker says about it
- Line 3: "Tee XL": "XL" is not one of the parent's Size values (S, M). Shoppers may not be able to choose this variation. Add the value to the parent row or fix the spelling.
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 "%1$s" is not an option of the parent product's "%2$s" attribute." mean in WooCommerce?
- This is a message template in WooCommerce's import code: %1$s is the value from your variation row, such as "XL", and %2$s is the attribute name, such as "Size". 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. The parent has the attribute, but not that value, and a shopper could never pick it, so WooCommerce skips the row. On a normal import of new products there is no message, and the variation may not be selectable in your store.
- How do I fix it?
- Add the value to the parent's list, for example Attribute 1 value(s) "S, M, XL" on the parent row. Or change the variation's value to one the parent already has. For a custom attribute (Attribute 1 global is 0) WooCommerce compares the text exactly, so "xl" and "XL" are different. Copy the value from the parent row. Import the file again.
- Can I leave the value blank?
- Yes. In WooCommerce's import code an empty value is allowed: it makes an "any" variation that matches every choice of that attribute.
Other WooCommerce import errors
- 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.
- A product with this SKU already exists.
- All checks
Sources
- WooCommerce 11.2.2 source: class-wc-product-csv-importer.php, lines 1337-1370 (the message): https://github.com/woocommerce/woocommerce/blob/11.2.2/plugins/woocommerce/includes/import/class-wc-product-csv-importer.php#L1337-L1370
- 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.