Title: Variable product
Last modified: July 18, 2022

---

# Variable product

 *  Resolved [WebmasterNYC01](https://wordpress.org/support/users/webmasternyc01/)
 * (@webmasternyc01)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/variable-product-54/)
 * I am using short code for “add to cart.” For a variable product it redirects 
   to the product page.
 * I am looking for a way to add a variable product to cart without redirecting 
   to the product page.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Kaushik S. a11n](https://wordpress.org/support/users/kaushiksomaiya/)
 * (@kaushiksomaiya)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/variable-product-54/#post-15833514)
 * Hi there [@webmasternyc01](https://wordpress.org/support/users/webmasternyc01/)!
 * Thanks for contacting us.
 * I understand you are using `[add_to_cart id="IDHERE"]` shortcode, but you want
   it to add variable products to the cart without redirecting to the product page.
 * In this case, you can do the following:
    1. Ensure the variations do not have “Any Attribute..” option – They must be assigned
       an attribute value.
    2. Use variation ID in `[add_to_cart id="VARIATION_ID_HERE"]` instead of the product
       ID.
 * You’ll find the variation IDs under the Variations tab.
 * I hope this helps! 🙂
 *  Thread Starter [WebmasterNYC01](https://wordpress.org/support/users/webmasternyc01/)
 * (@webmasternyc01)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/variable-product-54/#post-15835640)
 * Is there a way to display variations in drop down instead of creating a listing
   for each variation?
 *  [Mirko P.](https://wordpress.org/support/users/rainfallnixfig/)
 * (@rainfallnixfig)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/variable-product-54/#post-15836768)
 * Hi [@webmasternyc01](https://wordpress.org/support/users/webmasternyc01/),
 * > Is there a way to display variations in drop down instead of creating a listing
   > for each variation?
 * Not out of the box in WooCommerce but you can use a plugin like [https://wordpress.org/plugins/display-product-variations-dropdown-on-shop-page/](https://wordpress.org/plugins/display-product-variations-dropdown-on-shop-page/)
   or custom code and [here is an example](https://gist.github.com/corsonr/37e5430896df10252b0e03c60f00d6a3).
 * * _Make sure to save a full backup before you install plugins or add custom code
   to your site._
 * Hope this helps.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Variable product’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Mirko P.](https://wordpress.org/support/users/rainfallnixfig/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/variable-product-54/#post-15836768)
 * Status: resolved