Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Replace Product ID Number

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-09-2005, 04:38 PM
 
mixman mixman is offline
 

Member
  
Join Date: Aug 2003
Posts: 20
 

Default 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!!!
__________________
version 3.4.8
Reply With Quote
  #2  
Old 11-09-2005, 06:35 PM
 
cbarnes cbarnes is offline
 

Member
  
Join Date: Oct 2005
Location: Kansas
Posts: 18
 

Default

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...
__________________
Chris Barnes
Ative LLC
X-Cart Development & Consulting
Reply With Quote
  #3  
Old 11-10-2005, 06:58 AM
 
mixman mixman is offline
 

Member
  
Join Date: Aug 2003
Posts: 20
 

Default

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?
__________________
version 3.4.8
Reply With Quote
  #4  
Old 11-10-2005, 07:02 AM
 
cbarnes cbarnes is offline
 

Member
  
Join Date: Oct 2005
Location: Kansas
Posts: 18
 

Default

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.
__________________
Chris Barnes
Ative LLC
X-Cart Development & Consulting
Reply With Quote
  #5  
Old 11-10-2005, 07:08 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Question - why are you worried about the product id number?
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 11-10-2005, 08:04 AM
 
mixman mixman is offline
 

Member
  
Join Date: Aug 2003
Posts: 20
 

Default

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.
__________________
version 3.4.8
Reply With Quote
  #7  
Old 11-10-2005, 08:07 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

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%"}
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #8  
Old 11-10-2005, 08:10 AM
 
mixman mixman is offline
 

Member
  
Join Date: Aug 2003
Posts: 20
 

Default

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.
__________________
version 3.4.8
Reply With Quote
  #9  
Old 11-10-2005, 08:12 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Don't you have SKU numbers?
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #10  
Old 11-10-2005, 08:16 AM
 
mixman mixman is offline
 

Member
  
Join Date: Aug 2003
Posts: 20
 

Default

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.
__________________
version 3.4.8
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:20 PM.

   

 
X-Cart forums © 2001-2020