Pagina 1 di 1

Problema RICARICO

Inviato: 29/07/2004, 12:10
da forgyx
-sia con il catalogo in Pdf,

-sia con la funzione "listino completo" (price.php)

vengono messi i prezzi dei prodotti di default!
ma se ad esemprio faccio parte di un gruppo ke ho chiamato "Rivenditori" ke ha dei RICARICHI sui prezzi come devo fare??

Aiutatemiiiiiiiiiiiiiiiiiiiii!!!!!! :?
tnx!

Inviato: 02/08/2004, 13:07
da forgyx
problema risolto,

il vero problema del RICARICO è rappresentato dal modulo B2B di blueDog,
in pratica se imposto in una categoria di prodotti per un gruppo di clienti il 10% e successivamente per un altra categoria sempre dello stesso gruppo di clienti il 5%, facendo 'aggiorna prezzi' mi fa il ricarico del 5% di TUTTI i prodotti!!!!! anke quelli ke invece ho impostato un ricarico diverso!! :?

es.
gruppo VIP:
cavetteria--->10%

aggiorno, ok funziona!
poi metto
accessori--->5%
mi imposta tutto al 5% anke la cavetteria!!


per un altro gruppo, es. TEST
Cavetteria---->15%
poi metto
accessori-->12%
hardware-->18%

mi lascia tutti i prezzi al 15%
anke quelli a cui non sono impostati ricarichi!!

cosa faccio? chiamo l'esorcista???

pvt

Inviato: 02/08/2004, 13:15
da itan80
manda un msg pvt a bluedog ti risponderà sikuramente...

cmq hai visto sui due siti di bluedog se gli era già stato segnalato questo problema?

www.caneblu.com e www.bluedog.it


cia'

Inviato: 03/08/2004, 12:21
da forgyx
ciao!
grazie, ora provo a mandargli un pvt..
poi farò sapere..

Inviato: 04/08/2004, 18:11
da forgyx
è 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?

Inviato: 05/08/2004, 13:17
da BluEdoG
si piu' o meno... in pratica manca l'indicazione delle categorie. allora va modificato così, prova e dimmi se va, da i test fatti in velocità razzo sembra di si ma non ho nemmeno il tempo di provare per bene.
file customers_groups.php riga 121 dalla funzione "updateallprice" fino al commento //apply the b2bsuite to basic price va sostituito con:

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 p.products_price, p.products_id, p.products_percentage, pc.categories_id from ". TABLE_PRODUCTS ." p, ". TABLE_PRODUCTS_TO_CATEGORIES ." pc WHERE pc.products_id = p.products_id  ");
				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);
		 			 $query_discount = tep_db_query("select discount, categories_id from " . TABLE_GROUPS_TO_CATEGORIES . " where customers_group_id = " . $groups_id ." ");
		 			 $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'];
		 			 }       
			    } 

Inviato: 05/08/2004, 16:07
da forgyx
no, non va!
però con grande piacere sono riuscito a risolvere!!!!

e vaiii :D :D :D

oltre alla tua modifica, nella riga 133
dove hai scritto :

Codice: Seleziona tutto

 $query_discount = tep_db_query("select discount, categories_id from " . TABLE_GROUPS_TO_CATEGORIES . " where customers_group_id = " . $groups_id ." "); 
sostituire con

Codice: Seleziona tutto

$query_discount = tep_db_query("select discount from " . TABLE_GROUPS_TO_CATEGORIES . " where customers_group_id = " . $groups_id ." AND categories_id = ". $pricek_values['categories_id'] . ""); 
e tutto finalmente andrà lisco come l'olio :wink: :wink:

testato e funziona, ogni categoria di ogni gruppo avrà il suo "ricarico"!!
senza errori!!!

OT

Inviato: 05/08/2004, 16:09
da forgyx
ops dimenticavo!
grazie BlueDog per l'aiuto istantaneo!!!
(scusate l'OT)

Inviato: 05/08/2004, 16:40
da BluEdoG
Ottimo :)

Inviato: 06/08/2004, 13:48
da forgyx
beh, kissà! a presto allora la nuova versione di b2b fixata :)