è un problema!
cmq ho notato nel file
customers_groups.php nella cartella admin a partire dalla riga 121:
Codice: Seleziona tutto
case 'updateallprice':
$groups_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
//select the basic price
$pricek_array = tep_db_query("select products_price, products_id, products_percentage from ". TABLE_PRODUCTS ." ");
while ($pricek_values = tep_db_fetch_array($pricek_array)) {
//build the application for b2bsuite
$customers_group_query = tep_db_query("select distinct customers_group_id, customers_group_name, customers_group_discount from ". TABLE_CUSTOMERS_GROUPS ." where customers_group_id = '" . $groups_id . "' ");
$customers_group = tep_db_fetch_array($customers_group_query);
if (tep_db_num_rows($customers_group_query) > 0) {
$attributes_query = tep_db_query("select customers_group_id, products_id, customers_group_price, products_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $groups_id . "'AND products_id = '". $pricek_values['products_id'] . "'");
$attributes = tep_db_fetch_array($attributes_query);
qui-->
$query_discount = tep_db_query("select discount from " . TABLE_GROUPS_TO_CATEGORIES . " where customers_group_id = " . $groups_id ." ");
Codice: Seleziona tutto
$query_discount_result = tep_db_fetch_array($query_discount);
if (is_null($query_discount_result['discount'])) {
$ricarico = $customers_group['customers_group_discount'];
} else {
$ricarico = $query_discount_result['discount'];
}
}
//apply the b2bsuite to basic price
$pricek = $pricek_values['products_price'];
//if ($pricek_values['products_percentage'] == '0'){
if ($pricek > 0){
if (B2B == 'true') {
if ($ricarico > 0) $newprice = $pricek+($pricek/100)*$ricarico;
if ($ricarico == 0) $newprice = $pricek;
}
if (B2B == 'false') {
if ($ricarico > 0) $newprice = $pricek-($pricek/100)*$ricarico;
if ($ricarico == 0) $newprice = $pricek;
}
} else {
$newprice = 0;
}
//}
//update the dbase with new values
if ($attributes['customers_group_id'] == NULL ) {
tep_db_query("INSERT INTO " . TABLE_PRODUCTS_GROUPS . " (customers_group_id, customers_group_price, products_id, products_price) values (". $groups_id . ", " . $newprice . ", " . $pricek_values['products_id'] . ", " . $pricek . ")");
} else {
tep_db_query("UPDATE " . TABLE_PRODUCTS_GROUPS . " SET customers_group_price=". $newprice ." WHERE customers_group_id=". $groups_id ." AND products_id=". $pricek_values['products_id'] ."");
}
$count_update++;
$item_updated[$id] = 'updated';
}
$count_item = array_count_values($item_updated);
if ($count_item['updated'] > 0) $messageStack->add($count_item['updated'].' '.TEXT_PRODUCTS_UPDATED . " $count_update " . TEXT_QTY_UPDATED, 'success');
break;
}
}
nella riga evidenziata in blu, manca ke deve prendere il ricarico in base all'id della categoria e non solo in base all'id del gruppo!!!
Se rimanesse così, infatti, applicherebbe la prima % di ricarico ke trova a tutte le categorie!!
sbaglio o è qui l'errore BLueDog?