VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: john-doe on October 15, 2015, 15:51:56 PM

Title: Template Oveeride Question
Post by: john-doe on October 15, 2015, 15:51:56 PM
Greetings. I need to so some customizin into the products list bu i can't find the correct template override that is called by this string of code.

<?php
if (!empty(
$this->products)) {
$products = array();
$products[0] = $this->products;
echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));

?>


In which filder can i find the exact override because i saw the majority of the folders and i can't find it
Thanks in advance
Title: Re: Template Oveeride Question
Post by: kittmaster on October 15, 2015, 16:04:57 PM
I have found the best way to find what is what........is to do this:

Download the full package Virtuemart revision you are using and unzip all the files into a into a folder (file structure will show you where its located server side).

Use notepad++ for editing.

Open the folder for either admin area or component/user area and then search for *.php* (Will reduce number of .php files loaded into notepad++)

Select all > Right click and open all in notepad++

Then search for part of the code your looking for by using "Search in all open documents".

From there, it will point to where that code is being used and then you can do your template overrides accordingly.
Title: Re: Template Oveeride Question
Post by: john-doe on October 15, 2015, 16:25:26 PM
Well i did the other way that is i downloaded the folder com_virtuemart since the overrides options seems limited.
Looks like that the options needed are in the sublayouts folder  on the file products.php which IS NOT in the available folders to override, so if i do a change on the file on the next update is lost.

I guess i need to find another way to customize it
Title: Re: Template Oveeride Question
Post by: kittmaster on October 15, 2015, 16:35:04 PM
Yeah I've seen that too, I have a sublayout I had to modify, its on a list of notes to review whenever an update happens. Not sure why its being done that way.....sublayouts that can't be over wrote just seems like a disaster IMO.
Title: Re: Template Oveeride Question
Post by: Spiros Petrakis on October 15, 2015, 22:23:48 PM
All sublayouts can have template overrides, you probably dont create them in the right place.
If you like to override the products.php sublayout you first create a folder "sublayouts" in the html\com_vitruemart\ folder of your template and then you put your override in there.
Title: Re: Template Oveeride Question
Post by: GJC Web Design on October 15, 2015, 22:26:38 PM
Exactly as Spyros says... have you read the provided info?

http://docs.virtuemart.net/tutorials/templating-layouts/199-sublayouts.html
Title: Re: Template Oveeride Question
Post by: john-doe on October 16, 2015, 15:36:17 PM
Quote from: GJC Web Design on October 15, 2015, 22:26:38 PM
Exactly as Spyros says... have you read the provided info?

http://docs.virtuemart.net/tutorials/templating-layouts/199-sublayouts.html
OK since this is almost new for me i'll try to see what happens and i'll let you know