VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: PrPrO on September 17, 2019, 17:37:41 PM

Title: Stockhandling on product level Override help needed
Post by: PrPrO on September 17, 2019, 17:37:41 PM
Hello,

I am using VirtueMart 3.2.12 on Joomla 3.9.1 and need help with the stockhandling overrides.

I haven't done any overrides yet and would like to hide (Do not Display) a product if its stock is 0, and I would like to do that only for one category, ie. several products - not the whole shop.

Could anyone please help me with the code I should copy to make it work as intended?
And where should the file be uploaded:
templates/my_template/html/com_virtuemart/virtuemart/
templates/my_template/html/com_virtuemart/sublayouts
components/com_virtuemart/views/productdetails/tmpl - some overrides are already stored here

Thank you for your time,
Regards
Title: Re: Stockhandling on product level Override help needed
Post by: GJC Web Design on September 17, 2019, 18:40:39 PM
templates/my_template/html/com_virtuemart/sublayouts

adjust products.php or better make a unique e.g. productsnoshow.php and use it in the target category -> Product layout
Title: Re: Stockhandling on product level Override help needed
Post by: Milbo on September 18, 2019, 22:49:15 PM
You should just enable "stock on product level" in the main config
Title: Re: Stockhandling on product level Override help needed
Post by: GJC Web Design on September 19, 2019, 17:19:11 PM
but he only wants this on a certain category as far as I read it..
Title: Re: Stockhandling on product level Override help needed
Post by: PrPrO on September 21, 2019, 11:11:51 AM
Thank you for your answers and sorry for not repyling earlier.

Quote from: GJC Web Design on September 19, 2019, 17:19:11 PM
but he only wants this on a certain category as far as I read it..
Exactly, I only need it for one category.
The problem is I'm not to familiar with Virtuemart and wouldn't want to mess it up, hence I don't know where should I call which code.

Thats why I asked if someone already did something like this and would be willing to share the code for it.

Regards
Title: Re: Stockhandling on product level Override help needed
Post by: GJC Web Design on September 21, 2019, 11:32:48 AM
the answer is above --