Pages:

Using the date as the order ID?

velocityhead

No avatar

2006-10-31 00:24

Does anyone have an idea of how to use the current date/time as the Order ID number instead of 1, 2, 3, 4, 5....etc? I am using Quick Cart version 1.4.

There was a previous thread on it here: http://opensolution.org/Quick.Cart/forum/?p=readTopic&nr=932&page=999
but the instructions were for an earlier version of QC, so the template files were different.

Any ideas?

treewood (OpenSolution)

Avatar: treewood

2006-10-31 15:23

velocityhead - in db/orders_ext.php You have time/date saved ... why You need id like a date? time from db/orders_ext.php is not enought?

velocityhead

No avatar

2006-11-01 23:26

I do not want the customers to see their order number as a small number, like "Order ID 24". If they see that, they figure out that they are the 24th customer. If I was buying from a website, I would be uncomfortable knowing that I am one of the first customers.

I would feel better seeing something like "Order ID 200611011726"

idaryl

Avatar: idaryl

2006-11-03 00:45

Did you get anywhere with this? Iwant to use the ID as a ticketing sequence and the numbers are auto generated as the items are bought/purchased

Jo

No avatar

2006-11-03 20:36

I have just added a 10 in front of $aData[iOrder] in all files where the customer will see order ID (e.g. templates/orders_print.tpl) so if order ID is 34 it will display 1034.

Like so:

$lang[Order_id] $aData[iOrder]

changed to this -

$lang[Order_id] 10$aData[iOrder]

velocityhead

No avatar

2006-11-04 05:46

No I haven't gotten anywhere.....although Jo's suggestion is a workable solution for my problem. An order number of 1034 is much more attractive than plain old 34.

I suppose another option could be to edit the database file so that the first entry starts with order number 1000, and climbs from there.

idaryl

Avatar: idaryl

2006-11-10 22:11

Thank you Jo - I used your solution and added a sequence of letters before - $aData[iOrder] - it works fine

However, there is one other pesky problem - the admin area - the order id remains the same, even if you have those nice sequence setups in the print template, the admin area still sees it is a regular orderID#?

The bigger deal is; if you are using the PayPal addin script posted here, it uses the admin id to post into paypal as the order ID number - kinda defeats the purpose if you are trying to use accounting packages with this (they sometimes require the ids and use them to parse info)

Anyway, how to get the admin area to display the same secuencing as the print template? Is there an "$aData[iOrder]" somewhere in the Admin that I've missed?

This question is for anyone who might have an idea.......

idaryl

Avatar: idaryl

2006-11-12 11:44

Treewood, could you shed some light on this?

KiralyVlad

No avatar

2006-11-12 11:58

Look in templates/admin/orders_list.tpl at line 52...

<php><!-- BEGIN LIST_LIST -->
<tr class="listbody_$aList[iStyle]">
<td>
$aList[iOrder]
</td></php>
There it is...

qwertyytrewq

No avatar

2006-11-12 14:00

?? What is there .. KiralyVlad explain, please.

KiralyVlad

No avatar

2006-11-12 14:43

Well....
As idaryl said: "Anyway, how to get the admin area to display the same secuencing as the print template? Is there an "$aData[iOrder]" somewhere in the Admin that I've missed?"

Just look at line 52 in the file templates/admin/orders_list.tpl, you will find the "$aList[iOrder]"
as so:

<!-- BEGIN LIST_LIST -->
<tr class="listbody_$aList[iStyle]">
<td>
$aList[iOrder]
</td>

And you will have to modify this the same way you did with the templates/orders_print.tpl. As of what I can see, Jo added a 10 in front of the actual order ID. Here is his post above:
"I have just added a 10 in front of $aData[iOrder] in all files where the customer will see order ID (e.g. templates/orders_print.tpl) so if order ID is 34 it will display 1034.

Like so:

$lang[Order_id] $aData[iOrder]

changed to this -

$lang[Order_id] 10$aData[iOrder]"

So you will change also adda 10 behind the $aList[iOrder] and that will become:
<!-- BEGIN LIST_LIST -->
<tr class="listbody_$aList[iStyle]">
<td>
10$aList[iOrder]
</td>
Save the file, and you will see the same order ID as the customer sees when they print they're order... you can add anything you wish... I added "B5020" for my shop... so the orders would be "B502001" "B502002" "B502003" and so on....

qwertyytrewq

No avatar

2006-11-12 16:20

I got it KiralyVlad .. thanx m8

velocityhead

No avatar

2006-11-14 00:23

I think I came up with a better solution.

Leave the $lang[Order_id] $aData[iOrder] section alone, instead change the database:

(db/orders.php)

In there, you will see some info about all of the orders that have been made.
They will look like:

1$1162045041101$0$

The number before the first $ is the order number.

The first order in the list is the one we need to be concerned with:

<?php exit; ?>{/php}
11$1162589789811$0$
10$1162416242823$0$
9$1162263589532$0$
8$1162247618809$0$

In this case, it is this line:

11$1162589789811$0$

If you want your order numbers to start from 1000, at this point change that line:

From this: 11$1162589789811$0$

To this: 1000$1162589789811$0$

From that point, your next order number will be Order ID 1001, then ID 1002, then 1003...etc.

The benefit of doing it here instead of changing $lang[Order_id] $aData[iO

rder] is that as the number of orders grow from 1 digit to 2 digits to 3 digits, your order numbers will look like:

Order ID 1006
Order ID 1042
Order ID 1583

If you do it by changing $lang[Order_id] $aData[iOrder], your order numbers will look like:

Order ID 106
Order ID 1042
Order ID 10583

Much cleaner to change the orders.php file instead of $lang[Order_id] $aData[iOrder].

Let me know what you think.

andremk

No avatar

2006-11-15 01:10

Absolutely excellent suggestion!
Iv'e just started playing around and customizing QuickCart and I wanted the numbers on the orders to be like the ones where i work (10001, 10002 and so on) And when i googled I ended up here.. The funny thing is that the question was just recently answeared!

thanks mate!

André M. Karlsen

idaryl

Avatar: idaryl

2006-11-15 03:16

Velocityhead.....! that worked great! just for fun and giggles I added Jo's $aList[iOrder] trick as well, so now I have this nifty sequence RR001001 - uses both, and... in the admin... I can find the item by the id number of 1001, makes it easy to track, and gives the customer a nice order number..

kudos..........

velocityhead

No avatar

2006-11-16 00:00

You're very welcome :)

KiralyVlad

No avatar

2006-11-16 09:50

Good job.

boffa

No avatar

2006-11-16 12:36

Hi

There is a simple way of using the date in the order ID.

index.php
Add the below line under include DIR_CORE.'other.php'; at row 43
$datetimemark = date('Ymd');

templates/dafault
Add the following varibale before iOrder in orders_saved.tpl and orders_print.tpl
$datetimemark

templates/admin
Add the same variable as above before iOrder in orders_show.tpl and orders_print.tpl

Done

Boffa

justplumducky

No avatar

2006-11-18 04:25

Boffa,

I'm not a programmer. Is "templates/default" supposed to mean there is a "default" folder in the templates folder? I don't see it, nor do I see a file in the templates folder, called orders_saved.tpl. You talking about v.1.4 Loaded?

Thx.

JustPlumDucky

Jo

No avatar

2006-11-18 20:51

I think Boffa is using an older version, 1.2 maybe.

Pages:
Back to top
about us | contact