This contribution is to show attribute items that have prices added to the base price of a product with the lowest price. It shows attribute items with 'price from' and 'price' if it has no attributes. It can be made better, thats why I am posting this so any amends are most welcome.
In product_info.php look for :
Replace with:
$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);
$products_attributes_price = tep_db_query("select patrib.products_id, patrib.price_prefix, MIN(patrib.options_values_price) from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and popt.language_id = '" . (int)$languages_id . "' GROUP BY patrib.products_id");
$products_pp = tep_db_fetch_array($products_attributes_price);
if ($products_attributes['total'] > 0) {
$products_priceatti = $products_pp['MIN(patrib.options_values_price)'];
$products_price = $product_info['products_price'];
$sumItems = $products_price - $products_priceatti;
$totalItems = $currencies->display_price($sumItems, tep_get_tax_rate($product_info['products_tax_class_id']));
echo 'Price From: ' . $totalItems;
}else{
echo 'Price: ' . $products_price;
}
Enjoy!
More...





LinkBack URL
About LinkBacks









Bookmarks