Latest News: (loading..)
Sign in to follow this  
Followers 0
alba

Problem with postcode based shippiong module

1 post in this topic

I have a module that for some reason has stopped working and im unable to determine why

 

The code grabs the shipping postcode and then grabs data from a database to populate some variables used in the shipping calulation

 

for some reason this no longer works

 

$topcode = $order->delivery['postcode'];

if ( $topcode == '' ){
// Something is wrong, we didn't find any zone
$this->quotes['error'] = MODULE_SHIPPING_POSTSHIP_NO_POSTCODE_FOUND;
       return $this->quotes;
}

$qResult = tep_db_query("select * from postship_zones where '$topcode' >= s_postcode and '$topcode.' <= s_postcode") ; 
$rec = tep_db_fetch_array($qResult); 

   if ($rec['s_delivery'] = '0') {
$days = 'same';
}
   if ($rec['s_delivery'] = '1') {
$days = 'next';
} else {
$days = $rec['s_delivery'];
}

       $dest_zone = $rec['s_zone'];
       $zones_base = constant('MODULE_SHIPPING_ZONE_' . $dest_zone . '_BASE');
       $zones_rate = constant('MODULE_SHIPPING_ZONE_' . $dest_zone . '_RATE');
       $zones_handling = constant('MODULE_SHIPPING_ZONE_' . $dest_zone . '_HANDLING');
       $zones_fuel = constant('MODULE_SHIPPING_ZONE_' . $dest_zone . '_FUEL');
$zones_fuel_levy = $zones_fuel+1;

 

I i run this sql statement in phpmyadmin it returns the correct data.

 

If i try and echo these variables in the checkout_shipping.php to debug, they dont work.

 

Having said that as an experiment I moved this code to near the top of checkout_shipping.php and ran it and my echo statement returned all the variables.

 

does anyone have any idea whats not right here?

Edited by alba

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0