Forums / Setting Up Categories, Products, Attributes / Categories and Products on Same Level

Categories and Products on Same Level

Started by chadderuski on 4 Nov 2011, 10:04 PM · Views: 4,091

Results 1 to 20 of 36
4 Nov 2011, 10:04 PM
#1
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Categories and Products on Same Level

Hi All!

I have a situation I'm trying to fix where the client has managed to mix products and categories on the same level.

He has some 800,000 products spread over 800+ categories. I was wondering if anyone has come across this, and if there is an easier way to fix this over than stepping through every category level by hand.

Trying to click through the categories by hand is onerously slow. Something is definately messed up, however, because attempting to run "Reset Master Categories" ends up throwing an Inter Server Error 500!

Hope someone can offer some advice on fixing this!

Thanks!

4 Nov 2011, 11:02 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Categories and Products on Same Level

Somewhere over the last 30-60 days, I wrote a program to do the updates in stages for the master_categories_id reset ...

I forget what post I stuck that code in, but I recall it did work for the person with a problem of too many Categories and Products to run the standard one off the Store Manager ...

I will try to hunt the puppy down ... but meanwhile, you might try searching around for it and let us know if you find it ... :unsure:

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!

4 Nov 2011, 11:06 PM
#3
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Re: Categories and Products on Same Level

Ajeh:

Somewhere over the last 30-60 days, I wrote a program to do the updates in stages for the master_categories_id reset ...

I forget what post I stuck that code in, but I recall it did work for the person with a problem of too many Categories and Products to run the standard one off the Store Manager ...

I will try to hunt the puppy down ... but meanwhile, you might try searching around for it and let us know if you find it ... :unsure:

Ajeh, that would be awesome.

Check this out... I've been hand walking through the categories and I discovered this when I was going to move a product out of a mixed situation:

Move Product
Please select which category you wish 012441-000 to reside in

Current Categories:
Circular - Cable Clamps > Connectors >&nb

"Connectors" is the top category. I have no idea what the "&nb" is.... it's almost like   ...

Have you ever seen anything like that?

5 Nov 2011, 12:58 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Categories and Products on Same Level

Well ... thought I wrote this ... I wrote one to do the Update on the Price Sorter in increments ...

I thought I had also included one to update the master_categories_id in increments but that is not part of it ... :blush:

I will have to think about this for awhile and see how hard it is to adapt the code to update the master_categories_id in increments ...

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!

5 Nov 2011, 1:00 AM
#5
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Re: Categories and Products on Same Level

Hiya,

Thanks for the follow up. I had actually tried to find this to no avail. Glad to know I'm not nuts! (not completely, at least!).

5 Nov 2011, 2:51 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Categories and Products on Same Level

Could you run in phpMyAdmin and see how many Products are not in the products_to_categories table:

SELECT * FROM products WHERE products.products_id NOT IN (SELECT products_to_categories.products_id FROM products_to_categories);

Do you use Linked Products?

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!

5 Nov 2011, 7:54 PM
#7
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Re: Categories and Products on Same Level

Hi Ajeh,

I don't have phpMyAdmin access right now, but I do have ftp. So I did a quick script to run your query. It only resulted in 2 rows.

Yes, they have linked products. They are doing something odd in that they have the full inventory (800,000 products) under an /inventory category. Then they break all the products out under their sorted categories under TOP... This results in every product getting linked.

Also, did you notice in the above post what I noted about the "&nb" showing like it's the top category. I've never seen that before.

I've been searching through the store for more places where they mixed products and categories, but it's a real brain drain!

-chadd

5 Nov 2011, 10:33 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Categories and Products on Same Level

If you only have 2 rows in the products_to_categories table then the Products have no idea what categories they are suppose to be in ...

More or less this means you have such bad data, it is very difficult to even begin to fix this data ...

It is hard to determine the problems with your Categories and Products because so much data is missing ...

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!

5 Nov 2011, 11:32 PM
#9
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Re: Categories and Products on Same Level

Ajeh,

The query you gave me are products NOT IN product_to_categories, or am I reading the query you gave me incorrectly?

5 Nov 2011, 11:40 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: Categories and Products on Same Level

That is correct ... and I am having a senior moment ... :blink:

Hopefully, thhis means it comes down to fixing the master_categories_id ...

Try setting in Configuration ... My Store ... setting the:
Admin Set max_execution_time for processes

to 900 and see if you can then run the Update Master Categories on the Tools ... Store Manager ...

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!

5 Nov 2011, 11:41 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Categories and Products on Same Level

NOTE: with using Linked Products, this is only going to fix some of your Products as it will pick the lowest value categories_id for the master_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!]
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 Nov 2011, 11:45 PM
#12
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Re: Categories and Products on Same Level

should I delete the two products that your query gave me? I know their id numbers from the query....

funny! I didn't even know that there are was a setting for execution time inside the admin! and i've been zencarting for years now... :p

5 Nov 2011, 11:56 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Categories and Products on Same Level

Don't delete anything yet ...

See if increasing the time helps ...

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!

6 Nov 2011, 12:12 AM
#14
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Re: Categories and Products on Same Level

Okay, I was able to complete the "Reset ALL Products Master Categories ID", but when I tried to run the "Update All Products' Attribute Sort Orders" I got an Internal 500 Server Error.

Any ideas?

6 Nov 2011, 12:13 AM
#15
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Re: Categories and Products on Same Level

BTW, is there a query that will give me any product that is also mixed on category level ??

6 Nov 2011, 12:16 AM
#16
ajeh avatar

ajeh

Oba-san

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

Re: Categories and Products on Same Level

Most like the same issue ... it is a timing issue based on how many you have ...

Edit the file:
/your_admin_dir/store_manager.php

and find this line:

  zen_set_time_limit(600);

Change that to read 1200 instead of 600 ... does it make a difference?

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!

6 Nov 2011, 12:22 AM
#17
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Re: Categories and Products on Same Level

Running now... with new zen_set_time_limit()

6 Nov 2011, 12:28 AM
#18
ajeh avatar

ajeh

Oba-san

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

Re: Categories and Products on Same Level

Are you saying it is running or that it completed?

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!

6 Nov 2011, 12:32 AM
#19
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Re: Categories and Products on Same Level

No, STILL running... sure is taking a long time :P ... 10 min mark

6 Nov 2011, 12:38 AM
#20
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Re: Categories and Products on Same Level

Nope, didn't complete ... another 500 Internal Server error.

I had actually set time to 2000.... which is what we upped php's max_execution_time to...

????