Only "x" items left in stock

Hey, can anyone help me on how to keep my Shopify website to only show “only 3 left in stock” even after when someone buys it. I want for it to only stay at 3, and I don’t want to go into shopify and change the stock level each time it reaches 0. I am also using AutoDS and Debutify them by the way.

My website is www.solairhome.com

Thanks

Hello @Solair_1 ,

I suggest you have to go with a developer who can check the theme files and modify the code.
but if you don’t want please follow this alternate solution:
Edit theme.liquid search for and just before of it add this code.

{% if template contains 'product' %}

document.addEventListener('DOMContentLoaded', function() {
  var quantityItems = document.querySelectorAll('.quantity-item-value-inventory_quantity');
  
  quantityItems.forEach(function(item) {
    item.innerHTML = 3;
  });
});

{% endif %}

Thanks

1 Like

Hi, there

In frontend could show a fake stock “only 3 left in stock”

and in backend enable the “continue selling when out of stock”

could you kindly share your store coloration permission ?