Jump to content
Latest News: (loading..)
ghprosvs

Free Shipping On Total Price With Weight Shipping Module

Recommended Posts

Dear,

I'm running this contribution on a test site (xamp) and at localhost/catalog/checkout_shipping.php I receive the below error message:

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, object given in C:\xampp\htdocs\*****\catalog\includes\modules\shipping\zones.php on line 185

below is a piece of code in checkout_shipping.php were the error originates (marked in red).

Apparently this is some old type of PHP coding and replaced by a new type. BUT I lack the knowledge of PHP to be able to update this piece of coding.

Would there be any-one who could help me?

Many thanks! Kind regards

Gerry

 

    // Santosh - Added to select default country if not in listing
     if ($dest_zone == 0) {
       $dest_zone = $this->num_zones;    // the zone is the lastest zone avalaible
     }
     // Santosh - Added to select default country if not in listing
     if ($dest_zone == 0) {
       $error = true;      // this can no more achieve since by default the value is set to the max number of zones
     } else {
       $shipping = -1;
       $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);

       $zones_table = preg_split("/[:,]/" , $zones_cost);
       $size = sizeof($zones_table);

       $free_shipping_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_FREESHIP_" . $dest_zone . "'");

       $free_ship = mysql_fetch_assoc($free_shipping_query);

       $shipping_price = $free_ship['configuration_value'];
        if((tep_db_num_rows($free_shipping_query) != 0 ) && ($shipping_price <= $order->info['total']) && !empty($free_ship['configuration_value'])) {

           $shipping_method = MODULE_SHIPPING_ZONES_FREESHIP_TEXT_WAY . ' ' . $order->delivery['country']['title'] . ': ';
           if ($shipping_num_boxes > 1) {
             $shipping_method .= $shipping_num_boxes . 'x ';
           }
           $shipping_price = 0;
           $shipping_method .= $shipping_price . ' ' . MODULE_SHIPPING_ZONES_FREESHIP_TEXT_UNITS;

       $shipping_cost = 0;

} else {


       for ($i=0; $i<$size; $i+=2) {

         if ($shipping_weight <= $zones_table[$i]) {

           $shipping = $zones_table[$i+1];
           $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $order->delivery['country']['title'] . ': ';
           if ($shipping_num_boxes > 1) {
             $shipping_method .= $shipping_num_boxes . 'x ';
           }
           $shipping_method .= $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS;
           break;
         }
       }

Share this post


Link to post
Share on other sites

Dear greasemonkey,

 

thank you for your reply, it changed it as per your reply, but than I see the below error:

Fatal error: Call to undefined function tep_fetch_array() in C:\xampp\htdocs\UsedGear\catalog\includes\modules\shipping\zones.php on line 185

Any help would be greatly appreciated

 

Kind regards

Gerry

Share this post


Link to post
Share on other sites
1 hour ago, ghprosvs said:

Dear greasemonkey,

 

thank you for your reply, it changed it as per your reply, but than I see the below error:

Fatal error: Call to undefined function tep_fetch_array() in C:\xampp\htdocs\UsedGear\catalog\includes\modules\shipping\zones.php on line 185

Any help would be greatly appreciated

 

Kind regards

Gerry

Sorry yes that was a typo from my phone... try tep_db_fetch_array

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

×