Zen Cart Logo
Forums / General Questions / Show sideboxes in only one master category

Show sideboxes in only one master category

Views: 549

Results 1 to 3 of 3
23 Jun 2014, 4:48 PM
#1
monkeyjr47906 avatar

monkeyjr47906

New Zenner

Join Date:
Nov 2007
Posts:
72
Plugin Contributions:
0

Show sideboxes in only one master category

Hello -

I've searched the forum and I know how to show sideboxes based on page, customer login status, and product_id, however I've had zero luck figuring out how to show a sidebox only in a specific master category. Does anyone have any suggestions?

Thanks in advance.

23 Jun 2014, 5:50 PM
#2
monkeyjr47906 avatar

monkeyjr47906

New Zenner

Join Date:
Nov 2007
Posts:
72
Plugin Contributions:
0

Re: Show sideboxes in only one master category

Whoops I found it right after I posted ...

if ($_GET['cPath'] == 12 or $_GET['cPath'] == 47) {
//do it
} else {
//skip it
}  
23 Jun 2014, 5:51 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,091
Plugin Contributions:
56

Re: Show sideboxes in only one master category

You could add the following check around the content-building portion of /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_YOUR_SIDEBOX.php to limit its display to categories listings pages with a master-categories value of 77:

if ($current_page_base == 'index' && $categories_depth == 'nested' && strpos ('77_', $cPath) === 0) {
  ... normal processing ...

}

Please note the use of the === (exactly equal) operator on the last clause.

If you want to display the content on product-listing pages, too, just remove the && $categories_depth == 'nested' portion.