0

I'm trying to figure out how to show stock status on product page (In stock/Out of stock). I tried to change stock message from the Catalog page but it didn't work ! I guess its because I use a custom theme.

Any tips ? Thanks.

3
  • first of all change to default theme from backend "Magento Blank or Luma" and check on detail page. message is there or not? – Gohil Rajesh May 31 at 13:01
  • Yes the message appears ! – crowd42 May 31 at 13:12
  • that mean your custom theme overrided that code and removed this message – Gohil Rajesh May 31 at 13:15
0

go to

/app/design/frontend/Your/Theme/Magento_Catalog/layout/catalog_product_view.xml

and search for

<referenceBlock name='product.info.stock.sku' remove='true'/>

change it to

<referenceBlock name='product.info.stock.sku' remove='false'/>

hope it helps you

3
  • It worked ! "In stock" is now displayed alongside with sku (which I prefer be hidden). But when a product is out of stock, "In stock" is still displayed, but i guess that a problem for another question. Thank you so much for your help. – crowd42 Jun 1 at 11:18
  • happy to hear it helps you – Gohil Rajesh Jun 1 at 11:41
  • Oops, I forgot :-) – crowd42 Jun 1 at 11:47
0

Admin panel -> Go to -> store -> configuration-> Catalog -> Inventory -> Display Products Availability in Stock on Storefront ->Select Yes from the dropdown -> Click on save config button !

Clear the cache and check at frontend - it will not display !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.