I am modifying a store to only be available to employees at a company. The purpose is for the employee to be able to order company work clothes only available to them, not to the public. I need to be able to suppress side boxes, unless the employee is logged in as a customer. I have found this tutorial: https://www.zen-cart.com/tutorials/i...hp?article=279 which states:
1. Locate the module for the sidebox (or boxes) that you want to treat like this. You'll find them in includes/modules/sideboxes.
2. Create over-ride files for them by copying them to includes/modules/sideboxes/YOUR_TEMPLATE_NAME.
3. Open the over-ride file and find a couple of lines that look similar to:
These were taken from the featured_products products sidebox and the variable name for your box will probably differ slightly. Then change them to:Code:// test if box should display $show_featured= true;
I am trying to modify the catagories sidebox but I cant find any thing similar to step 3 in categories.php.Code:// test if box should display if (!$_SESSION['customer_id']) { $show_featured= false; } else { $show_featured= true; }
I am using zen-cart-v1.3.9
Here is the code for sideboxes/custom/categories.php:
I tried adding this to the top, but with no success:Code:<?php /** * categories sidebox - prepares content for the main categories sidebox * * @package templateSystem * @copyright Copyright 2003-2005 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: categories.php 2718 2005-12-28 06:42:39Z drbyte $ */ $main_category_tree = new category_tree; $row = 0; $box_categories_array = array(); // don't build a tree when no categories $check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status=1 limit 1"); if ($check_categories->RecordCount() > 0) { $box_categories_array = $main_category_tree->zen_category_tree(); } require($template->get_template_dir('tpl_categories.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_categories.php'); $title = BOX_HEADING_CATEGORIES; $title_link = false; require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default); ?>
Thanks for your time.Code:if (!$_SESSION['customer_id']) { $show_categories_array= false; } else { $show_categories_array= true; }


Reply With Quote
