Okay, so I made the following modifications which seem to restore previous operation/output but still keep the improvements that were applied. I will be proposing the changes made here for incorporation. May need to apply similar changes to an admin side function; however, for the store side:
includes/functions/functions_prices.php file as provided in ZC 1.5.6a beginning at line 1217:
Code:
function zen_get_attributes_price_final($attribute, $qty = 1, $pre_selected, $include_onetime = 'false', $prod_priced_by_attr = false, $attributes_discounted = 0, $include_products_price_in = false) {
global $db;
$attributes_price_final = 0;
if ($pre_selected == '' or $attribute != $pre_selected->fields["products_attributes_id"]) {
$pre_selected = $db->Execute("select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_attributes_id= '" . (int)$attribute . "'");
} else {
// use existing select
}
// normal attributes price discounted by sales/specials or not discounted if neither a sale nor a special
if ($pre_selected->fields["price_prefix"] == '-') {
// $attributes_price_final -= $pre_selected->fields["options_values_price"];
$attributes_price_final -= zen_get_discount_calc($pre_selected->fields["products_id"], $pre_selected->fields["products_attributes_id"], ($prod_priced_by_attr ? zen_products_lookup($pre_selected->fields["products_id"], 'products_price') : 0) + ($prod_priced_by_attr ? -1 : 1) * $pre_selected->fields["options_values_price"]) + ($prod_price_by_attr && !$include_products_price_in ? zen_products_lookup($pre_selected->fields["products_id"], 'products_price') : 0);
} else {
// $attributes_price_final += $pre_selected->fields["options_values_price"];
$attributes_price_final += zen_get_discount_calc($pre_selected->fields["products_id"], $pre_selected->fields["products_attributes_id"], $pre_selected->fields["options_values_price"] + ($prod_priced_by_attr ? zen_products_lookup($pre_selected->fields["products_id"], 'products_price') : 0)) - ($prod_price_by_attr && !$include_products_price_in ? zen_products_lookup($pre_selected->fields["products_id"], 'products_price') : 0);
}
I may propose some rewriting for clarity, but the above functionality is what it seems like is expected, unless others find problem with the resulting displayed values.
EDIT: I would actually like to resequence the parameters; however, one of those things where others may have built off of the originally provided function and changing parameters would have an undesirable effect, unfortunately.
Bookmarks