Forums / General Questions / Admin side not displaying all categories of product

Admin side not displaying all categories of product

Locked

Views: 1,018

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
19 Oct 2010, 4:16 PM
#1
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Admin side not displaying all categories of product

Hello,

When I click on the 'C' button of a product to copy the product to other categories, I notice that the current categories the product are listed in are on the right side. However, I notice that if you have the product listed in a lot of categories and subcategories, that the list is not complete. The list seems to be cutoff at the end or something (maybe because string is too long). Is this intentional?

I want the full list of all the categories/sub categories that the product is listed in.

Thanks for the help.

19 Oct 2010, 4:28 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Admin side not displaying all categories of product

How many Categories do you have in the tables of your database for:
categories
categories_description

Peek in phpMyAdmin at your database to check ...

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!

19 Oct 2010, 4:49 PM
#3
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Admin side not displaying all categories of product

Hi Linda,

After looking into those tables, there are 774 records..so around that many categories. For the particular product I'm looking at it is listed in about 6 categories. Some being subcategories so making the string longer.

All USI Products > Mum > Silk Flower Type > White > View By Color > Flower Bushes > Cream > View By Color > Flower Bushes > View All Flower Bushes > Flower Bushes > 11in - 20in Bushes (I'm expecting a 'Flower Bushes' main category here).

But it doesn't show so I'm thinking its cutoff or something.

Thanks for the help.

19 Oct 2010, 4:57 PM
#4
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Admin side not displaying all categories of product

There are 774 records for each table.

19 Oct 2010, 5:02 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Admin side not displaying all categories of product

I am not quite following what is missing ...

Are you saying you should see Flower Bushes 4 times and only see it 3 times?

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!

19 Oct 2010, 6:25 PM
#6
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Admin side not displaying all categories of product

Hi Linda,

Sorry for not being clear.
This part was copied and pasted from Admin side of one product "All USI Products > Mum > Silk Flower Type > White > View By Color > Flower Bushes > Cream > View By Color > Flower Bushes > View All Flower Bushes > Flower Bushes > 11in - 20in Bushes".

Referring to the same product in multiple cats/subcats:

'Flower Bushes' is a main category. So lets look at one example. Flower Bushes > View All Flower Bushes, where View All Flower Bushes is a sub category under the main category Flower Bushes.

Another example is Flower Bushes > View By Color > Cream where cream is a subcategory in that tree and Flower Bushes is the same main category.

11in - 20in Bushes is also a subcategory of Flower Bushes. So I'm expecting a "> Flower Bushes" right after it.

Some times on other products when I view the ending text of the list of categories, it shows "Flowe" where the "r Bushes" is cut off.

Looking in the functions function zen_generate_category_path()
and zen_output_generated_category_path I can't figure out what to change to make the entire string of categories to display. Bare in mind I haven't changed any code and have noticed this issue.

Thanks for your help

22 Oct 2010, 4:19 PM
#7
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Admin side not displaying all categories of product

Hi Linda,

Get a chance to look at this? I tried but still haven't found out anything yet.

Thanks.

22 Oct 2010, 4:27 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Admin side not displaying all categories of product

What version of Zen Cart are you using?

Clean install or an Upgrade?

Do you manually work with your Categories/Products in the Admin or do you Import Products?

If you browse the products table in phpMyAdmin, do all of the records have master_categories_id set or are some set to 0?

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!

22 Oct 2010, 5:32 PM
#9
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Admin side not displaying all categories of product

version 1.3.8a

clean install but have added ez populate mod.

use ez populate to import

in product table the master_categories_id all have a master category id set to something. None of them are set to 0.

Thanks.

22 Oct 2010, 5:35 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Admin side not displaying all categories of product

I suspect you have some bad data in the tables that is resulting in the weird display ...

Do you actually have a Category tree that matches:
All USI Products > Mum > Silk Flower Type > White > View By Color > Flower Bushes > Cream > View By Color > Flower Bushes > View All Flower Bushes > Flower Bushes > 11in - 20in Bushes

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!

22 Oct 2010, 5:53 PM
#11
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Admin side not displaying all categories of product

Hi Linda,

The category tree has no problems. When I click on the 'C' button and look at the 'Categories' drop down, the tree lists all the cats/sub cats accordingly.

As far as matching, the string:

'All USI Products > Mum > Silk Flower Type > White > View By Color > Flower Bushes > Cream > View By Color > Flower Bushes > View All Flower Bushes > Flower Bushes > 11in - 20in Bushes '

is actually bunching a whole bunch of categories and sub categories into one single string. Why zen does this? I'm not sure. Not very user friendly. But that is beside the case.

Any thoughts?

Thanks.

Also: when I search the product through the website (not admin side) by clicking the categories they are listed in, everything comes out accordingly.

22 Oct 2010, 5:56 PM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Admin side not displaying all categories of product

I am trying to understand how you are getting to that display for the Categories ...

If you see this display:
All USI Products > Mum > Silk Flower Type > White > View By Color > Flower Bushes > Cream > View By Color > Flower Bushes > View All Flower Bushes > Flower Bushes > 11in - 20in Bushes

But cannot click on the first Category ... then the next and continue through to the end ... it sounds like bad data ...

Can you confirm that you have applied all of the Known Bug Fixes for v1.3.8 at:
http://www.zen-cart.com/forum/showthread.php?t=82619

and all of the Security patches and updates at:
http://www.zen-cart.com/forum/showthread.php?t=131115

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!

22 Oct 2010, 6:05 PM
#13
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Admin side not displaying all categories of product

I can't confirm that I've applied all of those fixes. Maybe the problem might be related to those fixes. I think it has something to do with the length of the category path tree string. All products with a shorter string doesn't have this issue. Any how I appreciate your help. I think we can put this problem to rest. Its not that big of a deal. If I find anything, I'll be sure to post.

22 Oct 2010, 6:09 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Admin side not displaying all categories of product

I would strongly update your site with both the Known Bug Fixes and Security Patches and Updates as there are a lot of problems with v1.3.8 ...

NOTE: v1.3.9 has these and more built in ...

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!

23 Oct 2010, 12:03 AM
#15
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Admin side not displaying all categories of product

Hi Linda,

I found a solution. So far testing it everything is looking good. I hope this helps anyone that would like to do the same thing.

The file you will need to modify is your_admin_folder/includes/functions/general.php

In that file you will find the functions that require editing so that the string displays properly and easy to read. Originally, the string of a product's category path will list the lower sub categories first and go up. Then if the product is located in several categories this make it even more confusing because what zen does, is bunch those individual categories into a single string. Thus you get something like this:

All USI Products > Mum > Silk Flower Type > White > View By Color > Flower Bushes > Cream > View By Color > Flower Bushes > View All Flower Bushes > Flower Bushes > 11in - 20in Bushes

Instead of something that is more easy to read like this:

All USI Products
** > Silk Flower Type > Mum
** > Flower Bushes > View By Color > White
** > Flower Bushes > View By Color > Cream
** > Flower Bushes > View All Flower Bushes
** > Flower Bushes > 11in - 20in Bushes
** > Flower Bushes > Mum

So what I did is edit some code so that the string formatting makes it easier to read. This easier format allows me to see what category/subcat one product is listed in with a complete tree path to the individual sub category. Also this will fix the problem where the complete tree path string was cut off.

So here goes my solution:
around line 1119, I added "<br>" to that line of code. ```
$categories_array[$index][] = array('id' => $categories->fields['categories_id'], 'text' => $category->fields['categories_name'] . '<br>
');

That will give me the spacing and formatting so that I see the top category.

then around line 1121, I comment out the code:

/$categories_array[$index] = array_reverse($categories_array[$index]);/

so that it doesn't display the categories backwards.

finally around line 1149, I change the -16 to -1 and added '&nbsp'

$calculated_category_path_string = substr($calculated_category_path_string, 0, -1) . ' ';

the -1 helps me fix the full string length being cutoff and the    helps fix some ending character issue.

This solution works thus far and I'm not sure if it breaks anything, so proceed at your own risks. The array reverse area should probably be done some where else but oh well.

Linda, do you know if the reverse array area that I comment out may affect somewhere important? Seems like I'm just reversing how the string is being returned. Thanks.