Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

zipcode shipping module


Guest

Recommended Posts

Hi

i found this one: https://apps.oscommerce.com/rR9ja&zipcode-shipping-delivery

no support link mentioned and i was prob blind enough that i could not find the module mentioned

problem with the module is that it has a flaw in that if no zip code is defined it will allow the customer to get free shipping

 

anyone know of a quick hack that can disable the module if it cant calculate a price?

Link to comment
Share on other sites

Hi - OK had that rethink - this one can be  tricky to setup and you can often end up with the situation you are seeing if there's a glitch in the admin.

When it cannot correctly calculate a value it should display:

Postcode Shipping 

No delivery/shipping available to the selected Postcode.

But if you have not set the weights correctly then you can get:

Postcode Shipping 
The delivery/shipping fee cannot be determined at this time $0.00

The trick is to set a big final weight in each zone - something like 10000:10000 - e.g. 4:7,10:10,99:13.50, 10000:10000

If that still does not fix it then here's a code hack that will disable the module if it sees a zero value returned

// class constructor
    function zipship() {
	
	  global $order;

      $this->code = 'zipship';
      $this->title = MODULE_SHIPPING_ZIPSHIP_TEXT_TITLE;
      $this->description = MODULE_SHIPPING_ZIPSHIP_TEXT_DESCRIPTION;
      $this->sort_order = MODULE_SHIPPING_ZIPSHIP_SORT_ORDER;
      $this->icon = '';
      $this->tax_class = MODULE_SHIPPING_ZIPSHIP_TAX_CLASS;
      $this->enabled = ((MODULE_SHIPPING_ZIPSHIP_STATUS == 'True') ? true : false);
      
      // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED!!!
      $this->num_zones = 6;
	  
	  if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ZIPSHIP_ZONE > 0) ) {
        $check_flag = false;
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ZIPSHIP_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
        while ($check = tep_db_fetch_array($check_query)) {
          if ($check['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
        }
		
        if ($check_flag == false) {
          $this->enabled = false;
        }
      }     
		// check for a zero shipping price
		
		if ($this->quote()['methods'][0]['cost'] <= 0){
			  $this->enabled = false;
		}	  
    }
// class methods

 

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