Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2009
    Posts
    3
    Plugin Contributions
    0

    Default 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

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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.

  3. #3
    Join Date
    Jun 2009
    Posts
    3
    Plugin Contributions
    0

    Default 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) {
    if($categories->fields['categories_id']==190){ echo "sandwich time"; }
    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

  4. #4
    Join Date
    Jun 2009
    Posts
    3
    Plugin Contributions
    0

    Default 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

 

 

Similar Threads

  1. Hidden of some categories
    By wufoxuan in forum Customization from the Admin
    Replies: 1
    Last Post: 14 Apr 2011, 04:45 PM
  2. Easy Populate hidden categories
    By christytx27 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 4 Nov 2009, 01:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg