smask Posted July 1, 2006 Posted July 1, 2006 Hi! I was wondering if anyone knows if it's possible to separate the indexpage from the page to browse the products? I've realised that they are merged in index.php and they use the same html-table. I wish to have other objects in that table on the index page than on the page to browse products. Right now I have a imagebackground in the html-table on the indexsite, and I wish to have another image when browsing the products. Thanks for reading!
Guest Posted July 4, 2006 Posted July 4, 2006 a simple way to do this is by redirecting to a different browse page at the top of the index.php script based on the $categories_depth value // 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) { // Redirect here tep_redirect(tep_href_link(FILENAME_BROWSE_PAGE_WITH_PRODUCTS, $cPath) ); $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) { // Redirect here tep_redirect(tep_href_link(FILENAME_BROWSE_PAGE_WITH_CATEGORIES, $cPath) ); $category_depth = 'nested'; // navigate through the categories } else { // Redirect here tep_redirect(tep_href_link(FILENAME_BROWSE_PAGE_WITH_PRODUCTS, $cPath) ); $category_depth = 'products'; // category has no products, but display the 'no products' message } } } If you want to do more you could completely rewrite the index.php but this is a quick way around it. Then of course just create the other files to do the browsing. You could copy the code from the index.php and change the html the way you want.
smask Posted July 4, 2006 Author Posted July 4, 2006 If you want to do more you could completely rewrite the index.php but this is a quick way around it. Then of course just create the other files to do the browsing. You could copy the code from the index.php and change the html the way you want. Thank you very much!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.