I have made a duplicate link of a product into another sub category and there is only one product and it shows 0 products in that sub category.
I have made a duplicate link of a product into another sub category and there is only one product and it shows 0 products in that sub category.
Where does it show 0 products?
Does the Product show in the original Category?
If you look at the products_id in your Zen Cart Admin, is that the same products_id that you have in the other Category?
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Hi Linda,
Yes, the original product is shown in the original sub category here: Bed, Bath & Body>Bath Decor>
http://www.morrisgiftshop.com/index....roducts_id=739
Then I made a duplicate link copy of the produt here: Furniture & Decor>Cabinets>
Here is the link of the Sub Category for Furniture & Decor
http://www.morrisgiftshop.com/index....ndex&cPath=138
There it shows 0 but there is that item that was duplicated from another sub category.
You have customized your code to show the number of Products, from what I can see ...
Where did you customize the code and what does it read to obtain the Product Count for the Categories?
I am thinking that perhaps you have a boo boo as clicking on the Category does work ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Ok,,, here is my Category and Sub Category file
includes/modules/category_row.php
Code:<?php /** * index category_row.php * * Prepares the content for displaying a category's sub-category listing in grid format. * Once the data is prepared, it calls the standard tpl_list_box_content template for display. * * @package page * @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: category_row.php 4084 2006-08-06 23:59:36Z drbyte $ */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } $title = ''; $num_categories = $categories->RecordCount(); $row = 0; $col = 0; $list_box_contents = ''; if ($num_categories > 0) { if ($num_categories < MAX_DISPLAY_CATEGORIES_PER_ROW || MAX_DISPLAY_CATEGORIES_PER_ROW == 0) { $col_width = floor(100/$num_categories); } else { $col_width = floor(100/MAX_DISPLAY_CATEGORIES_PER_ROW); } while (!$categories->EOF) { if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = 'pixel_trans.gif'; $cPath_new = zen_get_path($categories->fields['categories_id']); // strip out 0_ from top level cats $cPath_new = str_replace('=0_', '=', $cPath_new); // explode the path to extract number of levels in category tree $fullCatID= explode("_",$cPath_new); // take the final level because it is the category whose contents are being displayed at current time $myCatID = $fullCatID[sizeof($fullCatID)-1]; // fixer for when category is empty and not filled with subcategories // check to see if myCatID is a parent category $parentCheckQuery = "select parent_id from " . TABLE_CATEGORIES . " where parent_id = '".$myCatID."'"; $check_parent = $db->Execute($parentCheckQuery); if ($check_parent->RecordCount() > 0) { // it is a parent, so do not show total here $countContent = ''; } else { // $categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']); $catQuery = "select products_id from " . TABLE_PRODUCTS . " where master_categories_id = '".$myCatID."'"; $check_categories = $db->Execute($catQuery); if ($check_categories->RecordCount() > 0) { // create number of items in category here $recordCount = $check_categories->RecordCount(); $countContent = CATEGORIES_COUNT_PREFIX . $recordCount . CATEGORIES_COUNT_SUFFIX; } else {$countContent = CATEGORIES_COUNT_PREFIX . '0' . CATEGORIES_COUNT_SUFFIX;} } // end else of parent check $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'].' '.$countContent.'</a>'); $col ++; if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) { $col = 0; $row ++; } $categories->MoveNext(); } } ?>
What happens if instead of all that code to figure out the count you use:
Does $countContent now hold the right value?Code:$countContent = zen_count_products_in_category($categories->fields['categories_id']);
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
I don't understand what you are getting at, Linda. Is that an extra line to put in with the code?
Lind,
are you saying to chage this line:
toCode:$categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']);
Code:$countContent = zen_count_products_in_category($categories->fields['categories_id']);
I used this code as the only change to that file:
NOTE: You can fool with parens and stuff to make it pretty ...Code:$countContent = zen_count_products_in_category($categories->fields['categories_id']); $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . ' ' . $countContent . '</a>');
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
I like it but, I rather have this (#).
Bookmarks