articolo con spessore maggiore in un ordine, dove sbaglio ?

Postate qui discussioni di carattere generale riguardo a problemi di installazione e configurazione di osCommerce

Moderatore: mod Generali

Rispondi
f.monaldi
membro Junior
membro Junior
Messaggi: 10
Iscritto il: 20/07/2007, 14:50
Località: Fano

articolo con spessore maggiore in un ordine, dove sbaglio ?

Messaggio da f.monaldi »

tabella checkout_shipping.php

// spessore massimo presente nell'ordine
$max_products_thickness = 0;
for($t=0; $t < sizeof($order->products); $t++) {
$thickness_query_max = tep_db_query("select max(products_thickness) from " . TABLE_PRODUCTS . " where products_id = '" . $order->products[$t]['id'] . "'");
$thickness_res_max = tep_db_fetch_array($thickness_query_max);
$max_products_thickness = $thickness_res_max;
}
Fabrizio Monaldi
FileMaker Developer
f.monaldi
membro Junior
membro Junior
Messaggi: 10
Iscritto il: 20/07/2007, 14:50
Località: Fano

Messaggio da f.monaldi »

risolto...

// spessore massimo presente nell'ordine
$max_products_thickness = 0;
$max_tmp = 0;
for($t=0; $t < sizeof($order->products); $t++) {
$thickness_query_max = tep_db_query("select products_thickness from " . TABLE_PRODUCTS . " where products_id = '" . $order->products[$t]['id'] . "'");
$thickness_res_max = tep_db_fetch_array($thickness_query_max);

if ( $max_tmp < $thickness_res_max['products_thickness']) {$max_tmp = $thickness_res_max['products_thickness'];}
}

$max_products_thickness = $max_tmp;
Fabrizio Monaldi
FileMaker Developer
Rispondi