|
|||||||
| Setting Up Categories and Products Discussion about setting up your products and categorizing them. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Zenner
Join Date: Apr 2008
Posts: 22
|
V1.3.8
I want to display a very simple category page that shows only the titles of the products in that category. I'll need the associated link to the product as well. [I know the product display template calls the tabular display template] Does Zen Cart possess a function that allows me return an array for all products in a category? |
|
|
|
|
|
#2 |
|
New Zenner
Join Date: Apr 2008
Posts: 22
|
I've got this solved.
|
|
|
|
|
|
#3 |
|
New Zenner
Join Date: Nov 2009
Location: i will tell u later
Posts: 6
|
congratulations to you
__________________
No pain, No game |
|
|
|
|
|
#4 |
|
New Zenner
Join Date: Nov 2009
Posts: 1
|
It would be nice to know how you fixed it
|
|
|
|
|
|
#5 |
|
New Zenner
Join Date: Apr 2008
Posts: 22
|
Sure.
here's the code from my common/tpl_modules_product_listing.php <?php /** * Module Template * * @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_modules_product_listing.php 3241 2006-03-22 04:27:27Z ajeh $ */ include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCT_LISTING)); ?> <?php // if ($show_top_submit_button == true or $show_bottom_submit_button == true or (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0)) { if ($show_top_submit_button == true or $show_bottom_submit_button == true) { ?> </form> <?php } /*** custom product listing code ***/ if($cPath){ //explodes cPath if in format eg. 6_12 -- also parses single cat numbers eg. 6 $pieces = explode("_", $cPath); //$product_cat is rightmost cat $product_cat=$pieces[count($pieces)-1]; $content = ''; $content .= '<div id="categoryProductsList-' . $product_cat . '" class="categoryProductsList">'; $product_query = " SELECT a.products_id, b.products_id, b.products_name FROM " . TABLE_PRODUCTS . " a, " . TABLE_PRODUCTS_DESCRIPTION . " b WHERE a.products_id = b.products_id && a.master_categories_id = $product_cat ORDER BY b.products_name"; $product_result = $db->Execute($product_query); ?> <?php $content .= "<ul>"; while (!$product_result->EOF) { $content .= '<li><a href="' . zen_href_link(zen_get_info_page($product_result->fields['products_id']), ($product_cat > 0 ? 'cPath=' . $product_cat . '&' : '') . 'products_id=' . $product_result->fields['products_id']) . '">' . $product_result->fields['products_name'] . '</a></li>'; $product_result->MoveNext(); }; $content .= "</ul>"; ?> <?php $content .= '</div>'; echo $content; }//end if cPath ?> |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to place the home category links above products? | JHouse | Page Layout Changes | 0 | 1st July 2009 09:09 AM |
| Category/Products links on left and top of page ? | RandyNiles | Page Layout Changes | 1 | 28th February 2009 11:25 PM |
| Remove Category Links for All Products | websightdesign | General Questions | 2 | 30th June 2008 01:16 PM |
| Removing category image links and text links from the HOME page | EddieMac | Basic Configuration | 2 | 24th April 2008 03:53 PM |
| How to Add Category Links and remove New Products... | BrianL | Page Layout Changes | 1 | 11th February 2008 12:05 PM |