Author Topic: How to use two different overrides templates for products?  (Read 375 times)

morphic

  • Beginner
  • *
  • Posts: 16
  • A beginner
How to use two different overrides templates for products?
« 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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8586
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: How to use two different overrides templates for products?
« Reply #1 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

morphic

  • Beginner
  • *
  • Posts: 16
  • A beginner
Re: How to use two different overrides templates for products?
« Reply #2 on: October 13, 2018, 20:43:54 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 .

morphic

  • Beginner
  • *
  • Posts: 16
  • A beginner
Re: How to use two different overrides templates for products?
« Reply #3 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.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8586
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: How to use two different overrides templates for products?
« Reply #4 on: October 15, 2018, 12:22:44 pm »
If correctly done impossible -- I use this all the time .. caches?, double check settings?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

morphic

  • Beginner
  • *
  • Posts: 16
  • A beginner
Re: How to use two different overrides templates for products?
« Reply #5 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

morphic

  • Beginner
  • *
  • Posts: 16
  • A beginner
Re: How to use two different overrides templates for products?
« Reply #6 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.