VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Gretch on May 10, 2014, 03:19:48 AM

Title: Template Overrides not working
Post by: Gretch on May 10, 2014, 03:19:48 AM
Joomla V2.5.19, VM 2.6.0a
My template overrides located in template/mytemplate/html/com_virtuemart/category and /productdetails are recognized in VM configuration for category and product layout overrides, but when selected, they are apparently not used.  If I change the override file names from my custom names to default.php they get used OK.

Any thoughts?  Since I have a work-a-round (naming the overrides to default.php) I am Ok for now.  Fortunately I only have one override template.

Thanks - you all do an awesome job monitoring all the questions in this forum! (And I have spent 2 hours searching for this problem so I know some of the questions you get!)

Gretch
Title: Re: Template Overrides not working
Post by: GJC Web Design on May 10, 2014, 10:26:12 AM
Hmm - I always just name my over rides default.php  any way

never tried with another name - but just tried with  - templates/xxxxxxx/html/com_virtuemart/productdetails/myoverride.php

appeared and selected in config->templates and showed up immeditely in the front end

if you have say myoverride.php then don't forget you need (if you keep the std template calls in the template)

templates/xxxxxx/html/com_virtuemart/productdetails/myoverride_images.php  to over ride the image template

make sure you haven't got a template defined individually in the product admin - should be (counter intuitively) "No override"

if it's on default it will take a template called "default"
Title: (SOLVED)Re: Template Overrides not working
Post by: Gretch on May 11, 2014, 21:19:53 PM
Thank you for your reply GJC Web Design.

After a messing around with this I found that I needed to have all lower case letters in the file name.  The overrides with capital letters in the files names were working great on my local machine using WAMP, but not on my hosting server.  Of course windows doesn't differentiate between lower & upper case where as Linux does.  And apparently VM doesn't keep the file name in the same case when retrieving it.

So, use all lower case and you can have as many template overrides as you want! 
Thanks for you  time.
Gretch