random order id (for 2.1.2 ver)

i believe that the order id should be a random number (user can select range e.g 1000,9999) with suffix or prefix, or it can be a date/time stamp

e.g 20110205155042 :which means 05-02-2011 at 15:50:42 (hour/min/sec)

so every id will be unique unless two order made at the exactly same second



many other ecommerce uses that function. cs-cart dont’



i found some other posts here but are for older cs version and i am little confused



so what can i do now to make an order id as a date stamp or random number?



maybe you want to vote for the “new idea”



thanks in advance

The order_id is the primary key of the orders table. All other data about the order uses this as a “foreign key”. Since primary keys are usually allocated as an “auto increment” when the first INSERT is performed, changing it will probably be problematic. You would have to do this where the order is first created and it must be an integer value otherwise you’d have to revamp everything on the site.



I don’t thnk the change adds any value.



I default to a date/time representation with a 3 digit auto increment value tacked on for orders that are created manually in my order management system. But that’s because my system uses a combination of order_id and company_id for the primary key since multiple customer accounts could have the same order_id’s (and many do).



So I’d vote no to your request. But it may be addressed in the multiple store work that is underway.

thanks for your reply

i created my shop (actually move from oscommerce) the previous days and today or tommorow i want to (offically) open. and so i am trying to do all the development now before i open.

Maybe you could explain your reasons for wanting the orderID to be date based or random? You can always set the store to start at 9246 as an example.

if a customer make an order with id 8453

and after a month (after 5 orders) he make another one and see the id is 8558

he will understand that this shop made 5 orders within a month



anyway i found another way to do

set an date stamp to the admin setting as order start count,and i will change it every month so the id will be year.month.### (###=order id)

You’re going to run into trouble doing that. Rember that an order_id is an mediumint(8). Since it’s an unsigned type, the maximum value it can hold is 16777215.



Have fun.

yes i figure it out when i set a 10 digit id and found the problem



but what if i change the order_id to datestamp and set longint (length 10) via the phpmyadmin

will i have any problem? i test it i a test site and tell the results

My opinion is you are wasting your time. So I’m kinda done here. You can do whatever you think is right for your particular needs. However, I would not mess with sucha a fundamental part of the system. If you ever upgrade and an alter-table is done, you will lose your changes and the order_id’s will become duplicates and you’ll have a real mess on your hands.



Just my two cents. Like I said, have fun.

i thought it meight be easy. so i won’t change it. “ticket closed”

Yeah, just set your initial order ID at a number like 20763 and be done with it, odds are slim any of your customers truly have much time to put that much thought into calculating the difference between the order ID numbers of their last placed order.



I must say that it is quite alarming to place an order online & rcv an email confirmation stating that “Your Order #1 has been placed successfully!” Doesn’t tend to give you much of a warm fuzzy feeling… :wink:

sequential order IDs are part of standard taxation obligation in EU countries. I don’t advocate it’s removal.

Hey Jesse can you elaborate?



I have British clients and they generate orders from the store and from my backend. Their orders from the backend are definitely not sequential in themselves and have no relation to the orderID’s from the cart. I can’t see where this would be a requirement or even really desired. But I’m usually pretty ignorant of non-US stuff. We do rule the world you know (or at least we tend to think so)! :slight_smile:

[quote name=‘tbirnseth’]Hey Jesse can you elaborate?



I have British clients and they generate orders from the store and from my backend. Their orders from the backend are definitely not sequential in themselves and have no relation to the orderID’s from the cart. I can’t see where this would be a requirement or even really desired. [/quote]



The Brits are not part of the EU, therefore no issue.

http://en.wikipedia.org/wiki/Member_state_of_the_European_Union


http://ec.europa.eu/taxation_customs/taxation/vat/traders/invoicing_rules/article_1733_en.htm#item_1.4.1```php

1.4.1 Obligatory information for all invoices



An invoice must contain the following information:


  1. the date of issue;

    [COLOR=Red]2. a sequential number that uniquely identifies the invoice;[/COLOR]
  2. the supplier’s VAT identification number;
  3. the customer’s VAT identification number (only when the customer is liable to pay the tax on the supply);
  4. the supplier’s full name and address;
  5. the customer’s full name and address;
  6. a description of the quantity and nature of the goods supplied or services rendered;
  7. the date of the supply or payment (if different from the date of supply);
  8. the VAT rate applied;
  9. the VAT amount payable;
  10. a break-down of the VAT amount payable per VAT rate or exemption;
  11. the unit price of the goods or services exclusive of tax, discounts or rebates (unless included in the unit price); ```


[quote name=‘tbirnseth’]

But I’m usually pretty ignorant of non-US stuff. We do rule the world you know (or at least we tend to think so)! :smile:[/quote]It wouldn’t be the first time ignorance got in the way of things - I’m Australian so technically we ‘rule’ the south.

[QUOTE]It wouldn’t be the first time ignorance got in the way of things - I’m Australian so technically we ‘rule’ the south.[/QUOTE]



And the very realistic truth to all of our long time arrogance is that the Chinese have used that to their advantage for quite some time now, this is just another reason that I nominate Donald Trump for President of the United States of America! It is time we elect a president with some actual business savy! :cool:

Interesting… I wonder how people who run multiple brick-mortar and online stores manage to get things sequential and non overlapping… Even just sequential…

[quote name=‘tbirnseth’]Interesting… I wonder how people who run multiple brick-mortar and online stores manage to get things sequential and non overlapping… Even just sequential…[/quote]



CS-Cart = eCommerce

Accounting Software = Accounting.



Anything different and it’s suicide; but hey… it’s not like I’ve seen this issue before :wink:

And dont forget the brits USED to rule the world :lol:

[quote name=‘JesseLeeStringer’]sequential order IDs are part of standard taxation obligation in EU countries. I don’t advocate it’s removal.[/QUOTE]



i don’t think someone is using cs-cart invoice as a legal invoice. i don’t think this is possible. i use a cash register or a handwritten invoice and send to customers. cs-cart invoice is just for “order details”

[quote name=‘elk’]i don’t think someone is using cs-cart invoice as a legal invoice. i don’t think this is possible. i use a cash register or a handwritten invoice and send to customers. cs-cart invoice is just for “order details”[/quote]



Although a valid point, it’s not relevant to the decision to change the functionality. At the present moment order numbers just ‘count up’ - So given your same logic why is it important to have a random order ID?

yes but by using a date/time stamp it will also count up!

201102061550 (2011-02-06 at 15:50 hour)

201102062054 (2011-02-06 at 20:54 hour)

… and so on