Zen Cart Logo
Forums / Basic Configuration / Product Search in Admin

Product Search in Admin

Views: 6,686

Results 1 to 20 of 22
3 Jul 2009, 9:12 PM
#1
fortune81 avatar

fortune81

New Zenner

Join Date:
Jul 2009
Location:
SE US
Posts:
12
Plugin Contributions:
0

Product Search in Admin

Since this is my first post here I wanted to say up front how much I love ZC. I've been online since '96 and used a number of other pay carts since that time. ZC is comparable to the best of them, and in fact through add-ons has some features the others lack. I'm happy to have been Zenned!

Having said that, there is one area that is causing me quite a bit of grief.

Does anybody know how I would modify the Admin>Catalog>Categories/Products SEARCH so that I can locate a given product using products_model?

I have a large site I am working on - nearly 15,000 products and over 100 categories. Currently around 3,000 are in need of content editing.

This is one area where ZC does fall short in regard to other carts.

The current way (or only way I've been able to find) to edit a prod in ZC is to first go to the category, open it and then scroll through all the products until I find the one I need. With so many products, and so many categories that's nearly impossible.

Many products I haven't a clue as to what category they're in. So I look through category after category - sometimes 30 minutes - just to find a single product. IMO that's crazy!

You should be able to, as in other carts, simply enter the item no. into the search and access the prod immediately.

So, if someone can point me to either
a) a mod that will accomplish this
b) some way of doing it that I am overlooking, or
c) the template and accompanying php file for the admin categories page and I will make the mod myself.

Any/all help is greatly appreciated.

3 Jul 2009, 9:15 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Product Search in Admin

When I go to the category products top, enter 184 in the search block, and hit enter; I get all products that have 184 in the model number.
:unsure:
Some strange template?

3 Jul 2009, 9:18 PM
#3
jprough avatar

jprough

New Zenner

Join Date:
Feb 2009
Location:
Mogadore, Ohio
Posts:
31
Plugin Contributions:
0

Re: Product Search in Admin

There is a search box in admin>Categories/Products top right side. Entering your model number here should do the trick.

3 Jul 2009, 9:33 PM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Product Search in Admin

Confirmed. I too was puzzled at the request and can confirm that line 258 (in 1.3.8a) of the admin/includes/modules/category_product_listing.php module explicitly includes product model in the search criteria.

3 Jul 2009, 11:07 PM
#5
fortune81 avatar

fortune81

New Zenner

Join Date:
Jul 2009
Location:
SE US
Posts:
12
Plugin Contributions:
0

Re: Product Search in Admin

Wow - you guys are quick!
So quick that I didn't make it back here in time.

After I posted I gave it some more thought and decided to install a fresh test version of zc on another server, and yes, the search facility does work just fine there. I can easily find any of the test products by searching for the prodcode.

It's my problem. Something, somewhere in my version has gotten fowled. Unfortunately, it's got a template (trublu) and around 10 mods already installed.

I'm going to go with my fresh test install, and install each of the above until the search stops working so I can try to nail down the problem.

Thanks for the help!

4 Jul 2009, 12:30 AM
#6
fortune81 avatar

fortune81

New Zenner

Join Date:
Jul 2009
Location:
SE US
Posts:
12
Plugin Contributions:
0

Re: Product Search in Admin

Nothing is ever easy. It looks like the problem is originating in my data.

How I know is I took the test store, where the admin search is working, and swapped the db with my store db. As soon as I did the search stopped working. The rest of the site works fine - just no admin search.

What's odd is that the customer search area works fine, just not the admin.

I saw in another thread in these forums that the problem could be caused by a missing master cat id, however all my prods have master cat ids.

I've also checked the products_to_categories table and everything looks fine.

I can trace a product from the products table through the products_to_categories table and back to the categories table and all ids are in sync.

Is there someone here who can shed some light as to what the admin search does that is different from the customer front-end search so I'll know where to start looking?

Thanks!

4 Jul 2009, 3:19 AM
#7
fortune81 avatar

fortune81

New Zenner

Join Date:
Jul 2009
Location:
SE US
Posts:
12
Plugin Contributions:
0

Re: Product Search in Admin

As much as I hate to reply to my own post...

I've spent about 6 hours working on this problem. I finally have to 'source' narrowed down, but I don't know why it's doing what it's doing.

There are a lot of categories, with the final category being name 'uncategorized' where things go that I will manually categorize at a later time. Any item keyed to this category the search will find.

All other items in all other categories - nothing.

So I have checked, double checked, 10 times checked the associated tables for products, categories and those that link the two.
Every thing looks perfectly correct. I can't find a single problem.

I've even Optimized and Repaired the corresponding tables - thinking an index was corrupted - nothing.

Any ideas?

4 Jul 2009, 5:42 AM
#8
fortune81 avatar

fortune81

New Zenner

Join Date:
Jul 2009
Location:
SE US
Posts:
12
Plugin Contributions:
0

Re: Product Search in Admin

After much work I've traced the problem to admin/include/modules/ category_product_listing.php

In this file resides the section of code that performs the select for the search. The file contains a comment (// fix duplicates and force search to use master_categories_id) and under this comment is code that has been commented out and below it is the replacement code.

When I swap them by un-commenting the first and commenting the second code, the search works perfect.

The part causing the problem is the part that selects p.master_categories_id from the products table and runs it against the products_to_categories table, specifically
"and p.master_categories_id = p2c.categories_id"

I'm not sure why this is needed, I'm sure it's there for a reason.:unsure:

All I know is without it my admin search is working... :clap:

4 Jul 2009, 2:48 PM
#9
jprough avatar

jprough

New Zenner

Join Date:
Feb 2009
Location:
Mogadore, Ohio
Posts:
31
Plugin Contributions:
0

Re: Product Search in Admin

Thanks for the update, I was kind of wondering what was going on my self.

15 Feb 2010, 7:05 PM
#10
jamesedwards avatar

jamesedwards

New Zenner

Join Date:
Feb 2010
Location:
Kansas City
Posts:
1
Plugin Contributions:
0

Re: Product Search in Admin

@fortune81 Thanks a lot for finding this... I was banging my head on this for a while, then decided to wise up and register on the forums... Thanks again!

3 May 2010, 1:44 PM
#11
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Product Search in Admin

is this solution supported by the main developers of ZenCart?

3 May 2010, 4:00 PM
#12
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Product Search in Admin

While a solution like this may work in some instances, it generally indicates that something went awry in an upgrade or mod installation process.
Everyone has their way of doing things, but I think this case is an example of what DrByte talks about in http://www.zen-cart.com/forum/showpost.php?p=640865&postcount=3
BTW - if you scroll to the bottom of a post, you'll find listings for Similar Threads. Loots of good info there as well.

4 May 2010, 5:43 AM
#13
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Product Search in Admin

I think many issues can be due to the Easy Populate module that is great and necessary tool for so many but it has its drawbacks.
Not knowing really if it comes officially integrated one day but of course many webshop software already have such tool. Actually many shopkeepers are forced to use even otherwise crappy webshop software made by their cash register / stock control provider because they would never have time to put the products otherwise than using already the existing info from their stock management.

It is also clear that importing products in a massive way, making a short-cut not using the standard way, there is a big chance to mess up things. Still people either use EP or some other software.

10 Jul 2010, 9:22 PM
#14
lisam avatar

lisam

New Zenner

Join Date:
May 2008
Posts:
5
Plugin Contributions:
0

Re: Product Search in Admin

I'm using EasyPopulate, and I have this same problem. Unfortunately the fix mentioned by fortune81 didn't work for me.

Any other solutions? I, too, have nearly 10,000 products and can't afford to waste the time searching through them to edit one.

11 Jul 2010, 5:34 AM
#15
ajeh avatar

ajeh

Oba-san

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

Re: Product Search in Admin

Do you use Linked Products? If not, there is a quick fix in the Store Manager for this ...

Otherwise, how many categories do you have holding your 1000s of Products?

23 Sep 2010, 4:12 PM
#16
sonar_un avatar

sonar_un

New Zenner

Join Date:
May 2010
Posts:
1
Plugin Contributions:
0

Re: Product Search in Admin

I use the EasyPopulate module and this fixed worked for me!

Thank you very much for the help! I never would have found it.

:clap:

1 Oct 2010, 5:07 PM
#17
jbcholdings avatar

jbcholdings

New Zenner

Join Date:
Jul 2009
Posts:
32
Plugin Contributions:
0

Re: Product Search in Admin

sonar_un:

I use the EasyPopulate module and this fixed worked for me!

Thank you very much for the help! I never would have found it.

:clap:

Double verified. Switch the "$products_query_raw" for the original (I'm assuming this was replaced by the easy populate), before the "else" statement. Going to go ahead and add user-side search back now.

Thanks!

8 Oct 2010, 11:03 PM
#18
paulcreedy avatar

paulcreedy

New Zenner

Join Date:
Sep 2010
Posts:
43
Plugin Contributions:
0

Re: Product Search in Admin

Having the exact same problem here.

Products added with easypopulate can't be searched. However strangely if I add a product manually it DOES show up in the search.

8 Oct 2010, 11:17 PM
#19
paulcreedy avatar

paulcreedy

New Zenner

Join Date:
Sep 2010
Posts:
43
Plugin Contributions:
0

Re: Product Search in Admin

I've applied the 'fix' mentioned above and my admin search is now working.

Question now is why that code was commented out and what are the side effects?

9 Oct 2010, 3:39 AM
#20
ajeh avatar

ajeh

Oba-san

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

Re: Product Search in Admin

The code is commented out as it was causing duplicates and mixing up the categories when there were no master_categories_id ...

Easy Populate and other import programs usually leave out the master_categories_id and products_price_sorter ... this causes issues that will compound over time ...

Removing the commented code to "work" around the real problem is not a good answer ...

Fixing the real problem, the missing master_categories_id is the solution that you need to fix ...