Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Best way to remove product from database?

Best way to remove product from database?

Locked

Views: 1,011

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
15 Aug 2010, 1:04 AM
#1
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Best way to remove product from database?

I deleted products several times, and then the price was missing from the import. It was several days ago, and several deletions ago, so I cannot say for sure that the price was ever there.

I deleted another set of products, which had the price showing and also the icon for the product showing, and now the price is there but the icon does not show.

I tried Linda McGrath's suggestion in another post:

Look at your database to see how many rows are in the tables:
products
products_description
products_to_categories

These should match ...

If so, go to the Tools ... Store Manager ... and run, in order:
Update master_categories_id
Update products_price_sorter

Now see if everything is set right ...

Updating the master_categories_id will take the categories_id from the products_to_categories table and update all master_categories_id with that value ...

Updating the products_price_sorter will update the field used for sorting prices when in the Catalog so that things sort correctly without having to do any calculations on the sort ...

However, there was no change.

This is a test site, and I can easily restore the backup and start fresh.

I was just wondering if something as simple as copying prices into PHPMyAdmin could be done when the upload with Easy Populate does not place the products in the database.

Or, does it really interrelate with a lot of tables when you delete something, so that if you delete products by deleting the subcateories, you run the risk of damaging the database and needing to restore it, so that maybe deleting products one-by-one is really the only safe method of deletion.

One related question: My product numbers are getting to be very high even though I really do not have any products in my store yet; I am using test files. Is there a way to renumber the products?

Thanks.

Notageek

15 Aug 2010, 3:34 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Best way to remove product from database?

notageek:

Or, does it really interrelate with a lot of tables when you delete something, so that if you delete products by deleting the subcateories, you run the risk of damaging the database and needing to restore itYes.
notageek:

One related question: My product numbers are getting to be very high even though I really do not have any products in my store yet; I am using test files. Is there a way to renumber the products?At a strictly technical level yes, but due to the interrelation of all the products across all tables, it's a very complicated procedure. You'd have to touch EVERY record in EVERY table that has a products_id column, as well as several other tables where products_id is stored in different column names perhaps combined with other data. And any addons that may store that data in different ways in custom tables might also create complications. So, in essence, the real answer is no.
It would be better to wipe all products and start clean, adding/importing fresh.
And, since this is a test shop, a fresh clean wipe of the entire database is probably your smartest move.

15 Aug 2010, 3:35 AM
#3
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Best way to remove product from database?

What I think happened in my case is that I was tinkering with the category names, and reloaded the same products once or twice or more for a few smaller tests, and the Zen Cart must have recognized the products as existing somewhere in the database and linked them, thereby triggering some sort of mechanism in the price structure.

Can anyone corroborate that?

Is there any explanation of why the pictures no longer show for some of the products in a second file I uploaded as a test?

Notageek

15 Aug 2010, 12:19 PM
#4
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Best way to remove product from database?

Well, it turns out my "backup" is using the same database as the test site, so they are identical. I should have made a separate database for the backup copy.

So I would appreciate any comments on whether there is a way to rectify the situation where the price doesn't show, and in one case the column for price has actually disappeared.

I'm suspecting I will have to start over from scratch.

Thanks.

Notageek

15 Aug 2010, 1:50 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Best way to remove product from database?

Sounds like you've damaged your database significantly, either by making bad raw edits, or importing bad data somehow. Starting fresh would be the best course of action.

And keeping full backup copies of the database by exporting the entire thing to a .sql file is always strongly recommended.

15 Aug 2010, 3:15 PM
#6
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Best way to remove product from database?

Dr. Byte,

Thanks very much for your help.

Notageek

23 Aug 2010, 3:35 AM
#7
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Best way to remove product from database?

Dr. Byte,

Because I was researching an error message in Easy Populate after uploading products, I was reading this post #2605 in the Easy Populate 1.2.4.5 thread:

Quote:
Originally Posted by NickPCs
I just installed EasyPopulate on my new zencart and I am trying to upload a datafile to it. I get the following errors when I try to upload "An SQL error has occured. Please check your input data for tabs within fields and delete these. If this error continues, please forward your error log to the Easy Populate maintainer" I dont have an easypopulate errorlog in my Temp folder and I dont really know what to do, it said that the file itself may be causing the issue so I will post that as well. Any info would be a great help, thank you!
What EP version are you using? The 1.2.5.6 CSV version?

(I personally don't use these newer "csv" versions as they appear to be a bit buggy).

Your v_products_price...

$35.61
$341.76
$341.80
$335.07
$341.80
$341.80
$30.65
$169.33
$299.06
$347.04

You are including a $ symbol before the price. This column should just be the numeric value - NO currency symbol.


I never let my schooling interfere with my education - (Mark Twain).

Well, the missing price problem was solved when I discovered I did indeed have the $ in my price column, which may have somehow been put there automatically by Excel 2007, because when I tried to work with the file in Open Office, I couldn't delete the $. I researched and found how to remove it (same method in both Excel and Open Office: select cells, right click, choose numeric format), and I was finally able to see a price again in my uploads.

I still see the message after upload of products through Easy Populate telling me to check for extra tabs in fields, but I looked at my file and found none. I believe this has solved the missing price problem, which had carried over into my fresh install of Zen Cart. Maybe that message will go away soon.

Your careful comment in this thread provided the magic key. Thank you for sharing your expertise.

Notageek

10 Sep 2010, 5:56 PM
#8
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Best way to remove product from database?

I am currently using Product - General to upload music CDs, because Easy Populate 1.2.5.4 does not upload the Product - Music type, and I prefer to go with 1.2.5.4 for reliability reasons.

If I were to move products over to the Product - Music type later, by just creating a new product and copying the data into the new product, I am wondering what the correct sequence would be to do this.

Given that I will be creating identical products, should I assume the cart will consider the new product type not in conflict with the other product so that I can just turn off the other product; or should I delete the general type product once I have it installed as a music type product?

In the event I were to temporarily change over my Easy Populate version to a version that will populate the Product - Music type, just for this change-over operation, would I first need to delete the Product - General type products with the same model number before loading the files into the Product - Music type?

Thanks for any comments.