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

Show Order Details For (4.4.4) / Detail order management
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 11-17-2011, 03:36 PM
 
chiactivate chiactivate is offline
 

Senior Member
  
Join Date: Feb 2007
Location: Canada
Posts: 148
 

Smile Show Order Details For (4.4.4) / Detail order management

I love this this mod. Save time for fulfillment staff searching orders.

Detailed Order Management Mod

It used to work at 4.1x, 4.2x, 4.3x, but you need to make changes for 4.4.4.

__________________
www.ChiMassager.com
X-cart Version 4.44

www.SEOMarketing30days.com
--> Download FREE SEO marketing Ebook (valued $50)
Attract more visitors and sales with top 5 most powerful SEO marketing strategies. Converting visitors into buyers, not just traffic!
Reply With Quote
  #2  
Old 11-17-2011, 05:10 PM
 
chiactivate chiactivate is offline
 

Senior Member
  
Join Date: Feb 2007
Location: Canada
Posts: 148
 

Wink Re: Show Order Details For (4.4.4) / Detail order management

It Works in 4.4.4 as Well!! Files are located in different directories, so I had to make some changes.

Here is the complete code for the first part:

your_xcart_dir/skin/common_files/main/order_info.tpl

After:

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

Add:
Quote:

{* genbilim *}
<script language=javascript src="../skin/common_files/js/copy_addr.js"></script>
{* genbilim-end *}


../skin/common_files/main/order_info.tpl

After:

Quote:
<td colspan="2"> <br /><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 *}

../skin/common_files/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="../skin/common_files/js/copy_addr.js"></script>
<div id="DIV_CopyInform" style="display:none;"></div>
{* genbilim-end *}

../skin/common_files/main/orders_list.tpl

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 *}

../skin/common_files/main/orders_list.tpl

After:

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


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>Ship To</td>
<td>Product</td>
<td>Code</td>
<td align=center>Amount</td>


{if $usertype eq 'A'}
<td align=center>Stock</td>
{/if}


</tr>
{foreach item=item from=$orders[oid].item_list}
<tr bgcolor=#CCCCDD>


<td width="30%" nowrap="nowrap">{$orders[oid].s_firstname} {$orders[oid].s_lastname}</td>
<td width="40%" nowrap="nowrap">{$item.product}</td>
<td width="10%" nowrap="nowrap">{$item.productcode}</td>
<td width="10%" nowrap="nowrap" align=center>{$item.amount}</td>
{if $usertype eq 'A'}
<td width="10%" nowrap="nowrap" align=center>{$item.avail}</td>
{/if}


</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 *}


in your xcart directory:
../skin/common_files/js

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();
}
}
}
Open this file: …/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 this directory: …/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 for part one. The color part to be continued....
__________________
www.ChiMassager.com
X-cart Version 4.44

www.SEOMarketing30days.com
--> Download FREE SEO marketing Ebook (valued $50)
Attract more visitors and sales with top 5 most powerful SEO marketing strategies. Converting visitors into buyers, not just traffic!
Reply With Quote
  #3  
Old 11-27-2011, 07:45 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Show Order Details For (4.4.4) / Detail order management

Two problems...

1. ../skin/common_files/order_info.tpl doesn't exist. This is in the 2nd step of your guide, where you say to add the long Javascript code. Should it be skin/common_files/main/order_info.tpl instead?

2. The code
Code:
$orders = func_query("SELECT $sql_tbl[orders].* $search_condition ORDER BY $sort_string LIMIT $first_page, $objects_per_page");
doesn't exist in my includes/orders.php. The only thing similar is
Code:
$orders = func_query("SELECT $sql_tbl[orders].*, $sql_tbl[customers].id AS existing_userid, $sql_tbl[customers].login $search_condition ORDER BY $sort_string LIMIT $first_page, $objects_per_page");

The version I have for 4.4.4 is marked
$Id: orders.php,v 1.126.2.12 2011/09/19 05:46:13 aim Exp $
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #4  
Old 11-29-2011, 04:57 PM
 
chiactivate chiactivate is offline
 

Senior Member
  
Join Date: Feb 2007
Location: Canada
Posts: 148
 

Default Re: Show Order Details For (4.4.4) / Detail order management

that's correct. Sorry for the mistakes. Just updated the post.
__________________
www.ChiMassager.com
X-cart Version 4.44

www.SEOMarketing30days.com
--> Download FREE SEO marketing Ebook (valued $50)
Attract more visitors and sales with top 5 most powerful SEO marketing strategies. Converting visitors into buyers, not just traffic!
Reply With Quote

The following user thanks chiactivate for this useful post:
JWait (11-30-2011)
  #5  
Old 12-31-2011, 12:07 PM
  a1deano's Avatar 
a1deano a1deano is offline
 

X-Adept
  
Join Date: Oct 2004
Posts: 745
 

Default Re: Show Order Details For (4.4.4) / Detail order management

Hi I see it says - That's All for part one. The color part to be continued....

Do I need the second part if so were can I get code from

Thanks
__________________
--------------
V4.6.1
xcartmods - Reboot Template

X-cart - X-PDF

Altered Cart - Checkout one
Reply With Quote
  #6  
Old 01-02-2012, 12:36 AM
 
chiactivate chiactivate is offline
 

Senior Member
  
Join Date: Feb 2007
Location: Canada
Posts: 148
 

Default Re: Show Order Details For (4.4.4) / Detail order management

no, you don't need the second part. See link of the entire mod for older X-cart version: http://forum.x-cart.com/showthread.php?t=29680
__________________
www.ChiMassager.com
X-cart Version 4.44

www.SEOMarketing30days.com
--> Download FREE SEO marketing Ebook (valued $50)
Attract more visitors and sales with top 5 most powerful SEO marketing strategies. Converting visitors into buyers, not just traffic!
Reply With Quote
  #7  
Old 01-05-2012, 07:05 AM
  a1deano's Avatar 
a1deano a1deano is offline
 

X-Adept
  
Join Date: Oct 2004
Posts: 745
 

Default Re: Show Order Details For (4.4.4) / Detail order management

Many thanks managed to get it sorted
__________________
--------------
V4.6.1
xcartmods - Reboot Template

X-cart - X-PDF

Altered Cart - Checkout one
Reply With Quote
  #8  
Old 01-12-2012, 12:01 PM
 
cedaly1968 cedaly1968 is offline
 

eXpert
  
Join Date: May 2011
Posts: 225
 

Default Re: Show Order Details For (4.4.4) / Detail order management

This is a very cool mod, but I do get an error when I close the "Copy Address" window - throws me to a 404 error... thoughts?

https://www.brydenroad.com/admin/javascript%20:void(0)
__________________
4.4.3
Reply With Quote
  #9  
Old 01-23-2012, 02:08 PM
 
chiactivate chiactivate is offline
 

Senior Member
  
Join Date: Feb 2007
Location: Canada
Posts: 148
 

Default Re: Show Order Details For (4.4.4) / Detail order management

hi cedaly,

did you fix the 404 error?
__________________
www.ChiMassager.com
X-cart Version 4.44

www.SEOMarketing30days.com
--> Download FREE SEO marketing Ebook (valued $50)
Attract more visitors and sales with top 5 most powerful SEO marketing strategies. Converting visitors into buyers, not just traffic!
Reply With Quote
  #10  
Old 01-23-2012, 02:30 PM
 
cedaly1968 cedaly1968 is offline
 

eXpert
  
Join Date: May 2011
Posts: 225
 

Default Re: Show Order Details For (4.4.4) / Detail order management

No - have not had a chance to look at it to see what the cause is...
__________________
4.4.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:36 AM.

   

 
X-Cart forums © 2001-2020