Ok, here's how to get around the cPath=0 problem.. View all the top level category on a define_page_2
When this doesn't work in SSU
http://www.website.com/index.php?mai...=index&cPath=0
You can use this instead..
It won't look super pretty, but maybe it's easy to change..
http://www.website.com/page_2
Basically all we're doing is displaying the top level categories on another page.
Documentation:
1.) Below is the file(tpl_topcategories_default.php) that needs to be put in 'includes/templates/template_default(or your custom template directory)/templates/' folder
2.) A blank folder needs to be created & named: "topcategories" in "includes/modules/pages/"
3. Make this file, code is below '/includes/templates/classic/templates/tpl_page_2_default.php'
create: tpl_topcategories_default.php
PHP Code:
<?php
/**
* Page Template
*
* Loaded by main_page=index<br />
* Displays category/sub-category listing<br />
* Uses tpl_index_category_row.php to render individual items
*
* @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_index_categories.php 4678 2006-10-05 21:02:50Z ajeh $
*/
?>
<div class="centerColumn" id="indexCategories">
<h1 id="indexCategoriesHeading">Top Categories</h1>
<?php
$cat_id=0;
$categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id
FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
WHERE c.parent_id = :parentID
AND c.categories_id = cd.categories_id
AND cd.language_id = :languagesID
AND c.categories_status= '1'
ORDER BY sort_order, cd.categories_name";
$categories_query = $db->bindVars($categories_query, ':parentID', $cat_id, 'integer');
$categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer');
$categories = $db->Execute($categories_query);
$number_of_categories = $categories->RecordCount();
require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php');
?>
</div>
create: tpl_page_2_default.php
PHP Code:
<?php
/**
* tpl_page_2_default.php
*
* @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: tpl_page_2_default.php 3464 2006-04-19 00:07:26Z ajeh $
*/
?>
<div class="centerColumn" id="indexCategories">
<h1 id="indexCategoriesHeading">Top Categories</h1>
<?php
$cat_id=0;
$categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id
FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
WHERE c.parent_id = :parentID
AND c.categories_id = cd.categories_id
AND cd.language_id = :languagesID
AND c.categories_status= '1'
ORDER BY sort_order, cd.categories_name";
$categories_query = $db->bindVars($categories_query, ':parentID', $cat_id, 'integer');
$categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer');
$categories = $db->Execute($categories_query);
$number_of_categories = $categories->RecordCount();
require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php');
?>
</div>
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
</div>
Bookmarks