WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. dustylavender
    Member
    Posted 2 years ago #

    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.

  2. mikejolley
    Member
    Posted 2 years ago #

    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.

  3. alesub
    Member
    Posted 1 year ago #

    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.

  4. juce33
    Member
    Posted 1 year ago #

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

    Cheers!

  5. sk
    Member
    Posted 1 year ago #

    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:

    http://www.evernote.com/shard/s1/sh/1919e447-147b-4c14-afc1-009e4a5231ec/5a96c3ef885fc4f316080b02853fc607

    Add to cart doesn't work yet...

  6. alesub
    Member
    Posted 1 year ago #

    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.

  7. juce33
    Member
    Posted 1 year ago #

    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?

  8. babyboy808
    Member
    Posted 1 year ago #

    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.

  9. gufranchorghay
    Member
    Posted 1 year ago #

    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?

  10. sk
    Member
    Posted 1 year ago #

    yo gufranchorghay best to start your own thread on that.

  11. jbezza
    Member
    Posted 1 year ago #

    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!

    Cheers,

    James

  12. sk
    Member
    Posted 1 year ago #

    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

  13. jbezza
    Member
    Posted 1 year ago #

    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!

  14. sk
    Member
    Posted 1 year ago #

    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.

  15. jbezza
    Member
    Posted 1 year ago #

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

    Thanks again.

Topic Closed

This topic has been closed to new replies.

About this Topic