Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,504
    Plugin Contributions
    0

    Default Made Duplicate Link Copy of Product to another sub category shows 0 couts.

    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.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Made Duplicate Link Copy of Product to another sub category shows 0 couts.

    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!

  3. #3
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,504
    Plugin Contributions
    0

    Default Re: Made Duplicate Link Copy of Product to another sub category shows 0 couts.

    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.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Made Duplicate Link Copy of Product to another sub category shows 0 couts.

    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!

  5. #5
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,504
    Plugin Contributions
    0

    Default Re: Made Duplicate Link Copy of Product to another sub category shows 0 couts.

    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();
    }
    }
    ?>

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Made Duplicate Link Copy of Product to another sub category shows 0 couts.

    What happens if instead of all that code to figure out the count you use:

    Code:
    $countContent = zen_count_products_in_category($categories->fields['categories_id']);
    Does $countContent now hold the right value?
    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!

  7. #7
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,504
    Plugin Contributions
    0

    Default Re: Made Duplicate Link Copy of Product to another sub category shows 0 couts.

    I don't understand what you are getting at, Linda. Is that an extra line to put in with the code?

  8. #8
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,504
    Plugin Contributions
    0

    Default Re: Made Duplicate Link Copy of Product to another sub category shows 0 couts.

    Lind,

    are you saying to chage this line:

    Code:
    $categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']);
    to

    Code:
    $countContent = zen_count_products_in_category($categories->fields['categories_id']);

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Made Duplicate Link Copy of Product to another sub category shows 0 couts.

    I used this code as the only change to that file:
    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>');
    NOTE: You can fool with parens and stuff to make it pretty ...
    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!

  10. #10
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,504
    Plugin Contributions
    0

    Default Re: Made Duplicate Link Copy of Product to another sub category shows 0 couts.

    I like it but, I rather have this (#).

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 category, or sub-category product-list link in product page
    By keneso in forum General Questions
    Replies: 2
    Last Post: 5 Nov 2013, 08:25 PM
  2. copy linked-product multiple category info to another product
    By torvista in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 10 Nov 2010, 06:31 PM
  3. Replies: 3
    Last Post: 1 Sep 2010, 12:45 AM
  4. Selecting more than one product to copy/link to new category
    By jessafresca in forum Upgrading from 1.3.x to 1.3.9
    Replies: 1
    Last Post: 23 Mar 2010, 05:45 AM
  5. sub category link on product page going to homepage...
    By keylesslocks in forum Basic Configuration
    Replies: 6
    Last Post: 4 Feb 2010, 08:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR