Variable Product Shortcodes
Basic products have shortcodes, why not Variable products?
Variable products already count as products and have their own IDs.
Add these shortcode options.
[product variableid="1234"] or
[product id="99" varid="1234"]or
Display a variable product with the unique id or sku, as you would a basic product.
Display multiple variable products with the unique id or sku, as you would a basic product.
[addtocart id="99" variableid="1234" ]
The add to cart shortcode could be altered to include variable products
Variable products (if talking about the parent product) are supported by shortcodes. That includes [products], [product], and [add_to_cart].
Specific variations within a variable product are supported (by ID or SKU) using [add_to_cart] which allows you to add a specific variation to the cart using the ID you specify.
2 years pasted from your answer Mike Jolley, many comments seem to say that there is a need about how to display product variation into any page.
So after i tried your beginning of solution only [add_to_cart id="variation id"] looks to work BUT without any design ready to go as we could expect with an hypothetical working [product id="variation id"]
For summarize [product id="product id"] offers a ready to go design solution to display a forward product on any page. [product id="variation id"] unfortunetly doesn't work.
[add_to_cart id="variation id"] allow to add to cart a product variation but does'nt display anything, and we have to design with HTML and CSS something to get design like with [product id="product id"]
Do i am right, and please can you tell we if now you have a real solution for this display ?
When do you think that we can be able to set a product variation with his ID or SKU for example into a Woocommerce carousel component?
This needs to happen.
Dustin, did you ever manage to achieve this?
I would like a short code where the variable product is preselected in the dropdown menu and the price is displayed for just the selected variable product (not the price range) but the user could easily change the drop down menu and see the new price.
This would be very useful!
i Like this idea. I'm currently trying to make this shortcode