@ estrellashopping
i don't know oscaffiate :( so i can't help u
@ wonderboy
try this function for classes/currencies.php i hope it's then things u need:
//TotalB2B start
function display_price($products_id, $products_price, $products_tax, $quantity = 1) {
global $customer_id;
$products_price_ori = $products_price;
$query_price_to_guest = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'ALLOW_GUEST_TO_SEE_PRICES'");
$query_price_to_guest_result = tep_db_fetch_array($query_price_to_guest);
if (($query_price_to_guest_result['configuration_value']=='true') && !(tep_session_is_registered('customer_id'))) {
$query_guest_discount = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'GUEST_DISCOUNT'");
$query_guest_discount_result = tep_db_fetch_array($query_guest_discount);
$customer_discount = $query_guest_discount_result['configuration_value'];
if ($customer_discount >= 0) {
$products_price = $products_price + $products_price * abs($customer_discount) / 100;
} else {
$products_price = $products_price - $products_price * abs($customer_discount) / 100;
}
if ((abs($customer_discount) != 0) && (tep_get_products_special_price($products_id) == "")) {
return "<s>" . $this->format(tep_add_tax($products_price_ori, $products_tax) * $quantity) . "</s> " . $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
} else {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}
} elseif (tep_session_is_registered('customer_id')) {
$query_A = tep_db_query("select m.manudiscount_discount from " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = 0 and m.manudiscount_customers_id = '" . $customer_id . "' and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");
$query_B = tep_db_query("select m.manudiscount_discount from " . TABLE_CUSTOMERS . " c, " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = c.customers_groups_id and m.manudiscount_customers_id = 0 and c.customers_id = '" . $customer_id . "' and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");
$query_C = tep_db_query("select m.manudiscount_discount from " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = 0 and m.manudiscount_customers_id = 0 and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");
if ($query_result = tep_db_fetch_array($query_A)) {
$customer_discount = $query_result['manudiscount_discount'];
} else if ($query_result = tep_db_fetch_array($query_B)) {
$customer_discount = $query_result['manudiscount_discount'];
} else if ($query_result = tep_db_fetch_array($query_C)) {
$customer_discount = $query_result['manudiscount_discount'];
} else {
$query = tep_db_query("select g.customers_groups_discount from " . TABLE_CUSTOMERS_GROUPS . " g inner join " . TABLE_CUSTOMERS . " c on g.customers_groups_id = c.customers_groups_id and c.customers_id = '" . $customer_id . "'");
$query_result = tep_db_fetch_array($query);
$customers_groups_discount = $query_result['customers_groups_discount'];
$query = tep_db_query("select customers_discount from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
$query_result = tep_db_fetch_array($query);
$customer_discount = $query_result['customers_discount'];
$customer_discount = $customer_discount + $customers_groups_discount;
}
if ($customer_discount >= 0) {
$products_price = $products_price + $products_price * abs($customer_discount) / 100;
} else {
$products_price = $products_price - $products_price * abs($customer_discount) / 100;
}
if ((abs($customer_discount) != 0) && (tep_get_products_special_price($products_id) == "")) {
return "<s>" . $this->format(tep_add_tax($products_price_ori, $products_tax) * $quantity) . "</s> " . $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
} else {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}
} else {
return PRICES_LOGGED_IN_TEXT;
}
}