X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Replace Product ID Number (https://forum.x-cart.com/showthread.php?t=17860)

mixman 11-09-2005 04:38 PM

Replace Product ID Number
 
Currenty X-Cart version 4.0.16 will start your product id numbers at #1. Is there an easy way to change that to a number of my choice?
Any help would be appreciated!!!

cbarnes 11-09-2005 06:35 PM

If I understand your question, you probably want to change the productid #1 to a larger number, let's say productid #100

You can change the auto-increment values in your MySQL table with this command.

Code:

ALTER TABLE xcart_products AUTO_INCREMENT = '<YOUR_NUMBER>'

Replace <YOUR_NUMBER> with the actual integer value.

For example:

Code:

ALTER TABLE xcart_products AUTO_INCREMENT = '100'

Doing this on a live X-Cart installation is very risky, as many of the tables refer to the productid. So, my advice, only do this if this is a completely fresh install with no products yet.

MySQL docs:
http://dev.mysql.com/doc/refman/4.1/en/example-auto-increment.html

I hope this helps...

mixman 11-10-2005 06:58 AM

I tried that command but it failed. Ireceived this response: SQL PATCH FAILED AT QUERY:
ALTER TABLE xcart_products AUTO_INCREMENT = '2500'

I have some test products. Maybe this is why it failed?

Any Ideas?

cbarnes 11-10-2005 07:02 AM

Quote:

Originally Posted by mixman
I tried that command but it failed. Ireceived this response: SQL PATCH FAILED AT QUERY:
ALTER TABLE xcart_products AUTO_INCREMENT = '2500'


Hmmm...

You might try it without the ticks. i.e.

Code:

ALTER TABLE xcart_products AUTO_INCREMENT = 2500

Let me know if that works.

balinor 11-10-2005 07:08 AM

Question - why are you worried about the product id number?

mixman 11-10-2005 08:04 AM

That worked!!! Thank you.

In reply to Question - why are you worried about the product id number?

The product ID number shows in the product details page. For example it shows as Bike Helmet #1...if the productid is #1. I just think that it may be confusing to customers. Such a small number does not seem like a productid number. Bike Helmet #17566 is more obvious the number is a productid#.
In my humble opinion.

balinor 11-10-2005 08:07 AM

Actually I would suggest removing that number as it serves no purpose. Open up product.tpl and replace this:

Code:

{include file="dialog.tpl" title=$product.producttitle content=$smarty.capture.dialog extra="width=100%"}

with this:

Code:

{include file="dialog.tpl" title=$product.product content=$smarty.capture.dialog extra="width=100%"}

mixman 11-10-2005 08:10 AM

I do think the number is useful, especially when you have many products that are similar. Many of our customers places phone orders and that number comes in very handy in identifying products quickly and eliminating mistakes.

balinor 11-10-2005 08:12 AM

Don't you have SKU numbers?

mixman 11-10-2005 08:16 AM

Yes, but SKU numbers are not visible until checkout. So most customers who are just browsing will never see that number and will usually refer to the productid number if they have questions regarding a paticular product.


All times are GMT -8. The time now is 12:57 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.