Liquid Code that Targets Products that Don't Track Inventory?

Shopify Partner
9 1 1



I'm working on a theme and the product page is currently showing Out of Stock on products that are set to Not Track Inventory. I've located the code that handles this but not sure how to create an if statement for products that don't track inventory.


The code says to show the Add to Cart button if the inventory is greater than 0, otherwise show the Out of Stock prompt... but this doesn't account for products that don't track inventory.


How can I target products that don't track inventory? Any help would be greatly appreciated!


Here is the code...

  if (parseInt(this_qty) > 0 || this_policy == "continue"){
    $(".stock-status .available").show()
    $(".stock-status .unavailable").hide()
  else {
    $(".stock-status .available").hide()
    $(".stock-status .unavailable").show()


I'm not sure if this is the right place to ask, if not can you please point me in the right direction?

Reply 1 (1)

Shopify Partner
6 1 2



You can use `product.available` or `variant.available`