VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: PetervanDriel on January 17, 2013, 09:49:55 AM

Title: overrides does not work properly
Post by: PetervanDriel on January 17, 2013, 09:49:55 AM
Maybe a very stupid question.....

I just updated VM 2.0.14 to 2.0.18a.
Then I started searching for an easier way to keep my modifications to for example the shopping card, and found that I can make overrides in the html folder of my Joomla template.

So I did, and now only the default.php file is accepted as override, but no else.
For example I made changes in the file cart/default_pricelist.php but that changes are not accepted and is still using the original file in the component folder.

Any help?
Title: Re: overrides does not work properly
Post by: jjk on January 17, 2013, 10:04:40 AM
Should work if you place your override default_pricelist.php into the folder ...\templates\your-template-name\html\com_virtuemart\cart
Title: Re: overrides does not work properly
Post by: PetervanDriel on January 17, 2013, 10:12:19 AM
The file is there, but not used...
When I make a change in that file, nothing happens. Only when I modify the original file, it works.
Title: Re: overrides does not work properly
Post by: jjk on January 17, 2013, 10:34:13 AM
Did you disable the Joomla cache and eventually clear your browser cache?
Title: Re: overrides does not work properly
Post by: PetervanDriel on January 17, 2013, 11:25:07 AM
cache is disabled, cleaned the cache in my browser: no result :(
Title: Re: overrides does not work properly
Post by: jjk on January 17, 2013, 15:07:41 PM
I just tested this with my VM 2.0.18a version. Overwriting default_pricelist.php definitely works for me. Which Joomla version do you use? Just asking this because support for Joomla 1.5.x ended with VM 2.0.12.
Title: Re: overrides does not work properly
Post by: PetervanDriel on January 17, 2013, 15:37:35 PM
I have Joomla 2.5.8.
Could it be that this is related to the VM theme that I use? I mean, I see ' overrides'  in the theme, and I can use overrides in the joomla template folder.
Which override has a higher priority?
Title: Re: overrides does not work properly
Post by: jjk on January 17, 2013, 16:15:03 PM
You can probably find out that if you temporarily change to a Joomla default template.
Title: Re: overrides does not work properly
Post by: bulesz on January 18, 2013, 17:58:27 PM
Same here, I go mad because of this....all set to default, and Joomla default template...

If am I thinking right, the category list template should be here by default: components/com_virtuemart/views/category/tmpl/default.php

OR
the override: mytemplatename/html/com_virtuemart/category/default.php

and if I modify the file, NOTHING happen...cant see any differences on the FE...even if I delete the files...!!!!!

the SAME override result was working fine with the productdetails, but stacked at the category list...I dont know why....:( If it would be a cache /server issue, at editing the product details I should get the same "cant modify" result...but that went smoothly...

any help would be nice!

Oh, and if I put a new template file to the flder, like new_category.php, I DONT SEE IT in the category layout dropdown! :O

Many thanks,
B.
Title: Re: overrides does not work properly
Post by: jjk on January 18, 2013, 20:01:39 PM
Overriding category templates is a little bit different. Just in case you missed it, there is a hierarchy for the category templates. The selected 'Category Browse Page' template in the individual categories override the 'Category Layout' in the VM2 'Configuration' - 'Templates' Shopfront settings. This has the advantage that you can easily select different templates for different categories. Category templates (overrides) should be placed in
yourdomain\components\com_virtuemart\views\category\tmpl
Then you should be able select them from the VM2 backend.
(Mine works in 2.0.18a)
Title: Re: overrides does not work properly
Post by: bulesz on January 19, 2013, 00:14:36 AM
Many thanks for your reply!

I was doing exactly the same what you have mentioned...and there is an override file called "available_default.php" and cant see in the Virtuemart backend. :( Thats why Im confused... My system is VM 2.0.8, and cant live update (couldnt do the live update due getting the "-1 - Error occured - copy failed" error message).

So I'm still confused... :(
Title: Re: overrides does not work properly
Post by: jjk on January 19, 2013, 09:17:13 AM
Looks like VM2 doesn't pick up category-template-filenames with an underscore. Rename your 'available_default.php' to 'available-default.php' or a single word and it should work.
Concerning your update problem - a few hints will show up if you google for 'Error occurred copy failed'. You can also update by installing the latest version with the Joomla Extension Manager.
Title: Re: overrides does not work properly
Post by: bulesz on January 19, 2013, 13:49:18 PM
hohooo, thanks for the tip! yes, after renamed the file to "available-default.php" I could select from the list, but its weird that it seems to be not using by the system...

Cant see any of my modifications...