Forums / Upgrading to 1.5.x / Phantom Products: Category count showing products within but turns out empty

Phantom Products: Category count showing products within but turns out empty

Started by scuba_symphony on 10 Jan 2014, 5:29 AM · Views: 2,681

Results 1 to 17 of 17
10 Jan 2014, 5:29 AM
#1
scuba_symphony avatar

scuba_symphony

New Zenner

Join Date:
Jan 2014
Posts:
10
Plugin Contributions:
0

Phantom Products: Category count showing products within but turns out empty

Hello there,

Been digging around the forums and elsewhere looking for people having similar problems but to no avail.

Our store recently upgraded from 1.3.9h to 1.5.1. We did so by doing a fresh install via ftp, then updating the existing database after making backups of both the store files and the SQL database. We're not versed in any sort of coding or programming. We hired someone to create the template for us and use suggested modules only. Just doing the fresh install was a pretty daunting task itself.

Initially everything seemed to work fine. Our custom templates seem to have intergrated with no issues that we can see. We only use a Fedex shipping module, one other shipping module for local deliveries (which is a slightly modified version of one of the default shipping modules) and the Paypal module. Modules have not been tested to work after the fresh install yet, but if they are not working it will be something to work on later.

Sideboxes seem to be working fine as well.

PHP version 5.3.18
MySQL version 5.5.32

The big issue is that not all the products are appearing. The category count shows that products are in the category, but upon entering the category, it is empty. This is happening in both the store and the admin site, so we cannot even go in to edit the "phantom" products. Double checking with the database via myPHPadmin, the product entries are there, with all the relevant data. They are just not showing up.

Errors encountered during the "upgrade" were just:

  1. An error when updating our database (from 1.3.9 to 1.5.0 only. 1.5.0 to 1.5.1 did not encounter any errors). Not a critical one. Something about the admin activity log.
  2. An error about the cache directory, which we then went into our configure files to point them in the right direction.

The current installation is at this url: w w w.s c u b a s y m p h o n y.c o m /d e m o (spaced as suggested up by note above)

It is temporary and will be moved once we sort out the issue.

Any help would be much appreciated.

10 Jan 2014, 5:42 AM
#2
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

Scuba Symphony:

It is temporary and will be moved once we sort out the issue.

Any help would be much appreciated.Just checked and its down for maintenance!
Also post a link to a category where this problem happens?

When upgrading did you change the collation to utf-8 (which is now the default in 1.5.1?

You also might like to check the product type of the "missing" items?

10 Jan 2014, 6:02 AM
#3
scuba_symphony avatar

scuba_symphony

New Zenner

Join Date:
Jan 2014
Posts:
10
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

Ah right forgot to take it out of maintenance mode. Try now.

Actually I followed one of the other posts to change the charset back to the old one. I did see a few mention that there is a way to mass convert the SQL data collation to utf-8 but wasn't sure about it.

What do you mean by "product type"? I went through the database entries and tried to compare data from one product that is showing up and one product that doesn't and can't find any difference that stands out (apart from the obvious like pricing and dates).

13 Jan 2014, 6:59 AM
#4
scuba_symphony avatar

scuba_symphony

New Zenner

Join Date:
Jan 2014
Posts:
10
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

We've just moved the Zencart installation. The issue still persists, but we couldn't leave the page offline for too long.

Access at w w w. s c u b a s y m p h o n y. c o m

Still looking for help as to what's causing it to show up this way. Worst case scenario is that we'll have to reupload the products manually.

Any help at this point will be much appreciated.

13 Jan 2014, 4:25 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Phantom Products: Category count showing products within but turns out empty

A couple of questions:

  1. Are there any debug-log files in the /logs directory?
  2. The CHARSET constant in your /includes/languages/scuba/english.php (or /includes/languages/english.php) is set to iso-8559-1, what is the value for that same constant in /YOUR_ADMIN/includes/languages/english.php?
  3. What is the DB_CHARSET constant set to in your /includes/configure.php and /YOUR_ADMIN/includes/configure.php?
  4. What type of collation is being used in your database? If you have access to phpMyAdmin, look at the Structure of your address_book table, the collation will either be utf8_{something} or latin1_{something}.
22 Jan 2014, 10:11 AM
#6
scuba_symphony avatar

scuba_symphony

New Zenner

Join Date:
Jan 2014
Posts:
10
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

lat9:

A couple of questions:

  1. Are there any debug-log files in the /logs directory?
  1. The CHARSET constant in your /includes/languages/scuba/english.php (or /includes/languages/english.php) is set to iso-8559-1, what is the value for that same constant in /YOUR_ADMIN/includes/languages/english.php?
  1. What is the DB_CHARSET constant set to in your /includes/configure.php and /YOUR_ADMIN/includes/configure.php?
  1. What type of collation is being used in your database? If you have access to phpMyAdmin, look at the Structure of your address_book table, the collation will either be utf8_{something} or latin1_{something}.

Thanks for the reply lat9.

  1. The most recent log file in that folder is over a week ago, for the error I mentioned in an earlier post: "[13-Jan-2014 23:58:19 America/Los_Angeles] PHP Warning: session_save_path() [<a href='function.session-save-path'>function.session-save-path</a>]: open_basedir restriction in effect. File(/var/www/html/shop/cache) is not within the allowed path(s)".

The error stopped occurring after I pointed the configuration file to the right place.

  1. They are exactly the same as follows:
    // charset for web pages and emails
    define('CHARSET', 'iso-8859-1');

  2. They are exactly the same as follows:
    define('DB_CHARSET', 'latin1');

  3. All of them are "latin1_swedish_ci" except admin_menus, admin_pages, admin_pages_to_profiles and admin_profiles

22 Jan 2014, 12:54 PM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Phantom Products: Category count showing products within but turns out empty

No logs and the character-set settings look right. If you can view the products in your admin, but your product-listing pages are not being created properly, I'd put that down to a corrupted (or incorrectly programmed) version of /includes/index_filters/default_filter.php.

Make a backup of the current file and then copy over the version of that file that ships as part of the Zen Cart v1.5.1 distribution zip-file.

24 Jan 2014, 4:04 AM
#8
scuba_symphony avatar

scuba_symphony

New Zenner

Join Date:
Jan 2014
Posts:
10
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

I cannot view the "missing" products in the admin either. The only place I can find them is in the database via phpMyAdmin.

Tried your suggestion anyway but it's still the same.

24 Jan 2014, 4:33 AM
#9
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

Scuba Symphony:

I cannot view the "missing" products in the admin either. The only place I can find them is in the database via phpMyAdmin.

Tried your suggestion anyway but it's still the same.So you can find the item only in phpmyadmin?
using phpmyadmin
find the record
What is its products_id, products_type and master_categories_id?

In the stores admin if you search for the "products_id" does it show up?

24 Jan 2014, 4:56 AM
#10
scuba_symphony avatar

scuba_symphony

New Zenner

Join Date:
Jan 2014
Posts:
10
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

It isn't just one record. It's more than half of the total.

I cannot seem to figure out the difference between ones that show up and ones that don't.

Searching for a missing item via it's product_id results in an empty search. (Tried searching for one of the items that does show up and it works)

24 Jan 2014, 5:06 AM
#11
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

Scuba Symphony:

It isn't just one record. It's more than half of the total.

I cannot seem to figure out the difference between ones that show up and ones that don't.

Searching for a missing item via it's product_id results in an empty search. (Tried searching for one of the items that does show up and it works)

Using phpmyadmin in the "products" table find "ONE" only of these "missing" records

What is its products_id?
What is its products_type?
What is its master_categories_id?

PS: I assume you have tried a repair on these tables (after backing up first)?

24 Jan 2014, 10:04 AM
#12
scuba_symphony avatar

scuba_symphony

New Zenner

Join Date:
Jan 2014
Posts:
10
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

gilby:

Using phpmyadmin in the "products" table find "ONE" only of these "missing" records

What is its products_id?
What is its products_type?
What is its master_categories_id?
PS: I assume you have tried a repair on these tables (after backing up first)?

Using one of the "missing" items:

products_id: 4196 (to compare, I can find product 4149)
products_type: 1 (same as all every other product)
master_categories_id: 800

I didn't try a repair. I did run a check on the database and it returned no errors.

After further digging and comparisons, I'm thinking that products created or modified after a certain date last December are the ones being affected. Their database entries are there, but they do not show up in both the admin and the store page, although they are still being counted for category product count (the number in the bracket next to categories).

I tried changing the last modified date on one of them but it still doesn't show up.

24 Jan 2014, 10:17 AM
#13
scuba_symphony avatar

scuba_symphony

New Zenner

Join Date:
Jan 2014
Posts:
10
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

Scratch that. I compared two items in the same master category. Both were modified within minutes of each other in November 2013. One shows up, the other doesn't.

24 Jan 2014, 11:28 AM
#14
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

Scuba Symphony:

Using one of the "missing" items:

products_id: 4196 (to compare, I can find product 4149)
products_type: 1 (same as all every other product)
master_categories_id: 800Ok they seem fine to me
The fact that the categories have the correct count suggests to me know that its NOT the database.

You are using a template called "scuba" ?
If you temporarily switch back to "classic" does that fix the problem?

When you upgraded did you also upgrade and merge the files in your template directories?
If NOT you will be using the old 1.3.9h files.

Check all the files in your "scuba" overrides to make sure you have updated them
Particularly check the various product_listing.php and product_info.php files in your "scuba" folders

25 Jan 2014, 8:08 AM
#15
scuba_symphony avatar

scuba_symphony

New Zenner

Join Date:
Jan 2014
Posts:
10
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

gilby:

Ok they seem fine to me
The fact that the categories have the correct count suggests to me know that its NOT the database.

You are using a template called "scuba" ?
If you temporarily switch back to "classic" does that fix the problem?

When you upgraded did you also upgrade and merge the files in your template directories?
If NOT you will be using the old 1.3.9h files.

Check all the files in your "scuba" overrides to make sure you have updated them
Particularly check the various product_listing.php and product_info.php files in your "scuba" folders

The issue remains even after switching back to "Classic Contemporary Green".

We did a fresh install, then copied over the old files (to maintain structure) over to the new installation, opting to not overwriting anything (override folders will be created without affecting the newly installed files). Maybe something went wrong here, I can't be certain.

Would removing/renaming the overrides cause the page to default back to the base installation files? I tried renaming the .php files in the override folders for product_listing and product_info but the issue remains.

25 Jan 2014, 3:17 PM
#16
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Phantom Products: Category count showing products within but turns out empty

Scuba Symphony, you're site is failing when it operates this code on every page:

<div id="indexProductListCatDescription" class="content"> </div> <br class="clearBoth" /> <div id="productListing"> <table width="100%" border="0" cellspacing="0" cellpadding="0" id="cat807Table" class="tabTable"> <tr class="productListing-odd"> <th class="productListing-data" scope="col" id="listCell0-0">There are no products to list in this category.</th> </tr> </table> </div>

Important - You said the classic template is not working either...

After testing your site it looks like the problem is with the original template defaults of one of these 2 files:

1 - includes/templates/template_default/templates/tpl_modules_product_listing.php

2 - includes/modules/product_listing.php

Which only assumes that the header_php.php for the product listing page/product page is receiving the correct information.

Your categories sidebox is clearly getting the correct data back from it's SQL query, your product listing is not.

It looks like you've established the integrity of the data in your database which again points to the file running the SQL query for product listing which is called every time you click a link in the category sidebox.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

5 Feb 2014, 10:35 AM
#17
scuba_symphony avatar

scuba_symphony

New Zenner

Join Date:
Jan 2014
Posts:
10
Plugin Contributions:
0

Re: Phantom Products: Category count showing products within but turns out empty

Thanks for the detailed analysis Twitchtoo!

Though I'm still not quite sure how to solve the issue. Would copying the originals files over those files mentioned work?