I've made changes to the product_listing.php, so each item listed has its own BGCOLOR instead of the defaults ..
.. I wasnt sure how to add variables to each item -- so I created a "manufacturer" for each BG_COLOR and assigned them to the items.
then, turned on MANUFACTURER in the product listing .. so it would show up.
heres code to stop MAN. from showing up on listing;
(if i turned it off in the admin section, i cant reference its values .. so had to turn it on, but dont want it to show on screen)
[before]
case 'PRODUCT_LIST_MANUFACTURER':
$lc_text = TABLE_HEADING_MANUFACTURER;
[after]
case 'PRODUCT_LIST_MANUFACTURER':
// $lc_text = TABLE_HEADING_MANUFACTURER;
$lc_text = ' ';
then, to display each items BG color ...
[before]
if ((($rows-$extra_row)/2) == floor(($rows-$extra_row)/2)) {
$list_box_contents[$rows] = array('params' => 'class="productListing-even"');
} else {
$list_box_contents[$rows] = array('params' => 'class="productListing-odd"');
}
[after]
$bg_color = $listing->fields['manufacturers_name'] ;
if ($bg_color)
{
if ((($rows-$extra_row)/2) == floor(($rows-$extra_row)/2))
{
$list_box_contents[$rows] = array('params' => 'class="productListing-even" style="background-color: ' . $bg_color . '" ');
}
else
{
$list_box_contents[$rows] = array('params' => 'class="productListing-odd" style="background-color: ' . $bg_color . '"');
}
}
else
{
if ((($rows-$extra_row)/2) == floor(($rows-$extra_row)/2)) {
$list_box_contents[$rows] = array('params' => 'class="productListing-even"');
} else {
$list_box_contents[$rows] = array('params' => 'class="productListing-odd"');
}
}
THAT gets the first part (NOTE: works great!!)
.. now for the text description, in my case I wanted to keep the formatted HTML .. not the default raw text.
[before]
$list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . '" colspan="' . $zc_col_count_description . '"',
'text' => zen_trunc_string(zen_clean_html(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id'])), PRODUCT_LIST_DESCRIPTION));
[after]
$bg_color = $listing->fields['manufacturers_name'] ;
if ($bg_color)
{
$list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . ' " bgcolor="' . $bg_color . '" colspan="' . $zc_col_count_description . '"',
'text' => zen_trunc_string(zen_get_products_description($listing->fields['products_id']), PRODUCT_LIST_DESCRIPTION));
}
else
{
$list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . '" colspan="' . $zc_col_count_description . '"',
'text' => zen_trunc_string(zen_get_products_description($listing->fields['products_id']), PRODUCT_LIST_DESCRIPTION));
}
--FINALLY, after all that .. the item descriptions were using the default bg's from the CSS.
unable to find a better method, I added a <div> statement as follows, to change its BG color as well ...
<div style="font-family: Papyrus;font-weight: bold;color: #A63D41;background-color: #FFE1F0; text-align: center" >
Works great in IE, but still shows an odd border in FIREFOX ...
[here is the resulting HTML ..]
<tr class="productListing-even" style="background-color: #FFE1F0" >
<td align="center" class="productListing-data">
<a href="http://www.raindropsoap.com/index.php?main_page=product_info&cPath=1&products_id=42">
<img src="images/jasminestar.jpg" border="0" alt="Jasmine Star" title=" Jasmine Star " width="200" height="187" />
</a>
</td>
<td class="productListing-data">
<a href="http://www.raindropsoap.com/index.php?main_page=product_info&cPath=1&products_id=42">
<img src="/images/names/jasmine.jpg" align="center" alt="Jasmine Star" />
</a>
</td>
<td class="productListing-data">
</td>
<td class="productListing-data">
</td>
<td align="right" class="productListing-data">
$5.00<br /> <br />Add: <input type="text" name="products_id[42]" value=0 size="4"><br /> </td>
</tr>
<tr >
<td class="productListing-data-description-even style="background-color: #FFE1F0" colspan="5">
<div style="font-family: Papyrus;font-weight: bold;color: #A63D41;background-color: #FFE1F0; text-align: center" >
<p></p>
<p>Cleansing with this soap will leave your skin smelling of a sweet Jasmine flower.<br />
The purple in this soap is infused Eucalyptus oil, known for its deodorizing qualities.<br />
The exotic aroma has long been used in Love Potions & Aphrodesiacs. </p>
</div> </td>
</tr>
ANY suggestions ? is this just a IE / Firefox difference ? Firefox seems to ignore the BG_COLOR if set on the <TD> but uses it for <TR> ...
Bookmarks