Allora premetto che utilizzo la totalb2b di hozone la cui funzione finale che calcola il prezzo di un prodotto è:
Codice: Seleziona tutto
function tep_xppp_getproductprice($products_id) {
global $customer_id;
$customer_query = tep_db_query("select g.customers_groups_price 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 . "'");
$customer_query_result = tep_db_fetch_array($customer_query);
$customer_price = $customer_query_result['customers_groups_price'];
$products_price_list_b2b = tep_xppp_getpricelist("");
$product_info_query = tep_db_query("select products_id, " . $products_price_list_b2b . " from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'");
$product_info = tep_db_fetch_array($product_info_query);
if ($product_info['products_price_' . $customer_price] == NULL) {
$product_info['products_price_' . $customer_price] = $product_info['products_price'];
}
if ((int)$customer_price != 1) {
$product_info['products_price'] = $product_info['products_price_' . $customer_price];
}
return $product_info['products_price'];
}
Vi riporto uno stalcio di una funzione con una prova mia che evidenzierò in rosso:
Ora io in pratica vorrei che il $product_check['products_price'] sia quello derivante dai calcoli della b2b di hozone. Io ho provato (in rosso) ma con scarsi risultati, come posso fare ciò?function tep_get_products_display_price($products_id, $prefix_tag=false, $value_price_only=false, $include_units=true) {
global $currencies, $customer_id;
$product_check_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_priced_by_attribute, product_is_free, product_is_call, product_is_showroom_only from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'" . " limit 1");
$product_check = tep_db_fetch_array($product_check_query);
$product_check['products_price'] = tep_xppp_getproductprice($product_check['products_id']);
$display_price='';
$value_price=0;
// Price is either normal or priced by attributes
if ($product_check['products_priced_by_attribute']) {
$attributes_priced=tep_get_products_base_price($products_id, $include_units);
$display_price=$currencies->display_price( ($product_check['products_price'] + $attributes_priced), tep_get_tax_rate($product_check['products_tax_class_id']), '1');
$value_price=($product_check['products_price'] + $attributes_priced);
} else {
if ($product_check['products_price'] !=0) {
$display_price=$currencies->display_price($product_check['products_id'], $product_check['products_price'], tep_get_tax_rate($product_check['products_tax_class_id']), '1');
}
}
Grazie in anticipo, jo.