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

Color coded order status...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #61  
Old 01-03-2005, 06:36 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

If I was a developer I would be happy to kiss butt and do everyones template mods for them with the hope of landing clients, but I have a business to run and hot damn, we are rocking the New Year in!
Reply With Quote
  #62  
Old 01-03-2005, 06:42 PM
 
g0t0pless g0t0pless is offline
 

eXpert
  
Join Date: Jul 2003
Posts: 360
 

Default

I think it would be nice for the thread starter (or someone else who has confirmed a working version of this mod) to repost the code here.

I've read all 4 pages of this thread, and I still don't really know where to start. And to make it even clearer for everyone, maybe make 2 replies. 1 post for 3.XX and 1 for 4.XX versions of X-Cart.
__________________
4.1.7
X-Cart Gold
Product Configurator Module
Advanced Order Management Module
RMA Module
Feature Compare Module
Blue Dream theme by 7Dana.com
Reply With Quote
  #63  
Old 01-03-2005, 06:53 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Quote:
Originally Posted by pipercub
Here's the code...

First, create a new template called 'order_colors.tpl' (or whatever you prefer). This file should live in the 'Main' directory. Paste the following into this new file:

Code:
{* $Id: orders_colors.tpl,v 1.0 2003/10/26 13:07:50 pipercub Exp $ *} {if $orders[cat_num].status eq "C"} bgcolor="#00CC00"} {/if} {if $orders[cat_num].status eq "P"} bgcolor="#FFFF99"} {/if} {if $orders[cat_num].status eq "F"} bgcolor="#FF33333"} {/if}

Obviously, you can add all of the status indicators that you need, but I only use these three. This is also where you change the colors.

Next, open 'main/orders.tpl'. Find the part of the code where the 'section' loop begins. Replace everything between {section name=cat_num loop=$orders} and {/section} with the following code:

*This is the easy method. Scroll down for the custom method.

Code:
{section name=cat_num loop=$orders} {math equation="x + ordertotal" x=$total ordertotal=$orders[cat_num].total assign="total"} {if $orders[cat_num].status eq "P" or $orders[cat_num].status eq "C"} {math equation="x + ordertotal" x=$total_paid ordertotal=$orders[cat_num].total assign="total_paid"} {/if} { if %cat_num.first% } <table border=0 width=100% cellspacing="1" cellpadding="0"> {/if} <tr> <td align="center" {include file="main/orders_colors.tpl"}> #{$orders[cat_num].orderid} </td> <td align="center" {include file="main/orders_colors.tpl"}> <input type=radio name=orderid value="{ $orders[cat_num].orderid }" { if %cat_num.first% }checked{/if}> </td> <td align="center" nowrap class=Text {include file="main/orders_colors.tpl"}> {$orders[cat_num].status} </td> <td nowrap align="center" {include file="main/orders_colors.tpl"}> <font class=Text>{$orders[cat_num].date|date_format:"%b-%d-%Y"}</font> </td> <td nowrap align="center" {include file="main/orders_colors.tpl"} class=Text> {if $usertype eq "A"}<a href="order.php?orderid={$orders[cat_num].orderid}"> { $orders[cat_num].firstname } { $orders[cat_num].lastname }</a> {/if} </td> <td nowrap align="center" {include file="main/orders_colors.tpl"} class=Text> {if $usertype eq "A"} { $orders[cat_num].provider } {else}<a href="order.php?orderid={$orders[cat_num].orderid}"> { $orders[cat_num].firstname } { $orders[cat_num].lastname }</a> {/if} </td> <td nowrap align=right class=Text {include file="main/orders_colors.tpl"}> {include file="currency.tpl" value=$orders[cat_num].total} </td> </tr> { if %cat_num.last% } <tr><td colspan=7 align=right height=20>{$lng.lbl_gross_total}: {include file="currency.tpl" value=$total}</td></tr> <tr><td colspan=7 align=right height=20>{$lng.lbl_total_paid}: {include file="currency.tpl" value=$total_paid}</td></tr> </table> {/if} {/section}

For theose who don't want to replace their file (due to other mods), you can simply paste:

Code:
{include file="main/orders_colors.tpl"}

between all of the <td> tags for the cells that you want to affect.

Example:
<td align="center" {include file="main/orders_colors.tpl"}>

Enjoy,
Piper

THIS IS FOR 3.X
Reply With Quote
  #64  
Old 01-03-2005, 06:54 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Quote:
Originally Posted by adpboss
This is one of the most underrated mods for everyday users. Nothing is better than visual representation of order status. Especially when you want to browse through a list to see how many are queued, declined etc all in one screen without using filters.

Implementing this in V4.0.5

You need to modify skin1/main/orders_list.tpl

Around line 53 change

Code:
<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>

to

Code:
<TR{cycle values=", class='TableSubHead'"}> <TD width="5"><INPUT type="checkbox" name="orderids[{$orders[oid].orderid}]"></TD> <TD {include file="main/orders_colors.tpl"}>#{$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 {include file="main/orders_colors.tpl"}>{$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 {include file="main/orders_colors.tpl"} nowrap>{$orders[oid].date|date_format:$config.Appearance.date_format}</TD> <TD {include file="main/orders_colors.tpl"} nowrap align="right"> {include file="currency.tpl" value=$orders[oid].total} </TD> </TR>

Please also note that you will have to update your orders_colors.tpl file to account for V4 changes.

Code:
{* $Id: orders_colors.tpl,v 2.0 2004/10/31 01:27:28 ADPBoss Exp $ *} {if $orders[oid].status eq "C"} bgcolor="#00CCFF"} {/if} {if $orders[oid].status eq "P"} bgcolor="#00FF66"} {/if} {if $orders[oid].status eq "Q"} bgcolor="#FFFF99"} {/if} {if $orders[oid].status eq "F"} bgcolor="#FF3333"} {/if} {if $orders[oid].status eq "I"} bgcolor="#CCCCCC"} {/if}

Please also note that no status colour has been set for Declined "D". You can just copy one of the if statements and add your own.

I will follow up with product colour mod as soon as possible.

THIS IS FOR 4.X
Reply With Quote
  #65  
Old 01-03-2005, 06:56 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

If you guys can't follow what are really clear instructions, please move on. This is so simple and well documented, that it is ridiculous that anyone should have to copy and repost something that is earlier in the thread. But I did it anyways.
Reply With Quote
  #66  
Old 01-03-2005, 07:46 PM
 
g0t0pless g0t0pless is offline
 

eXpert
  
Join Date: Jul 2003
Posts: 360
 

Default

adpboss: I really appreciate you doing that for us. I thank you for all of us.

It might be easu for someone who understand X-Cart, smarty, php, and all those other languages. But for some of us, it is really intimidating. And to see different pieces of the code pasted into different posts, it gets confusing REALLY fast, almost to the point where you don't really even wanna try to use the mod.

Now that the codes are in one place, I think a lot more people will use it, and have less questions in the process.

Again, I appreciate your kindness.
__________________
4.1.7
X-Cart Gold
Product Configurator Module
Advanced Order Management Module
RMA Module
Feature Compare Module
Blue Dream theme by 7Dana.com
Reply With Quote
  #67  
Old 01-03-2005, 08:14 PM
 
g0t0pless g0t0pless is offline
 

eXpert
  
Join Date: Jul 2003
Posts: 360
 

Default

I've followed the directions to a T, but I am unable to get it to work either.

I created order_colors.tpl and put it in the skin1/main with the following code:

Code:
{* $Id: orders_colors.tpl,v 2.0 2004/10/31 01:27:28 ADPBoss Exp $ *} {if $orders[oid].status eq "C"} bgcolor="#00CCFF"} {/if} {if $orders[oid].status eq "P"} bgcolor="#00FF66"} {/if} {if $orders[oid].status eq "Q"} bgcolor="#FFFF99"} {/if} {if $orders[oid].status eq "F"} bgcolor="#FF3333"} {/if} {if $orders[oid].status eq "I"} bgcolor="#CCCCCC"} {/if}

Now the first thing I notice is the file name. In the file on the first line, it is referencing itself as orders_colors.tpl. I tried naming the file with the s and without the s. Neither one makes a difference.

I editted my existing orders_list.tpl with the code for the 4.X version (since I am running 4.0.9). I fail to see how it references the orders_colors.tpl file anywhere. I'm wondering if that has anything to do with it.

Now before you get mad at me for doubting you (or the original code creator) keep in mind I am a noob at this. I am just pointing out what "I" think are flaws, and why it isn't working for me.

So, adpboss: Please, please, pretty please throw some advice our direction. I won't offer any money, since that seems to have offended you. Maybe I could pay you in M&M's or girls?

Thanks.
__________________
4.1.7
X-Cart Gold
Product Configurator Module
Advanced Order Management Module
RMA Module
Feature Compare Module
Blue Dream theme by 7Dana.com
Reply With Quote
  #68  
Old 01-03-2005, 08:17 PM
 
g0t0pless g0t0pless is offline
 

eXpert
  
Join Date: Jul 2003
Posts: 360
 

Default

I am wondering if I am supposed to follow the 3.X version, then the 4.X version?

Here is my editted (4.X code from above only) version of order_list.tpl:
Code:
* $Id: orders_list.tpl,v 1.7.2.2 2004/10/29 07:43:23 max 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='update';document.processorderform.submit();"> {/if} <INPUT type="button" value="{$lng.lbl_invoices_for_selected}" onclick="document.processorderform.mode.value='invoice';document.processorderform.target='_blank';document.processorderform.submit();"> {if $usertype ne "C"} <INPUT type="button" value="{$lng.lbl_labels_for_selected}" onclick="document.processorderform.mode.value='label';document.processorderform.submit();"> {/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_orders_warning|strip_tags}')){ldelim}document.processorderform.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='export';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='export_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}
__________________
4.1.7
X-Cart Gold
Product Configurator Module
Advanced Order Management Module
RMA Module
Feature Compare Module
Blue Dream theme by 7Dana.com
Reply With Quote
  #69  
Old 01-03-2005, 08:20 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

What version is your store...

Reply With Quote
  #70  
Old 01-03-2005, 08:22 PM
 
g0t0pless g0t0pless is offline
 

eXpert
  
Join Date: Jul 2003
Posts: 360
 

Default

4.0.9 as my sig states.
__________________
4.1.7
X-Cart Gold
Product Configurator Module
Advanced Order Management Module
RMA Module
Feature Compare Module
Blue Dream theme by 7Dana.com
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 12:30 PM.

   

 
X-Cart forums © 2001-2020