Bit new to this, so please excuse me. Below is some JS I have started with as a template which works. If a number in the inventoryLevel string shows above one, it will display an in stock message, styled nicely.
<script type="text/javascript">
$(document).ajaxComplete(function(event,request, settings) {
var inventoryLevel = $(".InventoryLevel .VariationProductInventory").text();
[B] if(parseInt(inventoryLevel) >= "0") {[/B]
$(".InventoryLevel .VariationProductInventory").html("<p style='font-family='Open Sans',Arial,Helvetica,sans-serif; font-size='13px'; font-weight='600'; font-color='#000'><img align='left' src='/product_images/uploaded_images/productcheck.jpg' alt='' /> Confirmed as <u>In Stock</u></p>");
}
});
</script>
Can anyone please tell me how I can change the above to search for “Sold Out” instead of a number? It’s something I need to change in the bolded bit above but I don’t know what do.
Any help would be greatly appreciated.
Thank you very much.