Jump to content

id number of products


locean67

Recommended Posts

Hello,

First of all I'd like to apologize if this post should be somewhere else.

Do you know how to lower the id of a product?

Exemple : I create a product and it got id number 4. I delete that product right after creating it and create another one. It's id number will be 5 and not four.

Is there a way to not have a missing number?

I'm sorry if I didn't explain it well

 

thank you for your answers

Edited by locean67 (see edit history)
Link to comment
Share on other sites

I believe it's possible by tweaking your database tables but I will not recommend to! Why you want to change it anyway? It isn’t important at all and will happen anyway again in future so is better just to leave it as it should be, but if you want you should go to phpmyadmin (for example) and then changing PS_PRODUCT table rows(ID_PROD I think or something like that, it's the first column anyway), but I can’t guaranty that you’ll not have some unexpected bizarre things happen to your shop then! You know databas tables aren’t that independent and you should know exactly what are you doing when tweaking them manually if there'd be any dependencies or what!

Good luck all the way! ;)

Link to comment
Share on other sites

Yes in the database click on ps_products or pr_products and then click on operations at top of screen you will see an area named Table options look for auto_increment and change the number in the box.

 

So if you have products 1,2,3 and deleted 4 & 5 your next product will be 6 but you can change the number back to 4 in the text area above.

So now the next product you enter will be 4, if you feel the need to have them listed numerically, but as mim stated it is really not that important and only used by Prestashop to link the various parts of a product together.

 

At some point you will delete product # 253 of 500 and have a gap there anyway.

  • Like 1
Link to comment
Share on other sites

  • 6 months later...

Yes in the database click on ps_products or pr_products and then click on operations at top of screen you will see an area named Table options look for auto_increment and change the number in the box.

 

So if you have products 1,2,3 and deleted 4 & 5 your next product will be 6 but you can change the number back to 4 in the text area above.

So now the next product you enter will be 4, if you feel the need to have them listed numerically, but as mim stated it is really not that important and only used by Prestashop to link the various parts of a product together.

 

At some point you will delete product # 253 of 500 and have a gap there anyway.

 

Thank you. This helped me a lot :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...