Knowledgebase:
ADD TO CART VS SOLD OUT
Posted by on 26 January 2016 08:01 AM

Disclaimer: This will work for stores on Miva Version 9.0 or newer. Note that this will require making template changes. Make sure you make sure you are aware of what version was active before any changes are made. These edits are low-risk but if you feel uncomfortable with making these changes then we advise you to seek help from a developer.

 

Objective: These are instructions will aid in fixing the Add to Cart and Sold Out button discrepancy on the Product Display Layout

 

Issue(s): Sold out button still displays when I select an attribute that is in stock but the button is clickable.

 

 

Make Changes to the scripts.js file 

 

Current outOfStock function in Script.js file

 

// ---- Update Button For "Out Of Stock" ---- //

function outOfStock () {

var button = $('#js-add-to-cart'),

buttonText = button.val(); if (button.is(':disabled') == true) {

button.addClass('bg-gray').val('Sold Out');

} else {

button.removeClass('bg-gray').val(buttonText);

};

}; outOfStock ();

 

Revision outOfStock function Script.js file

// ---- Update Button For "Out Of Stock" ---- //

function outOfStock () {

var button = $('#js-add-to-cart');

if (button.is(':disabled') == true) {

button.addClass('bg-gray').val('Sold Out');

} else{

button.removeClass('bg-gray').val('Add to Cart');

};

}; outOfStock ();

(1 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako support.miva.com/supportsuite/index.php?