ho un problemino
se installati insieme
o mi da la scritta chiama per il prezzo
o mi da gli sconti manudiscount
c'e' un modo per farle coesistere?
allego il codice di courrencies.php
Codice: Seleziona tutto
// END EASY CALL FOR PRICE v1.0
//TotalB2B start
function display_price($products_id, $products_price, $products_tax, $quantity = 1) {
define ('CALL_FOR_PRICE_VALUE', 0);
// If you sell products for $0.00 and want to display "Call for Price!" for other products, set their price and the CALL_FOR_PRICE_VALUE to -1.
if ($products_price > CALL_FOR_PRICE_VALUE){
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}else{
define ('CALL_FOR_PRICE_TEXT', 'Registrati');
// You can set CALL_FOR_PRICE_TEXT to anything you want. Its style is determined by the page it is displayed on. Changes made here will be visible throughout your site.
return CALL_FOR_PRICE_TEXT;
}
function display_price($products_id, $products_price, $products_tax, $quantity = 1) {
global $customer_id;
$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;
}
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;
}
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
} else {
return PRICES_LOGGED_IN_TEXT;
}
}
function display_price_nodiscount($products_price, $products_tax, $quantity = 1) {
global $customer_id;
$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'))) || ((tep_session_is_registered('customer_id')))) {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
} else {
return PRICES_LOGGED_IN_TEXT;
}
}
//TotalB2B end
Codice: Seleziona tutto
define ('CALL_FOR_PRICE_VALUE', 0);
// If you sell products for $0.00 and want to display "Call for Price!" for other products, set their price and the CALL_FOR_PRICE_VALUE to -1.
if ($products_price > CALL_FOR_PRICE_VALUE){
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}else{
define ('CALL_FOR_PRICE_TEXT', 'Registrati');
// You can set CALL_FOR_PRICE_TEXT to anything you want. Its style is determined by the page it is displayed on. Changes made here will be visible throughout your site.
return CALL_FOR_PRICE_TEXT;
}