Zen Cart Logo
Forums / All Other Contributions/Addons / Hidden Categories dependent on users Help!!

Hidden Categories dependent on users Help!!

Locked

Views: 658

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
25 Jun 2009, 8:35 AM
#1
eudaemon1 avatar

eudaemon1

New Zenner

Join Date:
Jun 2009
Posts:
3
Plugin Contributions:
0

Hidden Categories dependent on users Help!!

Hi guys I was hoping someone maybe able to help me to find a section of code within Zen cart.
I have found includes\index_filters\default_filter.php (line 75 -85)
that controls what products can be displayed and disabled by manipulating the sql scripting and tbl structure.

But I am unable to change or manipulate the categories in the main page or sub folders. Any directions of the file I need to access, probably an sql query with categories_status within it.

~Any help much appreciated

Pat

Version 1.3.8 of Zen cart

25 Jun 2009, 11:31 AM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Hidden Categories dependent on users Help!!

You don't say what you are trying to do, but from your title, I would suggest installing the hideCategories mod from Free Addons.

25 Jun 2009, 1:32 PM
#3
eudaemon1 avatar

eudaemon1

New Zenner

Join Date:
Jun 2009
Posts:
3
Plugin Contributions:
0

Re: Hidden Categories dependent on users Help!!

Sorry My bad, What Im trying to do, is to modify the scripting so that certain users can view certain categories.

Which can be easily accomplished by product but not for category.

So within Customer I have inserted another field and created another table (join table)
that CatID, and viewcode so that a category can be viewed by any user with sufficient privileges.

I think I need to be in category_row.php line 30 onwards

while (!$categories->EOF) {
ifCOLOR="Red"{ echo "sandwich time"; }[/COLOR]
if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = 'pixel_trans.gif';
$cPath_new = zen_get_path($categories->fields['categories_id']);

// strip out 0_ from top level cats
$cPath_new = str_replace('=0_', '=', $cPath_new);

So I know if a condition is met it will echo

25 Jun 2009, 2:19 PM
#4
eudaemon1 avatar

eudaemon1

New Zenner

Join Date:
Jun 2009
Posts:
3
Plugin Contributions:
0

Re: Hidden Categories dependent on users Help!!

OK this sort of works now

<?php /** * index category_row.php * * Prepares the content for displaying a category's sub-category listing in grid format. * Once the data is prepared, it calls the standard tpl_list_box_content template for display. * * @package page * @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: category_row.php 4084 2006-08-06 23:59:36Z drbyte $ */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } $title = ''; $num_categories = $categories->RecordCount(); $row = 0; $col = 0; $list_box_contents = ''; if ($num_categories > 0) { if ($num_categories < MAX_DISPLAY_CATEGORIES_PER_ROW || MAX_DISPLAY_CATEGORIES_PER_ROW == 0) { $col_width = floor(100/$num_categories); } else { $col_width = floor(100/MAX_DISPLAY_CATEGORIES_PER_ROW); } while (!$categories->EOF) { if($categories->fields['categories_id']==190){ if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = 'pixel_trans.gif'; $cPath_new = zen_get_path($categories->fields['categories_id']); // strip out 0_ from top level cats $cPath_new = str_replace('=0_', '=', $cPath_new); // $categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']); $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>'); $col ++; if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) { $col = 0; $row ++; } } $categories->MoveNext(); } } ?>

Wish I knew what this do cause without it cant see sub cats afterwards. Also can put the "}" after it cause whole system starts freezing