VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Wolfman75 on April 05, 2015, 20:02:50 PM

Title: Remove category list from manufacture page
Post by: Wolfman75 on April 05, 2015, 20:02:50 PM
I have added a link to direct visitors to the page listing all the products made by a manufacture but I do not like that the category list shows at the top before all the products are displayed. Is there a way to remove the category list from the manufactures products page?
Title: Re: Remove category list from manufacture page
Post by: jenkinhill on April 05, 2015, 20:11:57 PM
http://forum.virtuemart.net/index.php?topic=128401
Title: Re: Remove category list from manufacture page
Post by: Wolfman75 on April 05, 2015, 21:41:31 PM
http://www.gunznfun.com/manufactures-list/manufacturer/beretta

Joomla 3.4.1
VirtueMart 3.0.6.4
Title: Re: Remove category list from manufacture page
Post by: Wolfman75 on April 07, 2015, 15:39:37 PM
Anyone have any idea what files I need to change?
Title: Re: Remove category list from manufacture page
Post by: jenkinhill on April 07, 2015, 16:54:50 PM
It looks like you are already using template overrides, maybe a VM theme? If so you will probably have to edit one or more of those. The manufacturer products are displayed using the category view, but if you modify that view to remove the cat list then you will change the standard cat display itself as well. So another view has to be created, or check code written to not display the cats when linked from the manufacturer page. Maybe best is to ask the template/theme developer.
Title: Re: Remove category list from manufacture page
Post by: Studio 42 on April 07, 2015, 23:24:44 PM
As said by jenkinhill, the list use same file as category.
What you have to do, is add a condition in the file.
YOURSITE\components\com_virtuemart\views\category\tmpl\default.php

in this file search for
/* Show child categories */
add after :
$manufacturer_id = JRequest::getInt('virtuemart_manufacturer_id',0);

next line
if (VmConfig::get ('showCategory', 1) and empty($this->keyword)) {
change to
if (VmConfig::get ('showCategory', 1) and empty($this->keyword) and !$manufacturer_id) {
to remove the children categories when you have a manufacturer set

Note : this is the case when you come from the manufacturer view, but if you use filter manufacture it's same.


to prevent that the categories are hide when you are already in a category and using the manufacturer filter then replace
if (VmConfig::get ('showCategory', 1) and empty($this->keyword)) {
by
if (VmConfig::get ('showCategory', 1) and empty($this->keyword) and !$manufacturer_id and !empty($this->category)) {
because the category is empty when you  come from the manufacturer view, but not in when you are in a category.
I think this is the code you need.

Don't forget to make a backup of file and the best is to use template overide to not loose your changes on virtuemart updates.

Cheers,
Patrick K
Title: Re: Remove category list from manufacture page
Post by: SJL71 on November 01, 2015, 01:11:01 AM
Hi

Just a quick note to say thanks for providing help on this one as I was struggling to find solution.  This worked great.

Thanks
Scott
:D