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)
-   -   Enter tracking number on order list page mod (https://forum.x-cart.com/showthread.php?t=20686)

willirl 03-23-2006 07:11 AM

Enter tracking number on order list page mod
 
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;
  }
}


cotc2001 03-29-2006 04:10 AM

Excellent, so much quicker now when i have to input the tracking numbers

I can confirm it works on 4.0.5

bestdata 03-29-2006 06:20 AM

tracking
 
hi. thanks for the mod. doe this work on x-cart version 4.0.18

thanks
x-cart version 4.0.18 Linux

willirl 03-30-2006 05:33 AM

I would think so. Make your backup file copies and you can back out the change very easily.

ShishaPipeUK 03-31-2006 01:14 PM

Yes it works on 4.0.18.

Audiolines 04-04-2006 10:19 AM

we are having trouble with this mod. it seems as if the tracking numbers are being stored with the wrong customer.

i am fairly new to xcart and am not sure how to add a label as you stated i may need to do.

any help would be greatly appreciated.

thanks

eric

Audiolines 05-02-2006 07:57 AM

it seems as though after i have added this mod, i cannot update order status from the order list page now. i am now trying to revert back to the original code, but i get the same problem.

any help?

{* $Id: orders_list.tpl,v 1.7.2.3 2005/09/30 07:21:25 svowl Exp $ *}

{assign var="total" value=0.00}
{assign var="total_paid" value=0.00}

{if $orders ne ""}

{capture name=dialog}

<DIV align="right">{include file="buttons/button.tpl" button_title=$lng.lbl_search_again href="orders.php"}</DIV>

{include file="customer/main/navigation.tpl"}

<SCRIPT type="text/javascript" language="JavaScript 1.2">
<!--
checkboxes_form = 'processorderform';
checkboxes = new Array({foreach from=$orders item=v key=k}{if $k > 0},{/if}'orderids[{$v.orderid}]'{/foreach});

-->
</SCRIPT>
{include file="change_all_checkboxes.tpl"}

<DIV style="line-height:170%">{$lng.lbl_check_all} / {$lng.lbl_uncheck_all}</DIV>

<TABLE border="0" cellpadding="2" cellspacing="1" width="100%">

<FORM action="process_order.php" method="POST" name="processorderform">

<INPUT type="hidden" name="mode" value="">

{assign var="colspan" value=6}

<TR class="TableHead">
<TD width="5"></TD>
<TD width="5%" nowrap>{if $search_prefilled.sort_field eq "orderid"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}#</TD>
<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>



<TD width="30%" nowrap>{if $search_prefilled.sort_field eq "customer"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}{$lng.lbl_customer}</TD>
{if $usertype eq "A" and $single_mode eq ""}
{assign var="colspan" value=7}
<TD width="20%" nowrap>{if $search_prefilled.sort_field eq "provider"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}{$lng.lbl_provider}</TD>
{/if}
<TD width="20%" nowrap>{if $search_prefilled.sort_field eq "date"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}{$lng.lbl_date}</TD>
<TD width="20%" align="right" nowrap>{if $search_prefilled.sort_field eq "total"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}{$lng.lbl_total}</TD>
</TR>

{section name=oid loop=$orders}

{math equation="x + ordertotal" x=$total ordertotal=$orders[oid].total assign="total"}
{if $orders[oid].status eq "P" or $orders[oid].status eq "C"}
{math equation="x + ordertotal" x=$total_paid ordertotal=$orders[oid].total assign="total_paid"}
{/if}

<TR{cycle values=", class='TableSubHead'"}>
<TD width="5"><INPUT type="checkbox" name="orderids[{$orders[oid].orderid}]"></TD>
<TD>#{$orders[oid].orderid}</TD>
<TD nowrap>
{if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Module ne "")}
<INPUT type="hidden" name="order_status_old[{$orders[oid].orderid}]" value="{$orders[oid].status}">
{include file="main/order_status.tpl" status=$orders[oid].status mode="select" name="order_status[`$orders[oid].orderid`]"}
{else}
{include file="main/order_status.tpl" status=$orders[oid].status mode="static"}
{/if}



{if $active_modules.Stop_List ne '' && $orders[oid].blocked eq 'Y'}
[img]{$ImagesDir}/no_ip.gif[/img]
{/if}
</TD>
<TD>{$orders[oid].firstname} {$orders[oid].lastname} ({$orders[oid].login})</TD>
{if $usertype eq "A" and $single_mode eq ""}
<TD>
{$orders[oid].provider}
</TD>
{/if}
<TD nowrap>{$orders[oid].date|date_format:$config.Appearance.date_format}</TD>
<TD nowrap align="right">
{include file="currency.tpl" value=$orders[oid].total}
</TD>
</TR>

{/section}

<TR>
<TD colspan="{$colspan}">[img]{$ImagesDir}/spacer.gif[/img]</TD>
</TR>

<TR>
<TD colspan="{$colspan}" align="right">{$lng.lbl_gross_total}: {include file="currency.tpl" value=$total}</TD>
</TR>

<TR>
<TD colspan="{$colspan}" align="right">{$lng.lbl_total_paid}: {include file="currency.tpl" value=$total_paid}</TD>
</TR>

<TR>
<TD colspan="{$colspan}">


{include file="customer/main/navigation.tpl"}

{if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode)}
<INPUT type="button" value="{$lng.lbl_update_status}" onclick="document.processorderform.mode.value='upd ate';document.processorderform.submit();">




{/if}

<INPUT type="button" value="{$lng.lbl_invoices_for_selected}" onclick="document.processorderform.mode.value='inv oice';document.processorderform.target='invoices'; document.processorderform.submit();document.proces sorderform.target='';">

{if $usertype ne "C"}
<INPUT type="button" value="{$lng.lbl_labels_for_selected}" onclick="document.processorderform.mode.value='lab el';;document.processorderform.target='labels';doc ument.processorderform.submit();document.processor derform.target='';">

{/if}
{if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode)}
<INPUT type="button" value="{$lng.lbl_delete_selected}" onclick="if(confirm('{$lng.txt_delete_selected_ord ers_warning|strip_tags}')){ldelim}document.process orderform.mode.value='delete'; document.processorderform.submit();{rdelim}">

{/if}

{if $usertype ne "C"}




<TABLE border="0" cellpadding="2" cellspacing="1">
<TR>
<TD class="FormButton" nowrap>{$lng.lbl_export_file_format}:</TD>
<TD width="10"></TD>
<TD>
<SELECT name="export_fmt">
<OPTION value="csv_tab"{if $search_prefilled.export_fmt eq "csv_tab"} selected{/if}>CSV {$lng.lbl_with_tab_delimiter}</OPTION>
<OPTION value="csv_semi"{if $search_prefilled.export_fmt eq "csv_semi"} selected{/if}>CSV {$lng.lbl_with_semicolon_delimiter}</OPTION>
<OPTION value="csv_comma"{if $search_prefilled.export_fmt eq "csv_comma"} selected{/if}>CSV {$lng.lbl_with_comma_delimiter}</OPTION>
{if $active_modules.QuickBooks eq "Y"}
{include file="modules/QuickBooks/orders.tpl"}
{/if}
</SELECT>
<INPUT type="button" value="{$lng.lbl_export_selected}" onclick="document.processorderform.mode.value='exp ort';document.processorderform.submit();">
</TD>
</TR>
</TABLE>



{$lng.txt_export_all_found_orders_text}



<INPUT type="button" value="{$lng.lbl_export_all_found}" onclick="document.processorderform.mode.value='exp ort_found';document.processorderform.submit();">
{/if}
</TD>
</TR>

</FORM>

</TABLE>

{/capture}
{include file="dialog.tpl" title=$lng.lbl_search_results content=$smarty.capture.dialog extra="width=100%"}
{/if}

cotc2001 05-02-2006 08:50 AM

Have you edited those two templates before or are they the same as the default installation templates???

If you havent changed them before why not just copy over them with the ones in the distro? and see what happens (backup your existing ones first of course)

Audiolines 05-03-2006 12:39 PM

i replaced them with the original distro versions, still the same thing, order status doesnt update from order list page

cotc2001 05-03-2006 12:42 PM

Ok you must of changed something else as well, as the above mod only changes those two files and nothing else.

I'd open a support ticket with x-cart to take a look

willirl 05-04-2006 06:31 AM

To add a label, in the administrator, go to "Languages", choose your language, select "Labels" then down toward the bottom add the label name and text for the label then update.

eaglemobiles 05-12-2006 04:37 PM

Excellent, Thanks for sharing. Work well with 4..0.11

taltos1 05-31-2006 01:18 PM

Just got this working sweetly on my site 4.0.18. Thanks so much for this!

upgrade 05-31-2006 05:04 PM

Almost there ***Solved***
 
I have followed the changes closely and unfortunately it is refusing to update the shipping reference in the order list.

I am not sure as to why it isn't working, becuase I only edited the two files as specified.

Here is my code from the xcart_dir/include/process_orders.php file

Code:

if ($mode == "update") {
       
        #
        # Update orders info (status)
        #
       
        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;
  }
}
                $flag = 0;
               
                if (is_array($order_status) && is_array($order_status_old)) {
                        foreach($order_status as $orderid=>$status) {
                                if (is_numeric($orderid) && $status != $order_status_old[$orderid])
                                        func_change_order_status($orderid, $status);
                                        $flag = 1;
                        }
        }
                if ($flag)
                        $top_message["content"] = func_get_langvar_by_name("msg_adm_orders_upd");
                func_header_location("orders.php?mode=search");

        } # /if ($mode == "update")

elseif ($mode == "delete" || $mode == "delete_all") {


This is the code from the orders_list.tpl file

Code:

<td {include file="main/order_colours.tpl"} nowrap>
<input type="text" name="tracking_number[{$orders[oid].orderid}]" value="{$orders[oid].tracking}" {if $usertype eq 'C'}readonly{/if}>
</td>


Any help would be greatly appreciated.

Edit: I have solved this problem, it seems my webhost has a seperate files section for the secure and unsecure sections of the website. The system works fine in the unsecure side, I just have to update the files on the secure side and it will work everywhere.

aslater 07-08-2006 07:21 AM

I have just installed on our site and have 1 problem, all looks fine from the customer side but the table is out of line in the admin as shown in the screenshots below.

Customer:
http://www.bitzdirect.com/store/customer.jpg

Admin:
http://www.bitzdirect.com/store/admin.jpg

For some reason it will not show the tracking column so all information has moved to the left from other columns with a blank white space under total.

Any ideas.

Thanks

robf 07-08-2006 01:33 PM

Just applied this mod to 4.1.2 and it works perfect, thanks! =D>

stevep 09-19-2006 08:11 AM

Re: Enter tracking number on order list page mod
 
Works a treat 4.014 cheers.

MichelleT 01-30-2007 07:00 PM

Re: Enter tracking number on order list page mod
 
Working perfectly with 4.0.19. Thank you!

Shopkeeper09 02-19-2007 12:31 PM

Re: Enter tracking number on order list page mod
 
Richard thank you very much for contributing this very useful mod. The one problem I am having with it is that it is also showing in the customer / members area. Do you know what I can do to remove from customer view?

Shopkeeper09 02-19-2007 01:03 PM

Re: Enter tracking number on order list page mod
 
Balinor was kind enough to provide the following answer for me:

{if $usertype ne "C"}

display code

{/if}

Display Code = code you want kept from customer view.

shopccp 06-08-2007 06:36 PM

Re: Enter tracking number on order list page mod
 
Excellent Mod. A must have for xcart.

vtonya 06-11-2007 10:53 AM

Re: Enter tracking number on order list page mod
 
Thank you, works great in 4.1.7

zman9696 06-25-2008 11:33 AM

Re: Enter tracking number on order list page mod
 
Tried the mod and it works great...the only thing that doesn't seem to work is that if an order has already been processed (payment by paypal), i then go and enter the tracking # and update the page, the customer isn't emailed with the tracking #. BUT if i enter the tracking #, then fail the order, then process it again, they get an email with the tracking #

Any ideas?

rogue 06-26-2008 06:39 AM

Re: Enter tracking number on order list page mod
 
A customer email is only sent when status changes to certain values. What we do is set the tracking number then set the status to "complete" then update. That sends an email to cust.

MrBungle 07-15-2008 08:16 PM

Re: Enter tracking number on order list page mod
 
Not working on 4.1.9. It's there, but I'm unable to enter tracking numbers and it won't allow the cursor to go in the box to type in a number.

homeworldz 07-16-2008 02:46 AM

Re: Enter tracking number on order list page mod
 
Quote:

Originally Posted by rogue
A customer email is only sent when status changes to certain values. What we do is set the tracking number then set the status to "complete" then update. That sends an email to cust.


When you set it to complete does it automatically set the products to shipped?

I also normally put a note of the postage day in the notes box, but that means opening up the order details.. which this mods trys to get around..

is it possible to have a pop up box I can use that will write the info into the notes box? The box I use is admin notes so the customer can not see it.


All times are GMT -8. The time now is 11:54 PM.

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