Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Your Zen Cart Products / Setting Up Categories, Products, Attributes / How to change product ID for new created product to the one that was deleted?

How to change product ID for new created product to the one that was deleted?

Started by newproduct4you on 7 Apr 2010, 12:42 AM · Views: 1,346

Results 1 to 6 of 6
7 Apr 2010, 12:42 AM
#1
newproduct4you avatar

newproduct4you

New Zenner

Join Date:
Apr 2010
Posts:
7
Plugin Contributions:
0

Post #1 by newproduct4you

I just deleted a product and created a new similar one but I didn't think that the product ID would be a new one. I have created links to this product page whose ID is #37. The new ID is #39.

Is there any way to change the #39 to #37, so I will not have to edit my web links to #39?

7 Apr 2010, 4:45 PM
#2
newproduct4you avatar

newproduct4you

New Zenner

Join Date:
Apr 2010
Posts:
7
Plugin Contributions:
0

Post #2 by newproduct4you

ok, I found the solution myself.

go to phpMyAdmin ---> Table: products ---> products_id

Just edit the products_id

:smile:

7 Apr 2010, 4:52 PM
#3
drbyte avatar

drbyte

Sensei

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

Post #3 by drbyte

Um ... bad idea ... cuz now everything else related to the details of that product is now out of sync, like the description, the categories it's linked to, all its attributes, everything.

If you're gonna muck around in raw database tables, at least go study the relationships between all the other tables which interact with it.
A starting point for that would be here: http://www.zen-cart.com/wiki/index.php/Developers_-_Database_Schema

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Apr 2010, 5:10 PM
#4
newproduct4you avatar

newproduct4you

New Zenner

Join Date:
Apr 2010
Posts:
7
Plugin Contributions:
0

Post #4 by newproduct4you

oh yes, you are right, the product was dissappear from its category but can be accessed by direct-linking to it.

any suggestions for further editting?

7 Apr 2010, 5:13 PM
#5
drbyte avatar

drbyte

Sensei

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

Post #5 by drbyte

You'll have to fix the product number everywhere else that the old number is used anywhere in the database.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Apr 2010, 5:16 PM
#6
newproduct4you avatar

newproduct4you

New Zenner

Join Date:
Apr 2010
Posts:
7
Plugin Contributions:
0

Post #6 by newproduct4you

ok, i'll try that
thanks.