X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Adding shipping option in orders list (https://forum.x-cart.com/showthread.php?t=67624)

Raptor 08-27-2013 08:33 AM

Adding shipping option in orders list
 
Does anyone know how to add a shipping option column to the orders list and highlight them in different colors?

This will make it much easier to see orders that have selected expedited shipping options like next day service

Xcart 4.6.0

Thomasb134 08-27-2013 10:02 AM

Re: Adding shipping option in orders list
 
http://forum.x-cart.com/showpost.php?p=313758&postcount=183

.

Raptor 08-27-2013 10:23 AM

Re: Adding shipping option in orders list
 
Thank you for the reply - this simply adds a color code to the customers name

I need a column with the shipping method name listed - we have many many shipping methods - thanks

nfc5382 09-07-2016 03:44 AM

Re: Adding shipping option in orders list
 
Quote:

Originally Posted by Raptor
I need a column with the shipping method name listed - we have many many shipping methods - thanks


I know this is an old thread but here's a patch for 4.7.6. It adds a "shipping" column to the order list with the shipping method per order. We use this to easily see in the order list which orders have expedited shipping. Those orders get priority over ground shipping.

skin/common_files/main/orders_list.tpl

find
Code:

  <td width="20%" nowrap="nowrap">{if $search_prefilled.sort_field eq "date"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="orders.php?mode=search&amp;sort=date{if $search_prefilled.sort_field eq "date"}&amp;sort_direction={if $search_prefilled.sort_direction eq 1}0{else}1{/if}{/if}">{$lng.lbl_date}</a></td>
  <td width="20%" align="right" nowrap="nowrap">{if $search_prefilled.sort_field eq "total"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="orders.php?mode=search&amp;sort=total{if $search_prefilled.sort_field eq "total"}&amp;sort_direction={if $search_prefilled.sort_direction eq 1}0{else}1{/if}{/if}">{$lng.lbl_total}</a></td>


Replace with:

Code:

  <td width="15%" nowrap="nowrap">{if $search_prefilled.sort_field eq "date"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="orders.php?mode=search&amp;sort=date{if $search_prefilled.sort_field eq "date"}&amp;sort_direction={if $search_prefilled.sort_direction eq 1}0{else}1{/if}{/if}">{$lng.lbl_date}</a></td>
  <td width="10%" nowrap>{$lng.lbl_shipping}</td>
  <td width="15%" align="right" nowrap="nowrap">{if $search_prefilled.sort_field eq "total"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="orders.php?mode=search&amp;sort=total{if $search_prefilled.sort_field eq "total"}&amp;sort_direction={if $search_prefilled.sort_direction eq 1}0{else}1{/if}{/if}">{$lng.lbl_total}</a></td>


Find:
Code:

  <td nowrap="nowrap"><a href="order.php?orderid={$orders[oid].orderid}">{$orders[oid].date|date_format:$config.Appearance.datetime_format}</a></td>

After it, add:
Code:

<td nowrap="nowrap">{$orders[oid].shipping|regex_replace:"/\(.*\)|#.*#/":""}</td>

Raptor 09-08-2016 06:39 PM

Re: Adding shipping option in orders list
 
Many thanks !!


cherie 09-12-2016 01:59 PM

Re: Adding shipping option in orders list
 
We did something similar but just truncated the shipping to a suitable length to help the column from becoming too long:

PHP Code:

{$orders[oid].shipping|truncate:"5":""


Thomasb134 09-12-2016 03:54 PM

Re: Adding shipping option in orders list
 
Thanks for sharing the mod. Just to add my twist to it (for my V4.4.5 cart), I altered the last line of code so that the USPS's <sup> tags are removed from the displayed shipping text. This shortens the text and looks better too.

Code is as follows:
Code:

<td nowrap="nowrap">{$orders[oid].shipping|regex_replace:"/\&lt;|\&gt;|sup|\/|\(.*\)|#.*#/":""}</td>


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

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