Welcome, Guest. Please login or register.
Login with username, password and session length


It's a release candidate! VirtueMart 2.0 RC - the next generation VirtueMart - is available! Read more....

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
Pages: 1 2 [3]   Go Down
Print
Author Topic: how to - change order_id  (Read 34534 times)
komi
Newbie
*
Posts: 21


« Reply #30 on: January 06, 2008, 23:07:36 PM »

Here's a PHP version that works fine for me. Date looks like "2007123001" (where 123 is the day of the year)

Code:
#!/usr/local/bin/php
<?php

$dbh
=mysql_connect ("localhost""..............""..............") or die (mysql_error());
mysql_select_db ("..............");

$new_orderid strftime("%Y%j001"time());

$qry 'ALTER TABLE jos_vm_orders AUTO_INCREMENT='.$new_orderid;
$res mysql_query($qry) or die (mysql_error());

mysql_close($dbh);

?>




I didnt understand how to use this one. Can you explain?
Logged
Techno-Tronics
Newbie
*
Posts: 39


« Reply #31 on: February 29, 2008, 13:36:22 PM »

Here's a PHP version that works fine for me. Date looks like "2007123001" (where 123 is the day of the year)

Code:
#!/usr/local/bin/php
<?php

$dbh
=mysql_connect ("localhost""..............""..............") or die (mysql_error());
mysql_select_db ("..............");

$new_orderid strftime("%Y%j001"time());

$qry 'ALTER TABLE jos_vm_orders AUTO_INCREMENT='.$new_orderid;
$res mysql_query($qry) or die (mysql_error());

mysql_close($dbh);

?>


This is a real neat solution, but I need some help in getting the format of the order_id the way I like it. What I want is that the order_id would be someting like YearMonthDay0001.

I tried to change %j to %M%D, but that's not working right. So if someone coulod give me the right solution I'd be really happy...

Thnx in advance...
Logged
Techno-Tronics
Newbie
*
Posts: 39


« Reply #32 on: February 29, 2008, 15:47:16 PM »

Nevermind, I got it working right now with %Y%m0001, so every month it starts again @ 0001.
Logged
JonathanLIVE
Newbie
*
Posts: 6


« Reply #33 on: March 19, 2008, 13:08:15 PM »

Is there ANY chance of having the auto generated random numbers working again? Can someone update it for current versions?
Logged
Techno-Tronics
Newbie
*
Posts: 39


« Reply #34 on: January 03, 2009, 15:01:23 PM »

I don't know if it's appropriate to post in this thread, but I'm encountering a problem over here...

As soon as I want to get the order_id started something like %Y0000001, which should mean that I can sell a millions of products in a year, the whole ordering system get's screwed up and I'm getting blank screens at the end of my order and nothing is getting ordered.

When I change the order_id to %Y000001, which means I can sell maximum of 999999 products in a year the whole thing works real neat...

Anyone a clue?
Logged
rgillesen
Newbie
*
Posts: 6



« Reply #35 on: November 10, 2009, 16:58:49 PM »

Hi,

I ran into the same issues and wrote a patch that allows you to add a prefix to the order ID. It takes a max. of 5 characters like 'web_' or 'vmart'.
The prefix can be added in the 'admin / configuration' section of the store administration. It stores the prefix for every order. If you change the prefix, it will not change the prefix of the existing orders.

Current version shows it on the admin orderlist, the order details on the frontend and in the email sent to the customer.

It can be downloaded from the download section on http://www.gillesen.nl
Current version is 1.2 and is for VM 1.1.4 only.

Please send me any problems or feature requests.
Logged
Pages: 1 2 [3]   Go Up
Print
Jump to: