Jump to content
Latest News: (loading..)
Sign in to follow this  

Problem with postcode based shippiong module

Recommended Posts

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
       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