View Single Post
  #9  
Old 01-18-2012, 08:35 AM
  Ana's Avatar 
Ana Ana is offline
 

Senior Member
  
Join Date: Aug 2004
Location: Hurricane Alley, South Florida USA
Posts: 186
 

Default Re: Adding "More Colors" to products_t.tpl listing

Quote:
Originally Posted by cflsystems
You still need to query the db, products options is not available on products list page. Try this

In include/search.php find
PHP Code:
// foreach ($products as $k => $v)
unset($thumb_dims); 

and just before add (replace 'Color' with your option class name exactly as you have it)

PHP Code:
// added by CFL Systems for 'more colors' note
$products[$k]['more_colors'] = func_query_first_cell("select count(*) from $sql_tbl[classes] where productid = $v[productid] and avail = 'Y' and class = 'Color'") > 'Y' 'N'

then in the products list template where you want it to show

Code:
{if $product.more_colors eq 'Y'} MORE COLORS NOTE {/if}

You always seem to understand what I'm getting at, Steve! LOL! Thanks so much.

I had to do a little modification on it as all our products have at least one color so they will all have the class "Color", however, if there is more than one color the classtext is "Select Color" instead of "Color". Changed it to the classtext version and voila.

Steve, YOU ROCK!

Ana
__________________
"Real knowledge is to know the extent of one's ignorance."-- Confucius

X-Cart 4.4.4
MySQL 5.0.92
Apache/2.0.64 (Unix)
PHP 5.3.6
CentOS 5.5

MODS:
Template Mela- Theme XCT010002
Altered Cart- CheckoutOne
BCS Engineering- Back In Stock Notification
X-Cart Mods- Thumbnail Candy
X-Cart Mods-Advanced Shop Closed
Google Site Search
Reply With Quote