Jump to content

Phantom products still...


Guest

Recommended Posts

Okay, I'm still plagued by this problem on www.cosplaycostumecloset.com. If you click on http://www.cosplaycostumecloset.com/index....at&catId=78, you will see midway down a "faux rhinestone bikini". However when you click on it, you get that it doesn't exist.

It *shouldn't* exist on this site. I originally copied my database from www.sensualelegance.com to the ccc site last year when I created ccc and deleted the categories and items I didn't want to show on ccc.

But I keep noticing this sort of phantom product. i've tried repairing the database and running the category count tool multiple times and I still get items show in "featured product" that shouldn't and just discovered some are even showing in the category list that shouldn't!

Any ideas???

ccc is my kid-friendly site and a few of my more adult items are appearing as phantoms too!

Link to comment
Share on other sites

Guest ladyraven

I have the same thing.. i can't delete my category cause it shows 11 products in there, but there isn't any in there...

so maybe if you get an answer it will help me too?

thanks

raven

Link to comment
Share on other sites

Guest ladyraven

I also re did my data base and also ran fixcatcount with no help as well.. I had this before but it went away on its own.

Then after i bought a skin and it was installed it came back..

Thanks for trying tho.. I am not sure what to do

Link to comment
Share on other sites

I haven't looked at "fixcatcount" yet, but by the sound of its filename, I think it's not designed to fix this problem.

Let's compare the two SQL statements.

We need to find the reason why a product not assigned to a category is showing in that category, and then why, when clicking on it's link, the product page tells us that it doesn't exist.

__View Category__

SELECT CubeCart_cats_idx.cat_id, CubeCart_cats_idx.productId,

	   productCode, quantity, description, image, price, name,

	   popularity, sale_price, stock_level, useStockLevel

FROM   CubeCart_cats_idx 

INNER JOIN CubeCart_inventory 

ON	 CubeCart_cats_idx.productId = CubeCart_inventory.productId 

WHERE  CubeCart_cats_idx.cat_id = $catId;


In the Category page, we are asking for a set of records where, for a specific category, only those products whose productId is found in 'cats_idx'. You can have your product belong to more than one category. So, product 1769 can belong to categories 78 and a primary category (the number of which is difficult to discern from rendered pages).




__View Product__

SELECT productId, productCode, quantity, name, description, 

	   image, noImages, price, popularity, sale_price, 

	   stock_level, useStockLevel, digital, digitalDir, 

	   CubeCart_inventory.cat_id, cat_father_id,

	   cat_name, cat_image, per_ship, item_ship, item_int_ship,

	   per_int_ship, noProducts 

FROM   CubeCart_inventory 

INNER JOIN CubeCart_category 

ON	 CubeCart_inventory.cat_id = CubeCart_category.cat_id 

WHERE  productId = $productId;

In the Product page, we are asking for a set of records where, for a specific product, only those products whose primary category is found in 'category'. Suppose the primary category doesn't exist? Product not found!

By primary category, I mean that category the product was assigned to when it was created or changed to when the product is edited.

So, odds are likely that product 1769 exists in the 'inventory' table, but there is no corresponding primary category in the 'category' table.

As my store does not show this behavior, the following is a good guess as to how to fix it without manually editing the database tables directly:

Find the product in the Admin, View Products page. From there, in the Master category column, observe whether a category is listed. Then click the "Manage Categories" link.

In the window that pops up, click the "Remove" link for any and all categories you do not want the product to appear in. If I'm right, category 78, "Sexy Costumes," will be listed with an action to Remove. Do so.

Now, back at the Product Inventory page, in the Action column, click the Edit link and assign it to its appropriate primary category.

Let us know how it turns out.

Oh, by the way, there are a couple of other products on that same category page that have the same problem. So, on the Admin, Product Inventory page, if other products do not list a primary category, fix those, too.

Link to comment
Share on other sites

You know... I got to thinking. This Mysty person seems to have all the screws tight between the headsets, and would have looked at the Product Inventory pages already. So what else could be the problem?

I've just discovered that the Admin, Product Inventory page will also not display products that are not assigned a primary category.

In the file, /admin/products/index.php, find:

	if(isset($_GET['category']) && $_GET['category']>0){

		if(isset($like)){

			$whereClause .= " AND ";

		} else {

			$whereClause .= " WHERE ";

		}

		$whereClause .= $glob['dbprefix']."CubeCart_inventory.cat_id = ".$_GET['category']; 

	}

		$query = "SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory INNER JOIN ".$glob['dbprefix']."CubeCart_category on ".$glob['dbprefix']."CubeCart_inventory.cat_id = ".$glob['dbprefix']."CubeCart_category.cat_id ".$whereClause." ORDER BY ".$orderBy;

	}

Change the "INNER JOIN" to "LEFT OUTER JOIN". That should return all products and give a NULL category to those with no assigned category.

See what happens.

Link to comment
Share on other sites

Well, actually when I search for the product from Admin, it doesn't come up. I was able to get to it by editing the product id of another product and get its page to display, then I removed it from all categories so the rhinestone bikini no longer shows up in the category. (it did have a primary category).

Biggest problem is, i still get this and other "phantom" products show up in the featured product box. When they are clicked, the product doesn't exist, but so far I have not found any way to locate these products and permanently delete them. thats what I really need to do.

Link to comment
Share on other sites

Did you modify the file as suggested above. I ran some experiments and the Product Inventory will show ALL products in the inventory database (prior to any pre-filtering via the selection boxes at the top) regardless of anything else.

After this change to the SQL statement, my experiments would suggest that if a product is showing up anywhere on your site AND still not showing in the Product Inventory page, then it might be getting imported from a different database.

Link to comment
Share on other sites

You said, "When I search for the product from Admin, it doesn't come up." Might you be using the filter box labeled "containing the text"?

You said, "Yes [to having made the change to the SQL] and nothing shows up." By "nothing" I hope you mean that there is, in fact, a list of products displayed in the Administrative (View Products) Product Inventory page, except that you can't seem to find your "Stars & Stripes Suspender Teddy" (Product Code: EM-7137, Product ID: 1036) when paging through the list.

How did you determine that the rhinestone bikini had a primary category?

Link to comment
Share on other sites

There were no products without a category assigned. Or maybe I'm missing something - what was it I was supposed to search for after making your code change? There seems to be no difference at all in the way my products display in admin>view products and searching for the phantom item still does not display it.

As I previously said: "I was able to get to it by editing the product id of another product and get its page to display, then I removed it from all categories so the rhinestone bikini no longer shows up in the category. (it did have a primary category)." But searching for "bikini" or its item number or its product id in the normal way pulled up nothing.

Link to comment
Share on other sites

After you had made the code change in the file /admin/products/index.php, then page through the products in the View Products admin section until you get to the item with the ID of 1036. Product ID 1036 is also one of the products that is causing problems.

Link to comment
Share on other sites

Guest ladyraven

After you had made the code change in the file /admin/products/index.php, then page through the products in the View Products admin section until you get to the item with the ID of 1036. Product ID 1036 is also one of the products that is causing problems.

I have done everything you have said and still it hasn't worked..

I understand your answering her in this post, but hey i have the same problem as well here.. lol

And i followed you to a tea too

But still shows the cat with 11 items in it under Boundary waters collection.. and still nothing there. but the products keep popping up in the latest products box

Tami

amagicforest.com

Link to comment
Share on other sites

Ladyraven, your problem is slightly different. I think your database got out of sync and I'm surprised that fixcatcount didn't work.

Earlier you said you couldn't delete a category because CC seems to think there are still products assigned to that category. Having made the mod mentioned above, and still not seeing any Boundary Waters products in the Admin View Products page tells me there aren't any.

But now you say they are showing up in Latest Products. All I see in your Latest Products section are three Coconut Limes, three Desert Pears, and two Pina Coladas.

If you know how to get access to your database, we can force the issue regarding non-empty categories that have no products. Let me know if you are ready to do that.

Link to comment
Share on other sites

Guest ladyraven

Ladyraven, your problem is slightly different. I think your database got out of sync and I'm surprised that fixcatcount didn't work.

Earlier you said you couldn't delete a category because CC seems to think there are still products assigned to that category. Having made the mod mentioned above, and still not seeing any Boundary Waters products in the Admin View Products page tells me there aren't any.

But now you say they are showing up in Latest Products. All I see in your Latest Products section are three Coconut Limes, three Desert Pears, and two Pina Coladas.

If you know how to get access to your database, we can force the issue regarding non-empty categories that have no products. Let me know if you are ready to do that.

No i said.. or maybe this is what yoru saying as well?

Is that this happen before and went away.. it wasn't till after my skin was installed by another person, that it came back again. The category is there boundary waters collection, its showing 11 products, in admin, there isn't any products there, but wont let me delete the boundary waters cause of this reason..

I have done everything i know how, or everything others have said here. And you i did as well with no luck.

Now the ghost products come up in the featured product box, and if you click on it it shows theres nothing there.. I read for a week everything i can on here, all the mods as well. looking for anything, when i read what you said here, i thought, ohh maybe a fix at last, your advice was new, and i tried it with no results... so i am back at the drawing board again. Its 11 different products that pop up there, and its driving me crazy on how ot fix it.

do you have any more advice?

i would be so very thankful if you did

thanks for answering.

Tami

Link to comment
Share on other sites

Guest ladyraven

You didn't say if you were ready to access your database directly.

My next piece3 of advice is to let a trusted guru access your CC admin panel, your MySQL database, and your hosting site by FTP.

If you tell me how to do it, i can access it and look and see...

If i cant, grassmeyerdesign who put my skin on.. i trust fully, and she and her company is very helpful.

I wish i knew alot more then i do.. I am trying,

so yes i can access it.

Link to comment
Share on other sites

(All tables will be prefixed with "something_CubeCart_" but I won't include that here. Also, the means by which you access your database determines the actions you will need to take to display the contents of a given table in a spreadsheet format.)

Look in the table "category". Find the record where 'cat_id' is 37. In the column 'noProducts' for that record, there will be a value (maybe 11). This is just to verify that the database says there are 11 products in this category. (Also note if there is a value other than 0 in the 'cat_father_id' column. Hopefully, there won't be.)

Now look at the table "cats_idx". If you can, sort that table on 'cat_id'. For any record where the 'cat_id' is 37, take note of the value in the 'productId' column. The number of records that you find where 'cat_id' is 37 is not important.

If you noted some records in the previous step, then look at the "inventory" table. Find the record(s) where the 'productId' is the number(s) you noted in the previous step. For each of these records, note the value found in the 'cat_id' column.

If the database is synced properly, the value found in the 'cat_id' column is 37. If not, then the database is not synced and the change I had you make to the admin file should let you find and work with this rogue product.

To force the ability to delete a category that you cannot find any products assigned to it, go back to the "category" table, to the record where 'cat_id' is 37, and put a zero in the 'noProducts' column.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...