VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: thebit on January 30, 2015, 11:59:25 AM

Title: [VM2] how to customize VM search results page?
Post by: thebit on January 30, 2015, 11:59:25 AM
Hello,
I realized that in the results page of VM search there are some page element I wish to remove such as VirtueMart Category View (searched_word), name of manufacturer.
Is there a way to realize that from VM configuration or I must to edit VM template code? In the second case, what's the template page?
Thanks
Title: Re: [VM2] how to customize VM search results page?
Post by: GJC Web Design on January 30, 2015, 12:17:05 PM
by template over rides

the template is the category template .. they both use the same
Title: Re: [VM2] how to customize VM search results page?
Post by: thebit on January 30, 2015, 12:48:26 PM
Quote from: GJC Web Design on January 30, 2015, 12:17:05 PM
by template over rides

the template is the category template .. they both use the same
Which category template?  VM Product Category or Joomla Category?
Can you well explain what is the path?
Thanks.
Title: Re: [VM2] how to customize VM search results page?
Post by: GJC Web Design on January 30, 2015, 12:50:50 PM
Joom cat??? how would that work?
components\com_virtuemart\views\category\tmpl\default.php

over ride it
Title: Re: [VM2] how to customize VM search results page?
Post by: thebit on January 30, 2015, 14:28:07 PM
Ok, thanks.
So, I am very surprised that VM not yet has some backend features such as VM template custimization for layour (or import/export csv, as I mentioned in another topic)
In VM 3 has anything changed?
Title: Re: [VM2] how to customize VM search results page?
Post by: GJC Web Design on January 30, 2015, 17:59:14 PM
nope - import/export is perfectly adequately handled by csvi - it has a free download

what would be the point of a clicky clicky- draggy droppy template builder? everyone has there own ideas about what they want in their shop --
that is why VM is amazingly extensible with a small amount of html and css knowledge with any design or idea feasible

You get a base fully functioning shopping cart for free
then you template it or install a 3rd party template - just like Joomla
Title: Re: [VM2] how to customize VM search results page?
Post by: jamesl-kemet on November 26, 2020, 18:09:08 PM
Hi, sorry to reply in this topic as it's quite old although related to my quesion. Is it possible to use a different template for the search results page but keeping the category template as it is? I have been searching around to see if there is an if or else statement that could be used on the category/tmpl/default.php template to distinguish between a VM serch results page or normal product category page? Thanks

Joomla! 3.9.21
VirtueMart 3.8.4

will be updating the above soon ;)
Title: Re: [VM2] how to customize VM search results page?
Post by: pinochico on November 26, 2020, 20:33:46 PM
I think for search result is used normal normal product category page == category/tmpl/default.php
Title: Re: [VM2] how to customize VM search results page?
Post by: jenkinhill on November 26, 2020, 22:08:11 PM
You can specify an override for each category and let searches use the default.
Title: Re: [VM2] how to customize VM search results page?
Post by: GJC Web Design on November 26, 2020, 22:47:38 PM
something like

if(empty($this->keyword)) {
   //is normal cat display
}else{
   //is search result
}
Title: Re: [VM2] how to customize VM search results page?
Post by: jamesl-kemet on November 27, 2020, 14:10:19 PM
Thank you all for the help above. The if and else statments worked with the category template, however I've found that i need to amend the sublayouts > products template too and '$this->keyword' doesn't seem to work in this template
Title: Re: [VM2] how to customize VM search results page?
Post by: jenkinhill on November 27, 2020, 15:48:15 PM
You are using if/else to call an override to the category default.php? If so that page, in turn, can call sublayout overrides.
Title: Re: [VM2] how to customize VM search results page?
Post by: GJC Web Design on November 27, 2020, 19:29:22 PM
or pass $this->keyword to your sublayout

echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating,'keyword'=>$this->keyword));


and at the other end

$keyword = $viewData['keyword'];

might work