VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: morphic on October 13, 2018, 00:19:51 AM

Title: How to use two different overrides templates for products?
Post by: morphic on October 13, 2018, 00:19:51 AM
Hi there,
I want to use two different overrides product templates for products from two different categories.
I put both files in my_template/html/com_virtuemart/productdetails as default_1.php and default_2.php

But how or where should I set for use this templates? I've seen on Category in VM3 in second tab (Category view settings) and I see on Product page selectlist only default, dont override, multiadd, pdf and notify option.

Please give me any suggestion to solve that.

Many thanks
Title: Re: How to use two different overrides templates for products?
Post by: GJC Web Design on October 13, 2018, 13:48:37 PM
you need to name them with a dash .. not an underscore

then they will show up in the dropdown in the cat admin

default-one.php , default-two.php etc
Title: Re: How to use two different overrides templates for products?
Post by: morphic on October 13, 2018, 20:43:54 PM
Quote from: GJC Web Design on October 13, 2018, 13:48:37 PM
you need to name them with a dash .. not an underscore

then they will show up in the dropdown in the cat admin

default-one.php , default-two.php etc

Dang, I knew that I'm noob. :D

Thanks for response .
Title: Re: How to use two different overrides templates for products?
Post by: morphic on October 15, 2018, 11:14:54 AM
But after I've chosen new product template on Category nothing to do.

I've chosen default-product1 template but still default template is loading.
Title: Re: How to use two different overrides templates for products?
Post by: GJC Web Design on October 15, 2018, 12:22:44 PM
If correctly done impossible -- I use this all the time .. caches?, double check settings?
Title: Re: How to use two different overrides templates for products?
Post by: morphic on October 15, 2018, 17:09:11 PM
What do you mean correctly done?

I have a template with html/com_virtuemart/productdetails and files inside this directory.

I had been copied default.php file to local, edited it (add some tabs), saved as default-product1.php and second default-product2.php and sent both back to server.

Default all categories had default template from my override template. But I want change templates for two categories (different tabs for them). And after change Product template on Category (subcategory and parent category) VM still use default.php (I can't see this new tabs).

When I change names - default to default-old and default-product1 to default all categories use name changed default-product1 template.

LASTEST NEWS - it's working fine to new added products but wrong for existing. New haven't description. Cache is disabled
Title: Re: How to use two different overrides templates for products?
Post by: morphic on October 16, 2018, 00:11:51 AM
OK, done.

User chosen default template on all product cards. Change to No override make that all working fine. :D

Many thanks for help.