You could try this ...
Add a new file:
/includes/functions/extra_functions/extra_price_calculations.php
<?php
// functions/extra_functions/extra_price_calculations.php
////
// computes products_price + option groups lowest attributes price of each group when on
function zen_get_products_base_price_high($products_id) {
global $db;
$product_check = $db->Execute("select products_price, products_priced_by_attribute from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
// is there a products_price to add to attributes
$products_price = $product_check->fields['products_price'];
// do not select display only attributes and attributes_price_base_included is true
$product_att_query = $db->Execute("select options_id, price_prefix, options_values_price, attributes_display_only, attributes_price_base_included, round(concat(price_prefix, options_values_price), 5) as value from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and attributes_display_only != '1' and attributes_price_base_included='1'". " order by options_id, value DESC");
$the_options_id= 'x';
$the_base_price= 0;
// add attributes price to price
if ($product_check->fields['products_priced_by_attribute'] == '1' and $product_att_query->RecordCount() >= 1) {
while (!$product_att_query->EOF) {
if ( $the_options_id != $product_att_query->fields['options_id']) {
$the_options_id = $product_att_query->fields['options_id'];
$the_base_price += (($product_att_query->fields['price_prefix'] == '-') ? -1 : 1) * $product_att_query->fields['options_values_price'];
}
$product_att_query->MoveNext();
}
$the_base_price = $products_price + $the_base_price;
} else {
$the_base_price = $products_price;
}
return $the_base_price;
}
then in your templates and overrides for:
/includes/modules/product_listing.php
add the code:
case 'PRODUCT_LIST_PRICE':
$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
$lc_align = 'right';
$lc_text = $lc_price;
[B]// bof: show high attribute on priced by attribute
$lc_high_price = zen_get_products_base_price_high($listing->fields['products_id']);
$lc_regular_price = zen_products_lookup($listing->fields['products_id'], 'products_price_sorter');
if ($listing->fields['products_priced_by_attribute'] == 1 && $lc_high_price != $lc_regular_price && $lc_high_price > 0) {
$lc_text .= ' - ' . $currencies->display_price($lc_high_price, zen_get_tax_rate($listing->fields['products_tax_class_id']));
}
// eof: show high attribute on priced by attribute
[/B] // more info in place of buy now
$lc_button = '';
if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
and see if that does what you are looking for ...
Linda McGrath
If you have to think ... you haven't been zenned ...
**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!