Forums / Templates, Stylesheets, Page Layout / Limit content of drop down catagorie side box to one catagorie?

Limit content of drop down catagorie side box to one catagorie?

Locked

Views: 1,915

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
18 Apr 2008, 6:05 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Limit content of drop down catagorie side box to one catagorie?

You can add this test for the current top category being equal to the "Make" category id (77):

if ((int)$_GET[cPath] == 77) {
...code to be executed if 77...
}

or the converse:

if ((int)$_GET[cPath] != 77) {
...code to be executed if not 77...
}

Since I don't know the code for that mod, I can't tell you exactly where to put it. In a standard tpl_categories.php, you would add just

(int)$_GET[cPath] != 77 or

in this linephp if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) { // skip if this is for the document box (==3) } else { to get this```php
if ((int)$_GET[cPath] != 77 or zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
// skip if this is for the document box (==3)
} else {

18 Apr 2008, 5:55 PM
#3
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Limit content of drop down catagorie side box to one catagorie?

This is the code for the tpl_catagorie_select.php

<?php /** * Side Box Template * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_manufacturers_select.php 4771 2006-10-17 05:32:42Z ajeh $ */ $content = ""; $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">'; $content .= zen_draw_form('categories_form', zen_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'); $content .= zen_draw_hidden_field('main_page', FILENAME_DEFAULT); $content .= zen_draw_pull_down_menu('cPath', zen_get_categories_no_sub(array(array('id' => '', 'text' => PRODUCT_LISTING_SEARCH_TEXT_ALL_CATEGORIES)), '0' ,'', '1'), (isset($_GET['categories_id']) ? $_GET['categories_id'] : ''), 'onchange="this.form.submit();" size="1"') . zen_hide_session_id(); $content .= '</form>'; $content .= '</div>'; ?>

I did disable the sub-catagorie for the drop down menu so I will have to go in and change it back to the original function file so it will open sub-catagorie in the drop down box.

If you can figure out how to edit this code to list the sub catagories of the catagorie 77 so it will list the makes in the drop down menu.
Thanks in advance!

18 Apr 2008, 6:08 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Limit content of drop down catagorie side box to one catagorie?

For this mod, the category limitation will have to be done in a class function. If you don't know where the mod function files are, use the Developers Toolkit to search for zen_get_categories_no_sub. It would be easiest for the original mod creator to locate the place for the test.

18 Apr 2008, 8:33 PM
#5
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Limit content of drop down catagorie side box to one catagorie?

The developer have Included a code to limit the display to the top catagorie. That code can be added to the function/catagories.php I know how to reverse that.

The question is How can I limit the content of the drop down box to the catagorie-77 "Make"
I could then go into the code and limit the display to Catagorie level 2 which is a Subcatagorie for Make.

Also If you could answer my other question regarding the removal of SQL Patch.