X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   First Order ID modifed (https://forum.x-cart.com/showthread.php?t=6181)

B00MER 01-23-2004 11:28 PM

First Order ID modifed
 
Code:

ALTER TABLE xcart_orders AUTO_INCREMENT = 15000;

Enter this SQL query into Patch/Upgrade SQL Queries box and your next new order # will be 15001.

Happy X-Carting! ;)

leon 01-24-2004 07:21 AM

Re: First Order ID modifed
 
Quote:

Originally Posted by B00MER
Code:

ALTER TABLE xcart_orders AUTO_INCREMENT = 15000;

Enter this SQL query into Patch/Upgrade SQL Queries box and your next new order # will be 15001.

Happy X-Carting! ;)


Are you sure about that ? Isnt it the orderid field that needs to be altered directly, not a global attribute ?

Im not an expert, but I thought fields could be altered, or attributes, but not directly affect an attributes numbering. If so, let me know, could be handy for other CMS's

Taekwondo 01-27-2004 12:44 PM

It Works
 
Works like a champ!

Thanks Boomer.

TonyD 05-11-2004 08:33 AM

Thanks Boomer!



*search works for me.* :D

JohnA 05-12-2004 02:59 PM

Yep works for me as well on 3.5.6!

Thanks Boomer

jcasella 07-28-2004 04:04 PM

Excellent! Worked like a charm for me as well (v3.5.10). Thanks Boomer!

doersam@hotmail.com 08-23-2004 04:57 PM

Works great! Thanks for your input.

Zak 09-08-2004 07:16 AM

A step further...
 
Great fix! Now, taking all this a step further, I hava client who wishes to have the date included in his order number. On top of that, he wants the order numbers to restart daily. Example, the second order placed on 9-4-04 would appear as: 9-4-04-02... Any suggestions on how the query code could be written to accomplish any or all of this greatly appreciated.

X-Cart version 4.0.2
PHP 4.3.4 Details
MySQL server 4.0.18
MySQL client 3.23.49
Web server Apache/1.3.27 (Unix)

TonyD 10-19-2004 12:20 PM

Thaks again Boomer. 8)

aschek 11-16-2004 07:39 AM

Can I include alpha ?
 
Hey Boomer,
I am not an expert, but need to ask you please... is it possible to include ALPHA on this ? Let's say, start the order as ABC1000 then ABC1001 and let only the numbers increase ?

Thanks a lot !!
Alex

shan 11-16-2004 07:43 AM

Re: Can I include alpha ?
 
Quote:

Originally Posted by aschek
Hey Boomer,
I am not an expert, but need to ask you please... is it possible to include ALPHA on this ? Let's say, start the order as ABC1000 then ABC1001 and let only the numbers increase ?

Thanks a lot !!
Alex


Hi, The order id only accepts numbers im afraid. you could always add the extra letters before where it prints on your order etc

CC 11-24-2004 07:26 AM

Nice one, going to run this on 4.0.7 now, hope it still works...

Does anyone know if an Invoice number mod exists for X-Cart?
So an invoice number is created only when the order has succesfully had the payment taken?

So for instance, an invoice number is created only when the order is set to Processed, then it is displayed at the top of the printed invoice...

In the UK the taxman will want to see consecutive invoices, but you wont have that if a customer has cancelled their order, so you cant do this with Order Numbers, it has to be fully consecutive invoice numbers...

Anyway, anyone know about something like this in existance?

Thanks.

clydefrog 11-28-2004 11:29 AM

The mod worked for me. Thanks.

CC - I would not use the order number in substitute of the invoice number that you should be keeping record of separately.

CC 11-28-2004 01:48 PM

How do you mean?

I think you are saying the same as me... :?

I have to have in place to separate number references:

1) Order Number
2) Invoice Number <--- Which must be consecutive for the Tax Man.

TL408 01-18-2005 12:03 PM

Would this "Order ID" mod work for the newest version of X-cart, 4.0.10 ?

Thanks
-Tuan

PhilJ 01-18-2005 12:16 PM

yep, works on any table you want
eg.

ALTER TABLE xcart_orders AUTO_INCREMENT = 0;

ALTER TABLE xcart_categories AUTO_INCREMENT = 0;

ALTER TABLE xcart_products AUTO_INCREMENT = 0;

ALTER TABLE xcart_manufacturers AUTO_INCREMENT = 0;

ALTER TABLE xcart_extra_fields AUTO_INCREMENT = 0;

etc.

TL408 01-18-2005 01:44 PM

Thank you, I appreciate your help. :D

smrtsu 01-24-2005 10:12 AM

Re: First Order ID modifed
 
[quote="B00MER"]
Code:

ALTER TABLE xcart_orders AUTO_INCREMENT = 15000;

Enter this SQL query into Patch/Upgrade SQL Queries box and your next new order # will be 15001.

Question: I can't find Patch/Upgrade - I'm accessing the db using phpMyAdmin. So, would I enter this in the "Run SQL query/queries on database xcart " entry box on the xcart_orders SQL tab?

Thx
Sue

CC 01-24-2005 10:16 AM

Yes.

But patch/upgrade is in your admin of XC, should be simple to find.

smrtsu 01-24-2005 10:35 AM

:oops:

Yes, you are correct, I was making it too difficult, looking in the dir structure - Thanks!

TonyD 02-11-2005 10:15 AM

yes it does.

jorval 02-13-2005 06:17 PM

Alternative
 
Hi there

My first post here, so please dont kill me :)

Here is an alternative to increasing the order id.

Make a fake order and keep in mind the order id of this order (let it be '6').

Execute the MySQL patch thru the 'APPLY MYSQL PATCH' SECTION of the 'Upgrade/Patch' part of the 'Adminiatration' menu in admin area:

1. Scroll down the "Patch/Upgrade center" page and find the "Apply SQL patch" section.
2. Enter the patch text:
Code:

update xcart_orders set orderid=801219 where orderid=6;

into "Query(ies):" text area and push the "Apply" button.

So, the next order will be numbered as order #801220

Hope this is useful.

MythNReality 05-12-2005 01:16 PM

Re: First Order ID modifed
 
Quote:

Originally Posted by B00MER
Code:

ALTER TABLE xcart_orders AUTO_INCREMENT = 15000;

Enter this SQL query into Patch/Upgrade SQL Queries box and your next new order # will be 15001.

Happy X-Carting! ;)


Boomer,

Sorry for asking...Do I do this through the MYsqldatabase or apply patch?

thanks

markwhoo 05-12-2005 06:44 PM

Re: First Order ID modifed
 
Quote:

Originally Posted by MythNReality
Quote:

Originally Posted by B00MER
Code:

ALTER TABLE xcart_orders AUTO_INCREMENT = 15000;

Enter this SQL query into Patch/Upgrade SQL Queries box and your next new order # will be 15001.

Happy X-Carting! ;)


Boomer,

Sorry for asking...Do I do this through the MYsqldatabase or apply patch?

thanks


Look in the quote you had highlighted, that is the answer.

Admin:patch: enter data...


Quote:

Enter this SQL query into Patch/Upgrade SQL Queries box and your next new order # will be 15001.

MythNReality 06-21-2005 06:52 PM

Re: First Order ID modifed
 
Quote:

Originally Posted by markwhoo

Look in the quote you had highlighted, that is the answer.

Admin:patch: enter data...


Quote:

Enter this SQL query into Patch/Upgrade SQL Queries box and your next new order # will be 15001.


Duh...thanks, got that implemented, it's great! :lol:

aostuff 07-11-2005 04:35 PM

Works on 4.0.14
 
This is a great tip.. I just did it on my verison 4.0.14 site.

Nick

shan 07-12-2005 03:39 AM

Quote:

Originally Posted by TL408
Would this "Order ID" mod work for the newest version of X-cart, 4.0.10 ?

Thanks
-Tuan


yes

timbrrr 03-02-2006 05:33 PM

How about taking this one further, and figuring out a way to increase the order by x number of orders for each order? That way if a store was doing just a few sales a day, the returning customer wouldnt think he/she was the only customer.. something to think about for the people out there who are just starting out as we all have done

uiterwyk 03-03-2006 05:32 AM

If you are running MySQL 5.0 or above, they introduced a new varaible with that called auto_increment_increment that does just what you want. The MySQL command to change it is:
Code:

SET @@auto_increment_increment=10;
(Or whatever other value besides 10 you might want.

TL408 07-15-2006 12:32 PM

Anyone happen to know if this will still work in version 4.1.2 release?

Thanks
-Tuan

TL408 07-15-2006 12:33 PM

Anyone happen to know if this will still work in version 4.1.2 release?

Thanks
-Tuan

nevets1219 07-15-2006 04:18 PM

As long as the field in the database is still the same it'll work. This is independent of X-Cart and has more to do with MySQL.

timbrrr 07-16-2006 01:59 PM

I tried this and it does work on 4.1.2

B00MER 07-16-2006 04:56 PM

Quote:

Originally Posted by nevets1219
As long as the field in the database is still the same it'll work. This is independent of X-Cart and has more to do with MySQL.


Yup! Well put, Order ID's are simply MySQL auto increment keys. :wink:

TL408 07-16-2006 07:59 PM

Thanks guys. Cheers

-Tuan


All times are GMT -8. The time now is 07:51 AM.

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