if(isset($_POST['action']) && ($_POST['action'] == 'submit')){
if(isset($_POST['shipping_weight'])){
$_SESSION['shipping_weight'] = (int)$_POST['shipping_weight'];
}
if (isset($_POST['zone_country_id'])){
$_SESSION['zone_country_id'] = $_POST['zone_country_id'];
}
zen_redirect(zen_href_link('shipping_estimator'));
exit;
}
if (isset($_SESSION['zone_country_id'])){
$country_info = zen_get_countries($_SESSION['zone_country_id'],true);
$order->delivery = array('country' => array('id' => $_SESSION['zone_country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']), 'country_id' => $_SESSION['zone_country_id']);
} else {
$country_info = zen_get_countries(STORE_COUNTRY,true);
$order->delivery = array('country' => array('id' => STORE_COUNTRY, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']),'country_id' => STORE_COUNTRY);
}
$total_weight = 10;
if(isset($_SESSION['shipping_weight'])){
$total_weight = (int)$_SESSION['shipping_weight'];
}
///////
require(DIR_WS_CLASSES . 'shipping.php');
$shipping_modules = new shipping;
$quotes = $shipping_modules->quote();
$qs = array();
foreach($quotes as $q){
if($q['id'] == 'freeshipper'){
continue;
}else{
$qs[] = $q;
}
}
$quotes = $qs;
///////
// set selections for displaying
$selected_country = $order->delivery['country']['id'];
$free_shipping = false;
$show_in = 'shipping_estimator';