cancel
Showing results for 
Search instead for 
Did you mean: 

Change price to sold if out of stock

Change price to sold if out of stock

Hi,

 

I was trying to change the price on 'catalog product view'  to 'Sold', if it is out of stock.

However I cannot find the right place to put it.

I looked around in vendor/magento/module-catalog/view/frontend/templates/product/view, but couldn't find the spot where the price is placed.

 

Can someone help?

 

Thanks 

Yuan

3 REPLIES 3

Re: Change price to sold if out of stock

Hi @steelvintage,

You can check the template fie path using enable template path hints

https://docs.magento.com/m2/ce/user_guide/system/template-path-hints.html

If you change any core file then it should be override in your theme.

you can also enable using command line:

Enable
php bin/magento dev:template-hints:enable 
Disable
php bin/magento dev:template-hints:disable 

I hope it will help you!

Re: Change price to sold if out of stock

Hey,

 

I'm new to Magento too, sorry it's more like a question than help but, to do that it isn't needed to create a custom module?

 

Btw are the products out of stock showing in frontend?

 

Greets Smiley Very Happy

Re: Change price to sold if out of stock

Hi @Vimal Kumar ,

 

I tried that already, but there where no hints for the price. For everything else seems to be a path, but not for the price xD

 

thanks thought

Yuan