I am trying to figure a way to hide show stock status/availability on product page.
1 Answer
Method 1:
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 en_US.csv on your theme like below:
app/design/frontend/[Vendor]/[Theme]/i18n/en_US.csv
And add the translation text like "In stock","Salable"
-
-
U want to show/hide based on what?? You can put your condition in template Oct 16, 2021 at 17:18
-
I need to use the logic which was raised in this post: magento.stackexchange.com/questions/247059/… But on Magento 2 Oct 17, 2021 at 7:41
-
where is vendor/magento/module-catalog/view/frontend/templates/product/view/type/default.phtml located ? in app/design/frontend/vendor ? ? Oct 17, 2021 at 7:52
-
1Override this file in your file as a explained in answer and comment in-stock logic code Oct 17, 2021 at 9:41