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

Detailed Order Management Mod

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 03-14-2007, 04:59 AM
 
mesut mesut is offline
 

Member
  
Join Date: Feb 2007
Location: New York
Posts: 16
 

Default Detailed Order Management Mod

Hi guys,

We've just completed a mod which has abilty to see order details in orders.php

As you know, when you search all your orders on this page the information you get is actually limited. (Order#, Status, Customer name, date and total)

If you are dealing with many orders then you should be clicking every single order to get the whole information (i.e shipping address)

What we did is just to see other details without going order details of course using by java script. Even though if you go to order details you still need to copy address lines one by one. That takes a lot of time. So we did "copy to clipboard" and "copy to filed" sections as well.

Here is the screen shots of this mod.

http://www.protechstore.com/images/a1.jpg

http://www.protechstore.com/images/a2.jpg

http://www.protechstore.com/images/a3.jpg

If you'd like to get it let me know guys, i can post it here.
__________________
Version 4.1.6
Reply With Quote

The following 4 users thank mesut for this useful post:
am2003 (07-11-2010), chiactivate (01-12-2010), Dan.roh (09-15-2009), paryaei (09-15-2009)
  #2  
Old 03-14-2007, 05:45 AM
 
mesut mesut is offline
 

Member
  
Join Date: Feb 2007
Location: New York
Posts: 16
 

Default Re: Detailed Order Management Mod

your_xcart_dir/skin1/main/order_info.tpl

After:

Quote:
{include file="main/subheader.tpl" title=$lng.lbl_products_info}

Add:

Quote:
{* genbilim *}
<script language=javascript src="../skin1/main/copy_addr.js"></script>
{* genbilim-end *}

After:

Quote:
<td colspan="2"><i>{$lng.lbl_shipping_address}:</i></td>

Add:

Quote:
{* genbilim *}
{if $usertype eq "A"}
|
<a href="javascript:void(0)"
ship_to="{$order.s_title}{$order.s_firstname} {$order.s_lastname}"
ship_address="{$order.s_address}"
ship_city="{$order.s_city}"
ship_state="{$order.s_state}"
ship_country="{$order.s_country}"
ship_zipcode="{$order.s_zipcode}"
onclick="copyShipAddr(this, true);return false;">
<img src="{$ImagesDir}/copy.gif" border=0 align=absmiddle>Copy To Clipboard</a>
{/if}
</td>
</tr>

<tr valign="top">
<td width="31%">{if $customer.default_fields.s_firstname}&nbsp;&nbsp;{ $lng.lbl_first_name}{/if}</td>
<td width="13%">{if $customer.default_fields.s_firstname}{$customer.s_ firstname}{/if}</td>
<td width="55%" rowspan="10" align="center">
{* genbilim *}
{if $usertype eq "A"}

<a href="javascript:void(0)"
ship_to="{$order.s_title}{$order.s_firstname} {$order.s_lastname}"
ship_address="{$order.s_address}"
ship_city="{$order.s_city}"
ship_state="{$order.s_state}"
ship_country="{$order.s_country}"
ship_zipcode="{$order.s_zipcode}"
onclick="copyAddrToField(this);return false;">
<img src="{$ImagesDir}/copy.gif" border=0 align=absmiddle>Copy To Field</a>

<br>
<textarea cols=40 rows=6 id=ship_addr>
</textarea>
{/if}
{* genbilim-end *}


your_xcart_dir/skin1/main/orders_list.tpl

After:

Quote:
{assign var="total_paid" value=0.00}

Add:

Quote:
{*
genbilim :
Javascript functions to copy the address to the clipboard
*}

<script language=javascript src="../skin1/main/copy_addr.js"></script>
<div id="DIV_CopyInform" style="display:none;"></div>
{* genbilim-end *}

Before:

Quote:
{section name=oid loop=$orders}

Add:

Quote:
{* genbilim
New column for admins to copy the address to the clipboard *}
{if $usertype eq 'A'}
<td align=center width=50>Copy&nbsp;Address</td>
{/if}
{* genbilim-end *}

After:

Quote:
<a href="order.php?orderid={$orders[oid].orderid}">{include file="currency.tpl" value=$orders[oid].total}</a>
</td>

Add:

Quote:
{* genbilim *}
{if $usertype eq 'A'}
<td align=center ><a href="javascript:void(0)"
ship_to="{$orders[oid].s_title}{$orders[oid].s_firstname} {$orders[oid].s_lastname}"
ship_address="{$orders[oid].s_address}"
ship_city="{$orders[oid].s_city}"
ship_state="{$orders[oid].s_state}"
ship_country="{$orders[oid].s_country}"
ship_zipcode="{$orders[oid].s_zipcode}"
onclick="copyShipAddr(this, false);return false;">
<img src="{$ImagesDir}/copy.gif" border=0 align=absmiddle></a></td>
{/if}
</TR>
<tr>
<td colspan=3></td>
<td colspan=4>
<table width=100% cellpadding=5 style="border-collapse:collapse" border=0>
<tr bgcolor=#DDDDCC>
<td>Product</td>
<td>Code</td>
<td align=center>Amount</td>
<td align=center>Stock</td>
</tr>
{foreach item=item from=$orders[oid].item_list}
<tr bgcolor=#CCCCDD>
<td>{$item.product}</td>
<td>{$item.productcode}</td>
<td align=center>{$item.amount}</td>
<td align=center>{$item.avail}</td>
</tr>
{/foreach}
</table>
</td>
</tr>
<TR>
<TD style="padding-top:3px;border-bottom:1px solid black" colspan=12>&nbsp;</TD>
</TR>
<TR>
<TD style="padding-top:3px;" colspan=12>&nbsp;</TD>
{* genbilim-end *}

your_xcart_dir/skin1/main directory

Create copy_addr.js file

Add:

Quote:
var attributes = ['to', 'address', 'city', 'state', 'country', 'zipcode'];
var addrFormat =
"{to}\r\n" +
"{address}\r\n" +
"{city} {state}, {zipcode}";
function findPos(obj)
{
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
function removeInformation()
{
var div = document.getElementById('DIV_CopyInform');
if (! div)
return;
div.style.display = 'none';
div.innerHTML = '';
}

function getAddr(aObj)
{
var str = addrFormat;
for(var i=0; i<attributes.length; i++)
{
var na = 'ship_' + attributes[i];
var val= aObj.getAttribute(na);
if (typeof val != "undefined")
str = str.replace('{' + attributes[i] + '}', aObj.getAttribute(na));
}

return str;
}

function copyAddrToField(aObj)
{
document.getElementById('ship_addr').value = getAddr(aObj);
document.getElementById('ship_addr').focus();
document.getElementById('ship_addr').select();
}

function copyShipAddr(aObj, quickCopy)
{

var str = getAddr(aObj);

if (str.length > 0 )
{
if (! document.getElementById('DIV_CopyInform') )
document.getElementsByTagName('DIV')[0].innerHTML += '<div id="DIV_CopyInform" style="display:none;"></div>';
var div = document.getElementById('DIV_CopyInform');
div.style.position = 'absolute';
div.innerHTML = '';
div.style.left = (findPos(aObj)[0] + aObj.offsetWidth) + 'px';
div.style.top = findPos(aObj)[1] + 'px';
try
{
if (! quickCopy)
// make it throw an exception
genbilim.style = 'dummy';
window.clipboardData.setData("Text", str);

// Inform the user
div.style.width = '75px';

div.style.backgroundColor = 'pink';
div.style.padding = '3px';
div.style.color = 'black';
div.style.border= '1px solid black';
div.innerHTML = 'Copied';
div.style.display = 'inline';

setTimeout('removeInformation()', 1000);
}
catch(e)
{
div.style.left = (findPos(aObj)[0] + aObj.offsetWidth - 300 - 10 ) + 'px';
div.style.top = (findPos(aObj)[1] + aObj.offsetHeight) + 'px';
div.style.backgroundColor = '#DDDDCC';
div.style.padding = '5px';
div.style.color = 'black';
div.style.border= '1px solid black';
div.style.display = 'inline';
div.innerHTML =
'<table width=300 >' +
'<tr><td align=right><a href="javascript:void(0)" onclick="removeInformation()">Close</a></td></tr>' +
'<tr><td>You can copy (Ctrl+C) the adress manually</td></tr> '+
'<tr><td><textarea id=addr_ta rows=6 cols=50 >' + str + '</textarea></td></tr>';
document.getElementById('addr_ta').focus();
document.getElementById('addr_ta').select();
}
}
}

your_xcart_dir/include/orders.php

After:

Quote:
$orders = func_query("SELECT $sql_tbl[orders].* $search_condition ORDER BY $sort_string LIMIT $first_page, $objects_per_page");

Add:

Quote:
# genbilim
#
# Get the details of each order
#
require_once($xcart_dir. "/include/orders_genbilim.php");
#
# genbilim-end

In your_xcart_dir/include/

create orders_genbilim.php file

Add:

Quote:
<?php
for($i=0; $i<count($orders); $i++)
{
$items = func_query("SELECT od.productid, od.amount, od.productcode,p.product, p.avail
FROM xcart_order_details od
LEFT OUTER JOIN xcart_products p ON p.productid = od.productid
WHERE od.orderid = " . $orders[$i]['orderid']);
$orders[$i]['item_list'] = $items;
}
?>

That's All.
__________________
Version 4.1.6
Reply With Quote

The following user thanks mesut for this useful post:
Dan.roh (09-15-2009)
  #3  
Old 03-14-2007, 08:17 AM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default Re: Detailed Order Management Mod

Thanks for this great looking and usefull mod!
Do you know if it works with version 4.0.x?
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
  #4  
Old 03-14-2007, 09:26 AM
 
mesut mesut is offline
 

Member
  
Join Date: Feb 2007
Location: New York
Posts: 16
 

Default Re: Detailed Order Management Mod

I've not tasted with 4.0.x yet. I'll be looking at it soon.
__________________
Version 4.1.6
Reply With Quote
  #5  
Old 03-14-2007, 01:18 PM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default Re: Detailed Order Management Mod

Thanks, looking forward to it.
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
  #6  
Old 03-15-2007, 12:37 PM
 
herseyc herseyc is offline
 

Member
  
Join Date: Jun 2006
Location: Suffolk, VA
Posts: 28
 

Default Re: Detailed Order Management Mod

Great mod! Thanks alot!

Take Care - Ride FREE
__________________
Hersey
http://www.chopperstickers.com/
X-Cart 4.1.3
Linux
Reply With Quote
  #7  
Old 03-27-2007, 06:50 AM
 
freelancer_gd freelancer_gd is offline
 

Newbie
  
Join Date: Jan 2007
Posts: 7
 

Default Re: Detailed Order Management Mod

hello !
i'am just trying to implement your mod , but i receive this mess.


Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/djloco/public_html/shop_beta/include/orders_genbilim.php on line 2

Parse error: syntax error, unexpected T_STRING in /home/djloco/public_html/shop_beta/include/orders_genbilim.php on line 2

any idea ?
thnx in advance.
__________________
Xcart 4.1.6 / Gold Edition /Flexy/Xaom/Xcomp/Xrma/
Reply With Quote
  #8  
Old 03-27-2007, 08:01 AM
 
mesut mesut is offline
 

Member
  
Join Date: Feb 2007
Location: New York
Posts: 16
 

Default Re: Detailed Order Management Mod

The first think i would think of is to check the location of orders_genbilim.php file. It has to be on your_xcart_dir/include/

and secondly have you created the orders_genbilim.php file?

I've tried it for 4.1.x versions and there was not any problem.

Here is the orders_genbilim.php file again

Quote:
<?php
for($i=0; $i<count($orders); $i++)
{
$items = func_query("SELECT od.productid, od.amount, od.productcode,p.product, p.avail
FROM xcart_order_details od
LEFT OUTER JOIN xcart_products p ON p.productid = od.productid
WHERE od.orderid = " . $orders[$i]['orderid']);
$orders[$i]['item_list'] = $items;
}
?>
__________________
Version 4.1.6
Reply With Quote
  #9  
Old 03-27-2007, 08:15 AM
 
freelancer_gd freelancer_gd is offline
 

Newbie
  
Join Date: Jan 2007
Posts: 7
 

Default Re: Detailed Order Management Mod

found my error !!!
i working with (bullshitwindows xp original !) and when editing your file (crt+c / crt+v)
with wordpad , it generate a wrong code !!! :c(

your mod work perfectly ...
Thanx to bill gate , i have lose 2 hours of time !
__________________
Xcart 4.1.6 / Gold Edition /Flexy/Xaom/Xcomp/Xrma/
Reply With Quote
  #10  
Old 03-27-2007, 08:22 AM
 
mesut mesut is offline
 

Member
  
Join Date: Feb 2007
Location: New York
Posts: 16
 

Default Re: Detailed Order Management Mod

I'm glad to hear that.
__________________
Version 4.1.6
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 10:36 PM.

   

 
X-Cart forums © 2001-2020