*Bump.* I'm on 1.5.1.
Hopefully not a big deal, but I'd like to find if there's a
known fix to this by now that I can read and implement.
I just noticed I've been receiving similar log notices in
my log file:
[09-May-2014 11:01:24 America/New_York] PHP Warning: Creating default object from empty value in /storeLocation/includes/modules/shipping_estimator.php on line 117
Here's a snippet from shipping_estimator.php, and a little
bookmark code before and after. I've indicated by a
comment where my line 117 is in the code.
PHP Code:
// user not logged in !
if (isset($_POST['zone_country_id'])){
// country is selected
$_SESSION['country_info'] = zen_get_countries($_POST['zone_country_id'],true);
$country_info = $_SESSION['country_info'];
$order->delivery = array('postcode' => $zip_code,
'country' => array('id' => $_POST['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' => $_POST['zone_country_id'],
//add state zone_id
'zone_id' => $state_zone_id,
'format_id' => zen_get_address_format_id($_POST['zone_country_id']));
$_SESSION['cart_country_id'] = $_POST['zone_country_id'];
//add state zone_id
$_SESSION['cart_zone'] = $state_zone_id;
$_SESSION['cart_zip_code'] = $zip_code;
} elseif ($_SESSION['cart_country_id']){
// session is available
$_SESSION['country_info'] = zen_get_countries($_SESSION['cart_country_id'],true);
$country_info = $_SESSION['country_info'];
// fix here - check for error on $cart_country_id
$order->delivery = array('postcode' => $_SESSION['cart_zip_code'],
'country' => array('id' => $_SESSION['cart_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['cart_country_id'],
'zone_id' => $state_zone_id,
'format_id' => zen_get_address_format_id($_SESSION['cart_country_id']));
} else {
// first timer
$_SESSION['cart_country_id'] = STORE_COUNTRY;
$_SESSION['country_info'] = zen_get_countries(STORE_COUNTRY,true);
$country_info = $_SESSION['country_info'];
//**************************
// line 117 follows
//**************************
$order->delivery = array(//'postcode' => '',
'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,
'zone_id' => $state_zone_id,
'format_id' => zen_get_address_format_id($_POST['zone_country_id']));
}
// set the cost to be able to calculate free shipping
$order->info = array('total' => $_SESSION['cart']->show_total(), // TAX ????
'currency' => $currency,
'currency_value'=> $currencies->currencies[$currency]['value']);
}
Warm regards,
Doug