Zen Cart Logo
Forums / General Questions / Multiple category Display on Homepage

Multiple category Display on Homepage

Locked

Views: 1,892

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
18 Apr 2008, 4:59 PM
#1
abhishek77 avatar

abhishek77

New Zenner

Join Date:
Mar 2008
Posts:
26
Plugin Contributions:
0

Multiple category Display on Homepage

I am trying to figure out a way to display products from multiple categories on the homepage of my website.

Currently i have set up 2 categories but on homepage, it displays products from only 1 category. This i think is by default.

Thank-you!

18 Apr 2008, 5:14 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Multiple category Display on Homepage

There is not a way in the stock installation to do this, other than making all the products "featured" and showing them in the featured centerbox.

You might look at the "all categories & products on one page" mod in yellow1912's sig link.

19 Apr 2008, 9:24 AM
#3
abhishek77 avatar

abhishek77

New Zenner

Join Date:
Mar 2008
Posts:
26
Plugin Contributions:
0

Re: Multiple category Display on Homepage

I tired the all_products_on_main mod but still facing problems.
According to the test file i uploaded the following files to the specified folders.

all_cats_all_products.php uploaded to includes/modules/
tpl_modules_all_cats_all_products.php uploaded to includes/templates/template_default/templates/

In includes/filenames.php, i entered the line ```php
define('FILENAME_ALL_CATS_ALL_PRODUCTS', 'all_cats_all_products.php');


Last file to edit is tpl_index_default.php

Code is as below.

<?php /** * Page Template * * Main index page<br /> * Displays greetings, welcome text (define-page content), and various centerboxes depending on switch settings in Admin<br /> * Centerboxes are called as necessary * * @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_default.php 3464 2006-04-19 00:07:26Z ajeh $ */ ?> <div class="centerColumn" id="indexDefault"> <h1 id="indexDefaultHeading"><?php echo HEADING_TITLE; ?></h1> <?php if (SHOW_CUSTOMER_GREETING == 1) { ?> <h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2> <?php } ?> <!-- deprecated - to use uncomment this section <?php if (TEXT_MAIN) { ?> <div id="" class="content"><?php echo TEXT_MAIN; ?></div> <?php } ?>--> <!-- deprecated - to use uncomment this section <?php if (TEXT_INFORMATION) { ?> <div id="" class="content"><?php echo TEXT_INFORMATION; ?></div> <?php } ?>--> <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?> <?php /** * get the Define Main Page Text */ ?> <div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div> <?php } ?> <?php $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MAIN); while (!$show_display_category->EOF) { ?> <?php // We can set this in admin later panel later define('DISPLAY_ALL_CATS_PRODUCTS', 'true'); if(DISPLAY_ALL_CATS_PRODUCTS == "true"){ require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_ALL_CATS_ALL_PRODUCTS)); } // !EOF ?> <?php $show_display_category->MoveNext(); } // !EOF /** * display All products - all cats */ ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_FEATURED_PRODUCTS') { ?> <?php /** * display the Featured Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_SPECIALS_PRODUCTS') { ?> <?php /** * display the Special Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_NEW_PRODUCTS') { ?> <?php /** * display the New Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_UPCOMING') { ?> <?php /** * display the Upcoming Products Center Box */ ?> <?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?> <?php $show_display_category->MoveNext(); } // !EOF ?> </div> ```

Am i missing something?

13 Nov 2008, 6:58 AM
#4
milkyway avatar

milkyway

Inactive

Join Date:
Aug 2006
Location:
Singapore
Posts:
167
Plugin Contributions:
1

Re: Multiple category Display on Homepage

I checked yellow site but this mod no longer there, anyone has a copy of this? I really need this, thanks so much!