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)
-   -   Color coded order status... (https://forum.x-cart.com/showthread.php?t=4949)

Vacman 08-24-2007 07:55 PM

Re: Color coded order status...
 
Quote:

Originally Posted by newattraction
I just installed both color coded order status mod and color coded product list mod on version 4.1.5 - both mods work perfectly! :D

Thanks a lot!

Guosheng
www.vonbell.com



Could you share the code you did for the Product List? I have not been able to get this part working correctly yet.

MoonDog 08-26-2007 08:43 PM

Re: Color coded order status...
 
1 Attachment(s)
Vacman,

This is the code I worked on for v4.1.8
It seems to be working O.K., I haven't had any problems.
There are two color codes. One color is for when the quantity hits the low available limit that you set in admin, and the other color is for when your quantity level reaches zero.

This is the full code for skin1/main/products.tpl

Code:


{* $Id: products.tpl,v 1.42.2.3 2007/05/14 10:03:56 max Exp $ *}
{if $products ne ""}
{include file="main/check_all_row.tpl" style="line-height: 170%;" form="processproductform" prefix="productids"}
<script type="text/javascript">
<!--
var txt_pvariant_edit_note_list = "{$lng.txt_pvariant_edit_note_list|escape:javascript}";
{literal}
function pvAlert(obj) {
 if (obj.pvAlertFlag)
  return false;
 alert(txt_pvariant_edit_note_list);
 obj.pvAlertFlag = true;
 return true;
}
{/literal}
-->
</script>
<table cellpadding="2" cellspacing="1" width="100%">
{if $main eq "category_products"}
{assign var="url_to" value="category_products.php?cat=`$cat`&page=`$navpage`"}
{else}
{assign var="url_to" value="search.php?mode=search&page=`$navpage`"}
{/if}
<tr class="TableHead">
 <td width="5">&nbsp;</td>
 <td nowrap="nowrap">{if $search_prefilled.sort_field eq "productcode"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="{$url_to|amp}&amp;sort=productcode&amp;sort_direction={if $search_prefilled.sort_field eq "productcode"}{if $search_prefilled.sort_direction eq 1}0{else}1{/if}{else}{$search_prefilled.sort_direction}{/if}">{$lng.lbl_sku}</a></td>
 <td width="100%" nowrap="nowrap">{if $search_prefilled.sort_field eq "title"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="{$url_to|amp}&amp;sort=title&amp;sort_direction={if $search_prefilled.sort_field eq "title"}{if $search_prefilled.sort_direction eq 1}0{else}1{/if}{else}{$search_prefilled.sort_direction}{/if}">{$lng.lbl_product}</a></td>
{if $main eq "category_products"}
 <td nowrap="nowrap">{if $search_prefilled.sort_field eq "orderby"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="{$url_to|amp}&amp;sort=orderby&amp;sort_direction={if $search_prefilled.sort_field eq "orderby"}{if $search_prefilled.sort_direction eq 1}0{else}1{/if}{else}{$search_prefilled.sort_direction}{/if}">{$lng.lbl_pos}</a></td>
{/if}
 <td nowrap="nowrap">{if $search_prefilled.sort_field eq "quantity"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="{$url_to|amp}&amp;sort=quantity&amp;sort_direction={if $search_prefilled.sort_field eq "quantity"}{if $search_prefilled.sort_direction eq 1}0{else}1{/if}{else}{$search_prefilled.sort_direction}{/if}">{$lng.lbl_in_stock}</a></td>
 <td nowrap="nowrap">{if $search_prefilled.sort_field eq "price"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="{$url_to|amp}&amp;sort=price&amp;sort_direction={if $search_prefilled.sort_field eq "price"}{if $search_prefilled.sort_direction eq 1}0{else}1{/if}{else}{$search_prefilled.sort_direction}{/if}">{$lng.lbl_price} ({$config.General.currency_symbol})</a></td>
</tr>
{section name=prod loop=$products}
<tr{cycle values=', class="TableSubHead"'}>
 <td {include file="main/products_colors.tpl"}> <width="5"><input type="checkbox" name="productids[{$products[prod].productid}]" /></td>
 <td {include file="main/products_colors.tpl"}><a href="product_modify.php?productid={$products[prod].productid}{if $navpage}&page={$navpage}{/if}">{$products[prod].productcode}</a></td>
 <td {include file="main/products_colors.tpl"}> <width="100%">{if $products[prod].main eq "Y" or $main ne "category_products"}<b>{/if}<a href="product_modify.php?productid={$products[prod].productid}{if $navpage}&page={$navpage}{/if}">{$products[prod].product|truncate:35:"...":false}</a>{if $products[prod].main eq "Y" or $main ne "category_products"}</b>{/if}</td>
{if $main eq "category_products"}
 <td {include file="main/products_colors.tpl"}><input type="text" size="9" maxlength="10" name="posted_data[{$products[prod].productid}][orderby]" value="{$products[prod].orderby}" /></td>
{/if}
 <td {include file="main/products_colors.tpl"}><align="center">
{if $products[prod].product_type ne 'C'}
<input type="text" size="9" maxlength="10" name="posted_data[{$products[prod].productid}][avail]" value="{$products[prod].avail}"{if $products[prod].is_variants eq 'Y'} readonly="readonly" onclick="javascript: pvAlert(this);"{/if} />
{/if}
 </td>
 <td {include file="main/products_colors.tpl"}>
{if $products[prod].product_type ne 'C'}
<input type="text" size="9" maxlength="15" name="posted_data[{$products[prod].productid}][price]" value="{$products[prod].price|formatprice}"{if $products[prod].is_variants eq 'Y'} readonly="readonly" onclick="javascript: pvAlert(this);"{/if} />
{/if}
 </td>
</tr>
{/section}
</table>
{/if}


And this is the code for skin1/main/products_colors.tpl

Code:


{* $Id: products_colors.tpl,v 2.0 2004/10/31 01:44:16 ADPBoss Exp $ *}   
{if $products[prod].forsale eq "N"} td bgcolor="#CCCCCC"   
{elseif $products[prod].forsale eq "Y" and $products[prod].avail eq "0"} td bgcolor="#FFD2D2"
{elseif $products[prod].forsale eq "Y" and $products[prod].avail < $products[prod].low_avail_limit} td bgcolor="#FFCC99"
{/if}


Just change the colors to whatever fits you site layout.

I also adjusted the alternating colors from a medium gray to a lighter grey on the main product search result page.
I changed this in the skin1_admin.css file. I changed the original #EEEEEE color to #FAFAFA to give it a very, very light grey color.

Code:


 .TableSubHead {
 BACKGROUND-COLOR: #FAFAFA;
 FONT-WEIGHT: normal;
}


And that's it.

- MoonDog -

Vacman 08-26-2007 10:26 PM

Re: Color coded order status...
 
1 Attachment(s)
Well - I am not sure what I am doing wrong. I copied your exact code(s) but I still only get the image shown below. I will have to put this on my to do list for later. I am sure there is something obvious that I am over looking.

DaveB 08-27-2007 02:54 AM

Re: Color coded order status...
 
Got the Product colour mod working a treat in 4.0.19 Pro, but only in Provider mode. Any ideas how to implement it in Admin?

MoonDog 08-27-2007 07:07 PM

Re: Color coded order status...
 
Quote:

Got the Product colour mod working a treat in 4.0.19 Pro, but only in Provider mode. Any ideas how to implement it in Admin?

Unfortunately I'm unable to help with this one. I'm using X-Cart Gold and it only has one mode, the Admin mode. And it seems to be working O.K. in Gold. Hopefully, someone with X-Cart Pro can help you out.


Quote:


Well - I am not sure what I am doing wrong. I copied your exact code(s) but I still only get the image shown below. I will have to put this on my to do list for later. I am sure there is something obvious that I am over looking.


Make sure that you change the products.tpl file and not the product.tpl file. One has the letter "s" after product and the other doesn't.

- MoonDog -

DaveB 08-28-2007 03:41 AM

Re: Color coded order status...
 
Quote:

Originally Posted by Vacman
Well - I am not sure what I am doing wrong. I copied your exact code(s) but I still only get the image shown below. I will have to put this on my to do list for later. I am sure there is something obvious that I am over looking.


Not sure if it made any difference or not, but I cleared out the compiled templates after implementing.

Vacman 08-28-2007 06:59 AM

Re: Color coded order status...
 
Quote:

Originally Posted by DaveB
Not sure if it made any difference or not, but I cleared out the compiled templates after implementing.



Yeah - first thing I did a couple of days ago. Did not work.

sales@webosusa.com 01-24-2008 08:00 PM

Re: Color coded order status...
 
For those that never put the code on 4.1.9 here gos the code from the fist step AGAIN.

Create a tpl call "orders_colors.tpl" with the code below provide by adpboss

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}


change the code below...

Code:


<tr{cycle values=", class='TableSubHead'"}>
    <td width="5"><input type="checkbox" name="orderids[{$orders[oid].orderid}]" /></td>
    <td><a href="order.php?orderid={$orders[oid].orderid}">#{$orders[oid].orderid}</a></td>
    <td nowrap="nowrap">
{if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode ne "")}
<input type="hidden" name="order_status_old[{$orders[oid].orderid}]" value="{$orders[oid].status}" />
{if $orders[oid].goid ne ""}
{assign var="is_gcheckout_orders" value="1"}
{include file="main/order_status.tpl" status=$orders[oid].status mode="select" name="order_status[`$orders[oid].orderid`]" extra="disabled='disabled'"}
{else}
{include file="main/order_status.tpl" status=$orders[oid].status mode="select" name="order_status[`$orders[oid].orderid`]"}
{/if}
{else}
<a href="order.php?orderid={$orders[oid].orderid}"><b>{include file="main/order_status.tpl" status=$orders[oid].status mode="static"}</b></a>
{/if}
{if $active_modules.Stop_List ne '' && $orders[oid].blocked  eq 'Y'}
<img src="{$ImagesDir}/no_ip.gif" style="vertical-align: middle;" alt="{$lng.lbl_blocked}:{$orders[oid].ip}" title="{$lng.lbl_ip_blocked|substitute:"ip":$orders[oid].ip}" />
{/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="nowrap"><a href="order.php?orderid={$orders[oid].orderid}">{$orders[oid].date|date_format:$config.Appearance.datetime_format}</a></td>
    <td nowrap="nowrap" align="right">
    <a href="order.php?orderid={$orders[oid].orderid}">{include file="currency.tpl" value=$orders[oid].total}</a>
    </td>
</tr>


for this one...

Code:


{* Colors modification MOD *}

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

{* Colors modification MOD *}


As long as i know this modification will be good for any 4.x.x X-Cart versions but i install on 4.0.1, 4.1.0, 4.1.1, 4.1.7, 4.1.9 (I use this one).

If you never modified the code on "orders_list.tpl", just download the files "READY" and upload on your server OVERWRITING the old files.

Making sure everybody understand.... from the fist post says to modified the file "orders.tpl" but if you using the 4.x.x and higher you will not need that. You only will work with the "orders_colors.tpl" and "orders_list.tpl" nothing more.

DOWNLAOD HERE


The original forum page where you can find full discussion about this MODULE is: http://forum.x-cart.com/showthread.php?t=4949


Enjoy!


david@WSS 01-27-2008 06:50 PM

Re: Color coded order status...
 
1 Attachment(s)
I am using 4.1.9 developing a site, not live yet.

I have been trying to add the Orders Status mod without much luck. I have gone over all the posts dozens of times. I have replaced all the files in question and downloaded and installed the files that Pedro posted. Still the same problem.

Colors are not applied but the color code is printed in the table.

Same thing happens with the Products color code.

See the image below.

Help?

](*,)

Thanks,
David

http://forum.x-cart.com/images/attach/jpg.gif

david@WSS 01-28-2008 09:11 AM

Re: Color coded order status...
 
Problem solved....

Some mod had me change some code in the Smarty files.

This was the source of my problem. I reinstalled the original Smarty code and the color mod works great.

Lesson learned, do not mess with Smarty. Payment: hours lost and much frustration.

Moving on in the dev of my store, more trial and error and hopefully easier lessons.


All times are GMT -8. The time now is 04:30 AM.

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