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"> </td>
<td nowrap="nowrap">{if $search_prefilled.sort_field eq "productcode"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction} {/if}<a href="{$url_to|amp}&sort=productcode&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} {/if}<a href="{$url_to|amp}&sort=title&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} {/if}<a href="{$url_to|amp}&sort=orderby&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} {/if}<a href="{$url_to|amp}&sort=quantity&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} {/if}<a href="{$url_to|amp}&sort=price&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 -