Thread: Category Mixup

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Jul 2009
    Posts
    26
    Plugin Contributions
    0

    Default Category Mixup

    Please help...

    I am using Zen Cart 1.3.8a

    my site is under development at: http://centaurhorseshop.co.za/shop/

    Occasionally, if you navigate to saddles ( a category) and then click on a subcategory, the breadcrumb at the top indicates that the subcategory is a subcategory of Veterinary, another category.

    I have tried moving the products around, and it seems to be related to the one category, Saddles. The products are not linked to other categories.

    It does not seem to happen with other another test product that I have put under Clothing > Gloves

    Any ideas would be helpful!

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Category Mixup

    It also highlights the Veterinary category in the sidebox. What happens if you delete the Vet category, check the navigation, then re-create it?

  3. #3
    Join Date
    Jul 2009
    Posts
    26
    Plugin Contributions
    0

    Default Re: Category Mixup

    AARRGH! now it highlights training aids... very wierd. am going to delete saddles rather...

  4. #4
    Join Date
    Jul 2009
    Posts
    26
    Plugin Contributions
    0

    Default Re: Category Mixup

    Hmmm

    Just moved the products in saddles, and now the category they are in is becoming mixed up. so I think it is the products... will delete products, and try again..
    ho hum...

  5. #5
    Join Date
    Jul 2009
    Posts
    26
    Plugin Contributions
    0

    red flag Re: Category Mixup

    or perhaps not - it appears that clothing > gloves now also has this problem. Very wierd, because it is intermittent...

  6. #6
    Join Date
    Jul 2009
    Posts
    26
    Plugin Contributions
    0

    Default Re: Category Mixup

    OK

    If I do this:
    admin > config > product info > Previous Next - Navigation Includes Category Position > set to "0" off

    the breadcrumbs are correct. Very confused.

  7. #7
    Join Date
    Jul 2009
    Posts
    26
    Plugin Contributions
    0

    bug Re: Category Mixup

    The problem seems to be when you click on a subcategory from a category page (where the subcategory is listed, sometimes with a thumbnail). How can possibly fix this as I would like this page to work. Other wise I must remove the link to it.

    Can someone please help?

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

    Default Re: Category Mixup

    What version of Zen Cart?

    Clean or Fresh Install?

    What Add-Ons?

    Do you Manually add Products and Categories or do you Import?

    categories_id 60 is somehow not behaving correctly on your site ...

    Either you have bad code or bad data ...

    The question is, which one is causing this?

    In your database table:
    categories

    how many categories_id have the parent_id of 60 ...
    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!]
    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!

  9. #9
    Join Date
    Jul 2009
    Posts
    26
    Plugin Contributions
    0

    Default Re: Category Mixup

    Thank you so much for looking at this.

    What version of Zen Cart?:

    Zen Cart 1.3.8a
    Database Patch Level: 1.3.8
    v1.3.8 [2009-07-02 14:34:11] (Fresh Installation)
    v1.3.8 [2009-07-02 14:34:11] (Fresh Installation)

    Clean or Fresh Install?
    Developed locally and then uploaded according to instructions, using fix_cache_key. But now I see the problem exists on the local version as well. I deleted all the categories on the local version, and put new ones in, but it does the same thing, if you navigate from the top level of the ctegory page ( the one with thumbnails and text links of the subcategories)

    What Add-Ons?

    Manufacturers box modifaction to display manufacturers as list and not drop downs (but I can't think that would affect the categories). I also used the following solution
    Code:
    <?php
    /**
     * Side Box Template
     *
     * @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_categories.php 4162 2006-08-17 03:55:02Z ajeh $
     */
      $content = "";
    
      $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
      for ($i=0;$i<sizeof($box_categories_array);$i++)
      {  
    	$cPath_array = explode('_', $box_categories_array[$i]['path']);
    	$level = count($cPath_array);
    	  
        switch(true)
    	{
    // to make a specific category stand out define a new class in the stylesheet example: A.category-holiday
    // uncomment the select below and set the cPath=3 to the cPath= your_categories_id
    // many variations of this can be done
    //      case ($box_categories_array[$i]['path'] == 'cPath=3'):
    //        $new_style = 'category-holiday level'.$level;
    //        break;
          case ($box_categories_array[$i]['top'] == 'true'):
            $new_style = 'category-top level'.$level;
            break;
          case ($box_categories_array[$i]['has_sub_cat']):
            $new_style = 'category-subs level'.$level;
            break;
          default:
            $new_style = 'category-products level'.$level;
          }
    	  
    	  
    	if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1))
    	{
    		// skip if this is for the document box (==3)
    	}
    	  else
    	  {
          $content .= '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
    
          if ($box_categories_array[$i]['current']) {
            if ($box_categories_array[$i]['has_sub_cat']) {
              $content .= '<span class="category-subs-parent level'.$level.'">' . $box_categories_array[$i]['name'] . '</span>';
            } else {
              $content .= '<span class="category-subs-selected level'.$level.'">' . $box_categories_array[$i]['name'] . '</span>';
            }
          } else {
            $content .= $box_categories_array[$i]['name'];
          }
    
          if ($box_categories_array[$i]['has_sub_cat']) {
            $content .= CATEGORIES_SEPARATOR;
          }
          $content .= '</a>';
    
          if (SHOW_COUNTS == 'true') {
            if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
              $content .= CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX;
            }
          }
    
          $content .= '' . "\n";
        }
      }
    
      if (SHOW_CATEGORIES_BOX_SPECIALS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true' or SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
    // display a separator between categories and links
        if (SHOW_CATEGORIES_SEPARATOR_LINK == '1') {
          $content .= '<hr id="catBoxDivider" />' . "\n";
        }
        if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
          $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
          if ($show_this->RecordCount() > 0) {
            $content .= '<a class="category-links level'.$level.'" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . CATEGORIES_BOX_HEADING_SPECIALS . '</a>' . '' . "\n";
          }
        }
        if (SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true') {
          // display limits
    //      $display_limit = zen_get_products_new_timelimit();
          $display_limit = zen_get_new_date_range();
    
          $show_this = $db->Execute("select p.products_id
                                     from " . TABLE_PRODUCTS . " p
                                     where p.products_status = 1 " . $display_limit . " limit 1");
          if ($show_this->RecordCount() > 0) {
            $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_NEW) . '">' . CATEGORIES_BOX_HEADING_WHATS_NEW . '</a>' . '' . "\n";
          }
        }
        if (SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true') {
          $show_this = $db->Execute("select products_id from " . TABLE_FEATURED . " where status= 1 limit 1");
          if ($show_this->RecordCount() > 0) {
            $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS . '</a>' . '' . "\n";
          }
        }
        if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
          $content .= '<a class="category-links level'.$level.'" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
        }
      }
      $content .= '</div>';
    ?>
    in tpl_categories.php file to indent the subcategories. I found this here: http://www.zen-cart.com/forum/showthread.php?p=765438, and am beginning to wonder if that may be a problem.

    Do you Manually add Products and Categories or do you Import?
    I manually added the products on the local installation, and then imported into the www version. But the problem is also on the local version.

    categories_id 60 is somehow not behaving correctly on your site ...
    I added another one that will go below it, (Veterinary, or categories_id 62) and now category 60 is behaving properly, and 62 is not.

    how many categories_id have the parent_id of 60 ...
    none, it looks like to me (or 62) but I am not sure if I am checking correctly. But, if I go to phpMyAdmin, I see the following warning:

    The following indexes appear to be equal and one of them should be removed: PRIMARY, categories_id

    I am sooooooooooo confused!

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

    Default Re: Category Mixup

    For the indexes on the products_to_categories table you should have 2 of them ...

    You can rebuild them by deleting the ones that are there and then running these SQL commands:

    ALTER TABLE `products_to_categories` ADD PRIMARY KEY ( `products_id` , `categories_id` );

    ALTER TABLE `products_to_categories`
    ADD INDEX `idx_cat_prod_id_zen` ( `categories_id` , `products_id` );
    Have you applied the Known Bug Fixes for v1.3.8 ...
    http://www.zen-cart.com/forum/showth...860#post610860
    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!]
    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!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 SHOW_ALL_BUTTON mixup
    By mrcastle in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 1 Nov 2015, 10:15 PM
  2. Replies: 7
    Last Post: 24 Nov 2012, 06:33 AM
  3. Remove category, sub category, big links silly stock images....
    By joyjoy in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Sep 2010, 10:31 AM
  4. Customer Order Info Mixup
    By paulssports in forum Managing Customers and Orders
    Replies: 3
    Last Post: 26 Jul 2007, 10:22 PM

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