0

Okay, I'm a dufus. I am trying to override the "Out of Stock" message displayed on the product page to "Sold Out". Currently using Magento 2.3.

Create an i18n folder in my custom theme folder, en_Us.csv file and put in the following in the file "Out Of Stock","Sold Out!"

Cleared the cache but it's still displaying that dreaded Out Of Stock instead of Sold Out!

I have tried searching on Google and here but it seems that simple tasks like these are not documented. Can anyone enlighten me?

Thanks.

  • filename should be en_US.csv` NOt en_Us.csv – Amit Bera Sep 23 '19 at 7:04
0

If you want to change this text only for product details page and for that section which you mentioned then you need to copy the following file to your theme:

vendor/magento/module-catalog/view/frontend/templates/product/view/type/default.phtml

You theme file location will be like below:

app/design/frontend/[Vendor]/[Theme]/Magento_Catalog/templates/product/view/type/default.phtml

And update the text.

Method 2:

Create one one en_US.csv on your theme like below:

app/design/frontend/[Vendor]/[Theme]/i18n/en_US.csv

And add the translation text like "Out of Stock".

  • I have created the en_US.csv file just like you suggested and in it there is a line that says, "Out of Stock","Sold Out!" But it is still displaying OUT OF STOCK on the product page. – Alex Lim Sep 23 '19 at 6:00
  • Did you do caching and other commands.? If not then please do that . – Mayur Sep 23 '19 at 6:03
  • Yes, I cleaned the cache and flush it from command line, still displaying the default text. Really frustrating. – Alex Lim Sep 23 '19 at 6:05
  • Once run the following command sudo chmod -R 777 var/ generated/ pub/static/ app/etc/ pub/media/ – Soundararajan m Sep 23 '19 at 8:40
  • @Soundararajanm, tried that with no luck. It still won't pick up the translation. – Alex Lim Sep 23 '19 at 22:28

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.