just wanting to know whether or not you can see any major holes in this thinking Ajeh...
from what i've seen so far, i get the impression that the functions_prices.php file handles most of the price display occurring within ZC. it seems to me that the function zen_get_products_display_price() within this file then handles most of the price display occurring within this file, and after making the mods shown below (starting around line 200 - version 1.38a still - sorry!), i seem to have a pretty workable solution:
PHP Code:
//Begin Mod
$display_normal_price = my_get_wholesaleprice_function(zen_get_products_base_price($products_id));
$display_special_price = my_get_wholesaleprice_function(zen_get_products_special_price($products_id, true));
$display_sale_price = my_get_wholesaleprice_function(zen_get_products_special_price($products_id, false));
//End Mod
all i've done is create a new function_blahblah.php file under the extra_functions directory (i assume this is where they go) and then wrap the original functions in my own custom function called my_get_wholesaleprice_function(), which is shown below. man that's a lot of functions! anyway, in case i'm doing something wildly misguided here it is...
PHP Code:
function oo_get_wholesaleprice($retailPrice) {
global $db;
$wholesalePrice = $retailPrice;
$group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
if ($group_query->fields['customers_group_pricing'] != '0') {
$group_discount = $db->Execute("select group_name, group_percentage from " . TABLE_GROUP_PRICING . "
where group_id = '" . (int)$group_query->fields['customers_group_pricing'] . "'");
if ($group_discount->fields['group_percentage'] > 0) $wholesalePrice = round($wholesalePrice * (1 - ($group_discount->fields['group_percentage'] / 100)), 2);
}
return $wholesalePrice;
}
so far i've found only one location where this is not adequate (shopping cart), however once again, i simply wrapped my function around the query result (before taxes and so on) and everything seems hunky dory. so while i haven't tested this thoroughly, it seems on face value as if it may be sufficient for what tjsantos was looking for, assuming he/she can deal with the fact that the order total module will class it as a discount.
as i am quite happy for the order total module to show the non-group discounted price, and then apply discount separately, as it stands, it seems to work as required. might there be some deep water i'm getting into here without knowing it yet?
cheers
andrejs
Bookmarks