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)
-   -   Detailed Order Management Mod (https://forum.x-cart.com/showthread.php?t=29680)

Dan.roh 09-21-2009 12:23 PM

Re: Detailed Order Management Mod
 
Quote:

Originally Posted by mesut
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.



Hi,

Just a very big thank you for this great mod. I do have one slight issue and that is that it cuts of a part of the address when you click on the small icon or copy to clipboard.

eg. The address that has been cut to clipboard is

Mr.Andrew Smith
6 Kingfisher Close
Hamble HAM, SO31 4PE

and it is suppose to be

Mr.Andrew Smith
6 Kingfisher Close
Hamble, Hampshire, SO31 4PE

Not a big issue at all but is there a way that I can make it so that it all displays on different lines as well as in full. Please be kind to assist if you can. This mod is one of a kind and is really helping me alot, thanks!

chris.barber 09-21-2009 08:55 PM

Re: Detailed Order Management Mod
 
In your order_info.tpl check the section

{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_address_2="{$order.s_address_2}"
ship_city="{$order.s_city},"
ship_state="{$order.s_statename}"
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}

Then make sure that the State element is the right version for what you want, yours is using the short code for the county/state.

I use s_statename, I am based in the UK also and this works for me.

Dan.roh 09-22-2009 12:53 AM

Re: Detailed Order Management Mod
 
Quote:

Originally Posted by chris.barber
In your order_info.tpl check the section

{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_address_2="{$order.s_address_2}"
ship_city="{$order.s_city},"
ship_state="{$order.s_statename}"
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}

Then make sure that the State element is the right version for what you want, yours is using the short code for the county/state.

I use s_statename, I am based in the UK also and this works for me.


Got it! thanks ,but this only sorts out the "copy to clipboard" and not the "copy to field " or the icon bit. Any suggestions?

chris.barber 09-22-2009 10:25 PM

Re: Detailed Order Management Mod
 
Same principle for the next block of text below in the same file:

{* 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_address_2="{$customer.s_address_2}"
ship_city="{$order.s_city}"
ship_state="{$order.s_statename}"
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 *}

You may also need to update the copy_addr.js mine has, it's the top bit I changed, highlighted in red:

var attributes = ['to', 'address', 'address_2', 'city', 'state', 'country', 'zipcode'];
var addrFormat =
"{to}\r\n" +
"{address}\r\n" +
"{address_2}\r\n" +
"{city}\r\n" +
"{state}\r\n" +
"{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=8 cols=50 >' + str + '</textarea></td></tr>';
document.getElementById('addr_ta').focus();
document.getElementById('addr_ta').select();
}
}
}

Hope that sorts it for you, responded yesterday in a rush before heading oiut the door to work.

Dan.roh 09-23-2009 12:34 PM

Re: Detailed Order Management Mod
 
Quote:

Originally Posted by chris.barber
Same principle for the next block of text below in the same file:

{* 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_address_2="{$customer.s_address_2}"
ship_city="{$order.s_city}"
ship_state="{$order.s_statename}"
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 *}

You may also need to update the copy_addr.js mine has, it's the top bit I changed, highlighted in red:

var attributes = ['to', 'address', 'address_2', 'city', 'state', 'country', 'zipcode'];
var addrFormat =
"{to}\r\n" +
"{address}\r\n" +
"{address_2}\r\n" +
"{city}\r\n" +
"{state}\r\n" +
"{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=8 cols=50 >' + str + '</textarea></td></tr>';
document.getElementById('addr_ta').focus();
document.getElementById('addr_ta').select();
}
}
}

Hope that sorts it for you, responded yesterday in a rush before heading oiut the door to work.



Thanks again for your great help much appreciated!!! Almost there! It now work perfectly exept for one line that returns "null"

The addresses now look like this when clicked on any of the 3(copy to field , copy to clipboard and icon)

Mr.Andrew Smith
6 Kingfisher Close
null
Hamble
Hampshire
SO31 4PE

The red area should be South Hampton.


Please advise.

Thanks

chris.barber 09-23-2009 01:28 PM

Re: Detailed Order Management Mod
 
Dan

If you match it up then you will see which line is giving the issue.

"{to}\r\n" + = Mr.Andrew Smith
"{address}\r\n" +
= 6 Kingfisher Close
"{address_2}\r\n" + = null
"{city}\r\n" + = Hamble
"{state}\r\n" + = Hampshire
"{zipcode}"; = SO31 4PE

So if you don't have an address line 2 this will return 'null' in mine I am not using Country as we only deal with the UK.



Keys Care 11-02-2009 02:19 PM

Re: Detailed Order Management Mod
 
We implemented this mod and have been successfully using it for over a year.

We made some mods that added the WorkingMan Software for USPS shipping and now have added Shipkit for UPS.

The problem is that the mod does not pull over the shipping method, so I do not know which orders are for USPS and which are for UPS.

Can anyone help me to add the shipping method for each order to the order management page?

Thanks

Bob

flamers 11-06-2009 05:04 AM

Re: Detailed Order Management Mod
 
A great mod, love it.

One thing we would like to do is to make the background colour of the Order Details page (the page you go to to see what a customer order consists of) reflect the status of the order. For example, on our site failed orders are highlighted red on the order list, but every morning we move from order to order using the breadcrumb links on each details page, so if an order has failed we would immediately see that because we would see a red background on the order detail. I hope that makes sense.

We have tried messing around with the order_info.tpl but cannot make a colour appear in the table that XCart creates to show the order and customer detail. Does anyone have any ideas?

Keys Care 11-06-2009 08:51 AM

Re: Detailed Order Management Mod
 
Quote:

Originally Posted by flamers
A great mod, love it.

One thing we would like to do is to make the background colour of the Order Details page (the page you go to to see what a customer order consists of) reflect the status of the order. For example, on our site failed orders are highlighted red on the order list, but every morning we move from order to order using the breadcrumb links on each details page, so if an order has failed we would immediately see that because we would see a red background on the order detail. I hope that makes sense.

We have tried messing around with the order_info.tpl but cannot make a colour appear in the table that XCart creates to show the order and customer detail. Does anyone have any ideas?


Somewhere in this thread, I picked up a mod that we implemented that adds a button to the admin page that restricts the orders page to only items that are confirmed shippable. Our button says "Orders that are Ship Now!" and is just below the "Orders " button on the admin page. We use this instead of the colors for our fulfillments team. This way they only see what is shippable. This also lets us queue orders without them seeing them and accidentally shipping.

I hope this helps.

flamers 02-22-2010 08:03 AM

Re: Detailed Order Management Mod
 
We love this mod, but it would be even better if, when the orders list is expanded, we could replace the 'Stock' column with the manufacturer name. We have tried a few things but cannot get the manufacturer to show. Our primary effort has been in using the smarty tag {$product.manufacturer}, but with no luck. Anyone have any ideas?


All times are GMT -8. The time now is 12:08 PM.

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