Yes you can create an Add to Cart button link that includes the variation as follows:
https://yoursite.com/cart/?add-to-cart=555&variation_id=666&attribute_pa_attribute-slug=attribute-value
where
555
is the product ID found under the product title in the All Products page:
Link to image: https://d.pr/i/SmD2WL
and 666
is the variation ID found under the Variations tab in the product editor:
Link to image: https://d.pr/i/7fBe2t
attribute_pa_attribute-slug
is the attribute slug with a prefix of attribute_pa_
. You can find the attribute slug under Products ? Attributes:
Link to image: https://d.pr/i/oaNscY
and attribute-value
is the attribute value slug which is found when you click the configure terms
link under Products ? Attributes:
Link to image: https://d.pr/i/KTuD6w
That will create a link that will add the variation to the cart with out any SKU involved.
“Do I understand correctly that there is no PHP filter available that will disable the SKU check for the product importer?”
The schema for the default importer can be found here:
https://github.com/woocommerce/woocommerce/wiki/Product-CSV-Import-Schema#csv-columns-and-formatting
indicates that the SKU
is required and it does need to be unique.
I tested this on my own site and it rejected a duplicate SKU so there is no easy way around this issue.
I hope that helps you to figure it out.
-
This reply was modified 4 years, 4 months ago by mouli a11n. Reason: typos