@
multimixer
I'm using a thumbnail product listing contrib which has this code in it
$data_ok = ($listing_split->number_of_rows > 0);
if ((PRODUCT_LIST_DESCRIPTION ) && $data_ok) {
$listing_query = tep_db_query($listing_split->sql_query);
while ($products = tep_db_fetch_array($listing_query)) $id_array[] = $products['products_id'];
$pid_string = implode(',', array_unique($id_array));
$product_query = tep_db_query("select products_id, p.products_special, p.products_special_badge, products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $pid_string . ") and language_id = '" . (int)$languages_id . "'");
while ($products = tep_db_fetch_array($product_query)) {
All other info in that file is pulled the same way, eg $products['products_name']
I have created the option radio boxes in admin categories.php to choose a badge for an individual product, it works correctly, it saves the correct information to db and outputs well in my "special offers" section on my homepage, where I managed to implement it.
But it doesn't work the same way in the code for product_listing.php
This is a section of the code in that file which builds the thumbnail for each product:
$name = '<div class="productsHome-Listing">' . $link . $products['products_name'] . '</a></div>'. ($products['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '' . $products['short_desc'] . '<br />' : '') . product_description($products['products_id'],$link, true);
$price = (function_exists(display_short_price)) ? $currencies->display_short_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])) : $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id']));
$show_price = '<div class="productsHome-price">' . ($products['products_price'] > 0 ? $price : 'P.O.A') . '</div>';
if (!PRODUCT_LIST_PRICE) $show_price = '';
$model=(PRODUCT_LIST_MODEL ? $products['products_model'] . '' :'');
$info_box_contents[$row][$col] = array('align' => 'center',
'params' => ' class="productsHome-main" width="'.(100/PRODUCTS_PER_ROW).'%" valign="top"',
'text' => $border . '<div class="productImage"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $image, $products['products_name'], PRODUCT_IMAGE_WIDTH, '') . '</a></div>' . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">'. ($products['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? $products['short_desc'] . '' : '') . $name . $show_price . $badges);
Edited by al3ks, 28 June 2012 - 09:49 AM.
Find this post helpful? Click the 'Like this' button. :)