Originally posted by Matt Zimmermann
View Post
Announcement
Collapse
No announcement yet.
Displaying SOLD OUT button for Inventory Variant level of 0
Collapse
X
-
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
-
Hi Leslie,
Revert back to the original button and replace your outOfStock function in scripts.js with this:
Code:// ---- Update Button For "Out Of Stock" ---- // function outOfStock () { var button = $('#js-add-to-cart'); var buttonText = button.html(); if (button.is(':disabled') === true) { button.addClass('bg-gray').html('Sold Out'); } else { button.removeClass('bg-gray').html(buttonText); } } outOfStock();
Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
Comment
-
Originally posted by Matt Zimmermann View PostHi Leslie,
Revert back to the original button and replace your outOfStock function in scripts.js with this:
Code:// ---- Update Button For "Out Of Stock" ---- // function outOfStock () { var button = $('#js-add-to-cart'); var buttonText = button.html(); if (button.is(':disabled') === true) { button.addClass('bg-gray').html('Sold Out'); } else { button.removeClass('bg-gray').html(buttonText); } } outOfStock();
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
-
Hi Leslie,
Did you revert back to this button code and is there inventory for the variants?
Code:<button id="js-add-to-cart" class="button button-block uppercase add-to-cart bg-green white bold">Add <span class="small-inline-block hide">to Cart</span></button>
Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
Comment
-
Yes and Yes.
Here is the button code used:
Code:<button id="js-add-to-cart" class="button button-block uppercase add-to-cart bg-green white bold">Add <span class="small-inline-block hide">to Cart</span></button>
Code:<button id="js-add-to-cart" class="button button-block uppercase add-to-cart bg-green white bold" disabled>Add <span class="small-inline-block hide">to Cart</span></button>
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
-
Hi Leslie,
It's possible. Are you seeing any JavaScript errors in the console?Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
Comment
-
There are two
Unchecked runtime.lastError: The message port closed before a response was received.Failed to load resource: the server responded with a status of 404 ()Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
-
Hi Leslie,
Since the initial state may be that the item is sold out, that might be causing the issue. Try replacing the outOfStock function with this:
Code:// ---- Update Button For "Out Of Stock" ---- // function outOfStock () { var button = $('#js-add-to-cart'); if (button.is(':disabled') === true) { button.addClass('bg-gray').html('Sold Out'); } else { button.removeClass('bg-gray').html('Add <span class="small-inline-block hide">to Cart</span>'); } } outOfStock();
Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
Comment
-
Hi Matt, thanks!!! This is soooo close. The only issue I have now is the initial Select One state displays "Sold Out". Is there any way to display a grayed out Add to Cart button until a selection has been made?
I'm using this button code (along with the update to the outOfStock function):
Code:<button id="js-add-to-cart" class="button button-block uppercase add-to-cart bg-green white bold" disabled>Add <span class="small-inline-block hide">to Cart</span></button>
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
-
Hi Leslie,
Not that I know of since, on load, Miva will make the button disabled because there is not valid selection. That is the biggest drawback of adding the Select One option.Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
Comment
-
Originally posted by Matt Zimmermann View PostHi Leslie,
Not that I know of since, on load, Miva will make the button disabled because there is not valid selection. That is the biggest drawback of adding the Select One option.
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
-
Originally posted by Matt Zimmermann View PostHi Leslie,
That is the biggest drawback of adding the Select One option.
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
-
Hi Leslie,
You might try doing it through CSS:
Code:.add-to-cart[disabled] {display: none;}
Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
Comment
-
Originally posted by Matt Zimmermann View PostHi Leslie,
You might try doing it through CSS:
Code:.add-to-cart[disabled] {display: none;}
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
Comment