Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Enter tracking number on order list page mod

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 03-23-2006, 07:11 AM
 
willirl willirl is offline
 

eXpert
  
Join Date: Mar 2004
Location: OHIO
Posts: 271
 

Default 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; } }
__________________
Richard

x-cart version 4.0.17
http://roguewavemarine.com
Reply With Quote
  #2  
Old 03-29-2006, 04:10 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

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

I can confirm it works on 4.0.5
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #3  
Old 03-29-2006, 06:20 AM
 
bestdata bestdata is offline
 

Member
  
Join Date: Oct 2004
Posts: 14
 

Default tracking

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

thanks
x-cart version 4.0.18 Linux
__________________
Online stores . Bestdata.com / Diamondmm.com
X-cart Gold 4.0.13 & 4.0.18 & 4.1
UNIX/LINUX
Reply With Quote
  #4  
Old 03-30-2006, 05:33 AM
 
willirl willirl is offline
 

eXpert
  
Join Date: Mar 2004
Location: OHIO
Posts: 271
 

Default

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

x-cart version 4.0.17
http://roguewavemarine.com
Reply With Quote
  #5  
Old 03-31-2006, 01:14 PM
  ShishaPipeUK's Avatar 
ShishaPipeUK ShishaPipeUK is offline
 

Senior Member
  
Join Date: Jul 2005
Location: London, England.
Posts: 118
 

Default

Yes it works on 4.0.18.
__________________
Apache/2.0.55 (Red Hat) & MYSQL Server: 5.0.24
PERL: 5.008005 / PHP: 4.4.4 - 4.3.1 X-CART

Shop carts at
http://www.nightscene.co.uk/shop/home.php
http://www.theshisha.net/shopcart/home.php
http://www.system-maintenance.com/maint/home.php
http://www.tabac4u.com
Reply With Quote
  #6  
Old 04-04-2006, 10:19 AM
 
Audiolines Audiolines is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 102
 

Default

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
__________________
version 4.0.17
Reply With Quote
  #7  
Old 05-02-2006, 07:57 AM
 
Audiolines Audiolines is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 102
 

Default

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}
__________________
version 4.0.17
Reply With Quote
  #8  
Old 05-02-2006, 08:50 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

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)
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #9  
Old 05-03-2006, 12:39 PM
 
Audiolines Audiolines is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 102
 

Default

i replaced them with the original distro versions, still the same thing, order status doesnt update from order list page
__________________
version 4.0.17
Reply With Quote
  #10  
Old 05-03-2006, 12:42 PM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

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
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:57 AM.

   

 
X-Cart forums © 2001-2020