How do I disable the "only 1 left!" on my product pages?

Carissa_Lough
New Member
2 0 0

I'm setting up a a multi-brand ecommerce site. Many of the products that I stock are in relatively low numbers, due to the expansive range, lots of colour and fabric options, and outlay required to purchase stock. How do I disable "only 1 left!", "only 5 left!" on the product pages? I don't necessarily want my customers to know that I only have small quantities of most stock items!

0 Likes
gina-gregory
Shopify Expert
710 48 169

Hi Carissa. Open the product.liquid template and find this code:

if (variant.inventory_management) {
     if (variant.inventory_quantity < 10 && variant.inventory_quantity > 0) {
          $variantQuantity.html({{ 'products.product.only_left' | t: count: '1' | json }}.replace('1', variant.inventory_quantity)).show();
      } else {
          $variantQuantity.hide();
     }
 }

You can either delete it entirely or comment it out so it doesn't run. To comment it out, wrap the code in /* and */

/* if (variant.inventory_management) {
     if (variant.inventory_quantity < 10 && variant.inventory_quantity > 0) {
          $variantQuantity.html({{ 'products.product.only_left' | t: count: '1' | json }}.replace('1', variant.inventory_quantity)).show();
      } else {
          $variantQuantity.hide();
     }
 } */

The code should turn all orange in the editor if it's commented out. Commenting it out is a good idea if you ever wanted to bring that functionality back later.

0 Likes
Carissa_Lough
New Member
2 0 0

Thank you! That's worked :-)

0 Likes
Jon_Carpenter
New Member
5 0 0

Hm, I cant seem to find it. Does its location vary by template? I'm using Pacific, thanks.

Jon

0 Likes
Jason
Shopify Expert
10272 144 1942

Does its location vary by template?

Absolutely. It also can vary between versions of the same theme so take any advice as a guide only. 

Some themes have the ability to toggle the feature via theme settings so that should be your first place to check.

The code that shows the message is likely to be in theme.js.liquid - but that's a guess since I don't have the theme handy.

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
Jon_Carpenter
New Member
5 0 0

Ok thanks a lot.

0 Likes
gina-gregory
Shopify Expert
710 48 169

If you provide the password to your site, I might be able to find it.

0 Likes
Jon_Carpenter
New Member
5 0 0

Works for me! How do I DM you?

0 Likes
gina-gregory
Shopify Expert
710 48 169

Can you post the password here? You can always change the password later.

0 Likes