Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Free Shipping On Total Price With Weight Shipping Module


ghprosvs

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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...