rendered paste body /* handle this all in a slightly less ridiculous manner than previously - Bryan.. */ if($cz_status = tep_check_named_zone('Overweight-Oversized', 'Exclusive') /* Overweight takes precedence */ ? 'Overweight-Oversized' : (tep_check_named_zone('Free-Shipping', 'Exclusive') ? 'Free-Shipping' : false) ) { $cz_query = tep_db_query(" SELECT cz2.products_id, cz2.shipping_price FROM " . TABLE_CAT_ZONES . " cz LEFT JOIN " . TABLE_CATEGORIES_TO_CAT_ZONES . " cz2 ON (cz2.cat_zone_id=cz.cat_zone_id) WHERE cz.cat_zone_name = '" . $cz_status . "' "); # get entries from whichever zone applies $cz_shipping = $cz_products = 0; while($entry = tep_db_fetch_array($cz_query)) { foreach((array)$cart->get_products() as $k => $v) { $id = (($pos = strpos($v['id'], '{')) !== false) ? substr($v['id'], 0, $pos) : $v['id']; if(!empty($id) && $entry['products_id'] === $id) { $cz_shipping += $entry['shipping_price']; $cz_products++; //break; } } } if($cz_products) { if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); if($cz_status =='Free-Shipping') { $free_shipping == true; $shipping = array('id' => $shipping, 'title' => $order->info['shipping_method'], 'cost' => '0'); } else { $shipping = array('id' => $shipping, 'title' => $quote[0]['methods'][0]['title'], 'cost' => '0'); } $order->info['shipping_cost'] = $quote[0]['methods'][0]['cost'] = $cz_shipping; tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } }