I am trying to find a way to have a link to a specific product variation.
I thought I had it solved with this plugin... https://wordpress.org/plugins/woocommerce-direct-variation-link/
However the I have 2 word product attribute names and can't seem to get it to work? I put _, -, & and + between the 2 words but not go.
Here is the doc...In my case I would have "color style" instead of just "color" mysite.com/product/happy-ninja/?color=blue
mysite.com/product/happy-ninja/?color=blue&size=small (additional variations should be separated by '&')
mysite.com/product/happy-ninja/?color=blue+green (where the variation value is "Blue Green" with the space replaced by a '+')
Further to the last poster, I couldn't get his code to work properly, but I did discover that WooCommerce generates these for the Cart most of the time:
It should have a suffix like this: http://website.com/product/product-name/?attribute_colours=Grey
Note that colours
is lowercase because it's the slug while Grey
is the actual name for the Variation.
For spaces in your Variation name, use a +
instead of the space.
For selecting multiple variation attributes, I believe you can just start with &
and spit the ?attribute_[slug]=Variation
again.