In the code below it has two find then hide query. Depending on which one is higher in the script is the one that will work. However i need them both to work. Does anyone see an issue? Ive tried merging and doing variables but then the offer button never hides.
$(document).ready(function(){ var source = $('#urlp').text() + "/make-an-offer #bstr"; var name = $('#ProductDetails .BlockContent h2').text(); var url = window.location.href; $('.modal-header h3').text("Make an Offer for "+name); $('.modal-body').load(source,function(){$('#contact_question').val("I would like to make an offer for: \n\n"+name+"\n\n"+url+"");}); })
$(document).ready(function(){ if($('.VariationProductInventory').text().match(/Out of stock/g)[0] === "Out of stock"){ $('button').hide(); } });
$(document).ready(function(){ if($('.VariationProductSKU').text().match(/DMD2231/g)[0] === "DMD2231"){ $('button').hide(); } });