Here is a small mod that made my life easier. It allows you to enter the tracking number right on the order list page instead of having to go to each order to enter the number. This is working in a 4.0.17 x-cart and has worked since 4.0.8. It will probably work in any 4.0.x version and MAY work in 3.x
YOU SHOULD ALWAYS MAKE A BACKUP BEFORE CHANGING AND ADD COMMENTS TO ANY CHANGES SO THAT YOU CAN FIND THEM LATER.
I always make a copy of the original file with the same name and the date as yymmdd as a suffix.
This mod uses a label called lbl_tracking_number which is set to "Tracking number". I'm not sure if this comes with x-cart or if I added it. So if you don't see it, you need to add it.
Make a backup copy of and edit the file skin1/main/orders_list.tpl
Find this line
Code:
{assign var="colspan" value=6}
And change to
Code:
{assign var="colspan" value=7}
Find this line
Code:
<TD nowrap>{if $search_prefilled.sort_field eq "status"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}
{$lng.lbl_status}</TD>
And add this line just after it
Code:
<td class="ProductTitle" width="10%" nowrap>{$lng.lbl_tracking_number|upper}</td>
Find this line
Code:
{assign var="colspan" value=7}
And change it to
Code:
{assign var="colspan" value=8}
Find these lines
And add these lines after
Code:
<td nowrap>
<input type="text" name="tracking_number[{$orders[oid].orderid}]" value="{$orders[oid].tracking}"
{if $usertype eq 'C'}readonly{/if}>
</td>
Now make a copy of and edit the file include/process_order.php
Find this line
Code:
if ($mode == "update") {
And add this code after it
Code:
if (is_array($tracking_number)) {
foreach($tracking_number as $orderid=>$tracking) {
if (is_numeric($orderid))
db_query("update $sql_tbl[orders] set tracking='$tracking'
where orderid='$orderid'");
$flag = 1;
}
}