Pagina 1 di 1

articolo con spessore maggiore in un ordine, dove sbaglio ?

Inviato: 31/03/2008, 20:53
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;
}

Inviato: 03/04/2008, 22:42
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;