How can I modify HTML text for stock availability?

Hi there

How do i change this text from “Please Hurry! Only 3 left in stock” to just “Only 3 left in stock”

I have viewed the theme files but cant seem to find the html text to change it. I added this code in the template file but still not changing.

Only 3 left in stock

Screen Shot 2022-09-27 at 10.51.38 AM.png

hi @Troy27 ,

You must identify exactly the place of that text, where the position it doing show, what the kinds type do handling that text on pages or sections, then you to finding that place and change.

I guess you can change those texts from theme customize or setting of the app if you are using and app for that

Hey @Troy27 ,

could you please provide your store’s URL?

Thanks!

Hi Phavia

Yes however the text is displayed on the product page, its a Hot Stock Function this function is included in the theme. The theme doesn’t not allow customization of the function hense why you have to go edit the site code. The function comes with up with the css and positioning but not the html text being displayed that’s why i am unable to find how to change it.

Hi Dan

Yes however the text is displayed on the product page, its a Hot Stock Function this function is included in the theme. The theme doesn’t not allow customization of the function hense why you have to go edit the site code. The function comes with up with the css and positioning but not the html text being displayed that’s why i am unable to find how to change it.

Hi Nikki

You can see the text here -

Currently, The text showing on sidebar info of product page, so you can to finding the product-info.liquid or product.liquid file, then to finding the code handling that part.

If possible can you give the url of store, that will be easy more about checking.

jxconnection.com

hi @Troy27 ,

Can you to finding in the theme for the attribute class productView-hotStock, This is the place contains the text you doing want replace.

HI Phavia

I only have - product-hot-stock.liquid

{%- liquid
assign hot_stock_style = block.settings.hot_stock_style
assign spacing_top = block.settings.spacing_top
assign spacing_bottom = block.settings.spacing_bottom

if current_variant.inventory_management and current_variant.inventory_quantity > 0 and current_variant.inventory_quantity <= productMaxStock
assign checkShowHotStock = true
else
assign checkShowHotStock = false
endif
-%}

{%- if hot_stock_style == '2' -%} {{ 'products.product.hot_stock_2' | t : inventory: current_variant.inventory_quantity }}
{%- else -%} {{ 'products.product.hot_stock' | t : inventory: current_variant.inventory_quantity }} {%- endif -%}

hi @Troy27 ,

so you can go to the locales/en.json, then you can to finding the hot_stock_2 and hot_stock key words, then change the text you doing want change.

Hope can helpful to you!

1 Like

Thanks so much Phavia, Got it sorted :slightly_smiling_face: