VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: mcw1225 on March 03, 2016, 16:14:24 PM

Title: Disable Selected Categories in Front Page View
Post by: mcw1225 on March 03, 2016, 16:14:24 PM
Using: Joomla! 3.4.8 Stable
VirtueMart 3.0.12

Is it possible to disable SELECTED virtuemart categories on the Joomla front page when using the category layout?
However I still need ALL categories to be on display in the virtuemart store view.

Basically I only want my key categories on display on the home/front page.

Many thanks,
Mat
Title: Re: Disable Selected Categories in Front Page View
Post by: jenkinhill on March 03, 2016, 16:32:38 PM
I did something like that a couple of years ago. The site front page was built as a Joomla article rather than a VM page, with the few required categories coded on the page. The normal VirtueMart homepage was used through a "Store" menu link.
Title: Re: Disable Selected Categories in Front Page View
Post by: GJC Web Design on March 03, 2016, 17:06:58 PM
or over ride components\com_virtuemart\sublayouts\categories.php and drop them out of the loop if they don't match a $allowed_cats array u create

might mess up row counts etc


$allowed_cats = array(1,3,6,7);
foreach ( $categories as $category ) {

    if(!inarray($category->virtuemart_category_id,$allowed_cats )) {
Title: Re: Disable Selected Categories in Front Page View
Post by: jenkinhill on March 03, 2016, 17:47:18 PM
Quote from: GJC Web Design on March 03, 2016, 17:06:58 PM
might mess up row counts etc

It did for me every way I tried, which is why I hand coded the page.