Support » Plugins and Hacks » [Plugin: Woocommerce] Auto-show qty and add to cart button with variable product

[Plugin: Woocommerce] Auto-show qty and add to cart button with variable product

  • Does anybody know how to automatically show the price, quantity and add to cart button without selecting variations are selected?

    My product price doesn’t change with the variations and it would be nice to remove, what I assume is, js hiding these fields.

    Any help would be appreciated.

Viewing 14 replies - 1 through 14 (of 14 total)
  • If you set the default variation (its on the variations tab at the bottom) the options will be pre-selected, and the add to cart visible. Thats the easiest way.

    Yeah I need this too, but in a global way, so updating products one by one is not necessary. If I find a way I’ll post it here.

    Hi, has anyone solved this yet? I need the work around as it’s been frustrating me for weeks.


    Even if this was achievable, how would the add to cart button know what to add if it hasn’t been selected yet?

    I’ve been working on a way to output product variations as rows in a table within a product with quantity and add to cart button for each variation. Here’s a screen of what I’ve got so far:


    Add to cart doesn’t work yet…

    What I did on my case is to select the first option available for each variation with jquery, on load.

    I agree that it’s just not the right thing to do, but it would be cool if woocommerce show the checkout button at least grayed out, and a js validation on click to let the customer know that the variations need to be picked first.

    if you go to http://store.hypebeast.com/brands/name/indigo-wool-coat

    any product on there, you’ll see that they’ve done this and they run woocommerce…any suggestions?

    There absolutely has to be a better solution to this. So so unusable!

    I myself have removed some JS from the core (which is terrible yes but what can I do?) and every update, I have to remove it again.

    How to make default select in Variable Product with variation.

    In my product it select color: black and size: small by default but I want otherwise say color:white and size small.

    I change the position up/down but no effect.

    Any body can help?

    yo gufranchorghay best to start your own thread on that.

    Hi Renegadesk,

    Did you ever get your add to cart buttons working for variables like in your screenshot?

    I have the product details all being displayed, but just need to get the add to cart button and quantity button working!



    Yeah jbezza I got it working the other day! Check the code here https://gist.github.com/3967956

    From what I’ve seen on the Woocommerce Github they will be adding the feature to show add to cart button without variations selected within the 2.1 release https://github.com/woothemes/woocommerce/issues/1984

    Thanks renegadesk!

    Thats great that they are adding it into standard woo commerce.

    I have added your code into our site, it displays the table correctly, however it only adds one into the cart no matter what the qty value is set too?

    Could this be because I am doing this code in the functions file of my child theme?

    Thanks again for the code!

    No probs jbezza. cheers for letting me know about the qty issue, I hadn’t actually tested different quantities…shiiiiiiit what an amateur. I’ve gotta launch the site this is for in about 2 weeks so I’ll do more testing and fix this before then. Follow the updates on gist as I probably wont post back here, I’ll just updated the code straight to gist when it’s fixed.

    Haha no worries! We’ve all made amateur mistakes like that haha! Will follow the code now.

    Thanks again.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: Woocommerce] Auto-show qty and add to cart button with variable product’ is closed to new replies.