nicolasmezac Posted April 8, 2012 Share Posted April 8, 2012 Well I -once- had done this previously... but I forgot how to do this! I remember that in index.php, i had to change a code, i think it was at the red text... Could you help me? <?phperror_reporting(0); /* $Id: index.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // the following cPath references come from application_top.php $category_depth = 'top'; if (isset($cPath) && tep_not_null($cPath)) { $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $cateqories_products = tep_db_fetch_array($categories_products_query); if ($cateqories_products['total'] > 0) { $category_depth = 'products'; // display products } else { $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'"); $category_parent = tep_db_fetch_array($category_parent_query); if ($category_parent['total'] > 0) { $category_depth = 'nested'; // navigate through the categories } else { $category_depth = 'products'; // category has no products, but display the 'no products' message } } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <?php require(DIR_WS_INCLUDES . 'header_includes.php'); ?> Link to comment Share on other sites More sharing options...
nicolasmezac Posted April 8, 2012 Author Share Posted April 8, 2012 up, help me please! Link to comment Share on other sites More sharing options...
Switch Posted April 12, 2012 Share Posted April 12, 2012 You will get stuck in a loop. Assuming you want to just redirect index.php when no cPath is set you could try something like below . $myPath would be the category_id you want to redirect to. //below application_top.php if (!isset($cPath) || !tep_not_null($cPath)) { $myPath = '5'; // Category id to go tep_redirect(tep_href_link(FILENAME_DEFAULT,'cPath='.$myPath)); } Backup .. untested.. Link to comment Share on other sites More sharing options...
nicolasmezac Posted April 12, 2012 Author Share Posted April 12, 2012 it results! thanks a lot Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.