Hide the Add to Cart button until a variant selection has been made.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • greggc
    Mivite


    • Mar 2006
    • 296

    #1

    Hide the Add to Cart button until a variant selection has been made.

    I need to change our drop down lists to contain Select One. In doing this the add to cart button show sold out on the initial page load. Is it possible to hide the Add to cart button completely until a variant selection is made.
  • Bruce - PhosphorMedia
    Developer Partner











    • Mar 2006
    • 11257

    #2
    If you have jQuery available, the easiest way it something like this

    Code:
    
    
    <input id="CheckMe" type="checkbox" name="CheckMe"> <strong>Please check me to complete order.</strong></p>
    <button class="btn btn-action btn-lg" type="submit" id="CompleteOrder" disabled>Complete Order</button>
    
    
    At bottom of page add
    
    script
    
    $('#CheckMe').change(function () {
    $('#CompleteOrder').prop("disabled", !this.checked);
    }).change()
    
    script
    In your case, you'll want to switch the add (in the attribute template, a class like "required" to these variant attributes and change the first line to
    $('.required').change(function () {
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment

    Working...
    X