Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Jul 2007
    Posts
    342
    Plugin Contributions
    7

    Default Re: Shipping UK Post codes

    Thank you Dr Byte.
    I have made progress by comparing the shipping zones plugin with the UK Postal Code plugin. I now have the 4 zones showing but the data for zones 2,3 & 4 are not in the database.
    Last edited by ianhg; 20 Mar 2021 at 11:49 AM.

  2. #12
    Join Date
    Jul 2007
    Posts
    342
    Plugin Contributions
    7

    Default Re: Shipping UK Post codes

    Example of latest install

    Attachment 19481
    Attached Images Attached Images  

  3. #13
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    11

    Default Re: Shipping UK Post codes

    ian,
    the problem is in the constructor of the class. if we look at the beginning part of it, there is an early exit if there is no sort order:

    PHP Code:
    function __construct() {
          
    $this->code 'ukpost';
          
    $this->title MODULE_SHIPPING_UKPOST_TEXT_TITLE;
          
    $this->description MODULE_SHIPPING_UKPOST_TEXT_DESCRIPTION;
          
    $this->sort_order defined('MODULE_SHIPPING_UKPOST_SORT_ORDER') ? MODULE_SHIPPING_UKPOST_SORT_ORDER null;
          if (
    null === $this->sort_order) return false
    the num_zones does not get set until the end of the constructor.

    why mike did it this way, i do not know.

    you can either comment out the early return or move the assignment of the num_zones above it. as in:

    PHP Code:
    //from
    if (null === $this->sort_order) return false;
    //to:
    //if (null === $this->sort_order) return false;

    //or to:
    $this->num_zones 4;
    if (
    null === $this->sort_order) return false
    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  4. #14
    Join Date
    Jul 2007
    Posts
    342
    Plugin Contributions
    7

    Default Re: Shipping UK Post codes

    Quote Originally Posted by carlwhat View Post
    ian,
    the problem is in the constructor of the class. if we look at the beginning part of it, there is an early exit if there is no sort order:

    PHP Code:
    function __construct() {
          
    $this->code 'ukpost';
          
    $this->title MODULE_SHIPPING_UKPOST_TEXT_TITLE;
          
    $this->description MODULE_SHIPPING_UKPOST_TEXT_DESCRIPTION;
          
    $this->sort_order defined('MODULE_SHIPPING_UKPOST_SORT_ORDER') ? MODULE_SHIPPING_UKPOST_SORT_ORDER null;
          if (
    null === $this->sort_order) return false
    the num_zones does not get set until the end of the constructor.

    why mike did it this way, i do not know.

    you can either comment out the early return or move the assignment of the num_zones above it. as in:

    PHP Code:
    //from
    if (null === $this->sort_order) return false;
    //to:
    //if (null === $this->sort_order) return false;

    //or to:
    $this->num_zones 4;
    if (
    null === $this->sort_order) return false
    best.
    Thanks Carl Just seen your post. I have it working now, so will submit the plugin as is. This has been bugging me for sometime, thanks for your help.

  5. #15
    Join Date
    Jul 2007
    Posts
    342
    Plugin Contributions
    7

    Default Re: Shipping UK Post codes

    Quote Originally Posted by carlwhat View Post
    ian,
    the problem is in the constructor of the class. if we look at the beginning part of it, there is an early exit if there is no sort order:

    PHP Code:
    function __construct() {
          
    $this->code 'ukpost';
          
    $this->title MODULE_SHIPPING_UKPOST_TEXT_TITLE;
          
    $this->description MODULE_SHIPPING_UKPOST_TEXT_DESCRIPTION;
          
    $this->sort_order defined('MODULE_SHIPPING_UKPOST_SORT_ORDER') ? MODULE_SHIPPING_UKPOST_SORT_ORDER null;
          if (
    null === $this->sort_order) return false
    the num_zones does not get set until the end of the constructor.

    why mike did it this way, i do not know.

    you can either comment out the early return or move the assignment of the num_zones above it. as in:

    PHP Code:
    //from
    if (null === $this->sort_order) return false;
    //to:
    //if (null === $this->sort_order) return false;

    //or to:
    $this->num_zones 4;
    if (
    null === $this->sort_order) return false
    best.
    Thanks Carl this worked better than my efforts, all well and I have resubmitted.

  6. #16
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    11

    Default Re: Shipping UK Post codes

    Quote Originally Posted by ianhg View Post
    Thanks Carl this worked better than my efforts, all well and I have resubmitted.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v151 How do I exclude certain post codes in a sale?
    By Mikec87 in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 25 Jul 2014, 06:28 AM
  2. v150 Only allow delivery to specific post codes
    By mkyle in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 31 Jul 2012, 09:34 PM
  3. Extracting Customer Post Codes From Zen
    By clarkeyi in forum General Questions
    Replies: 1
    Last Post: 22 Apr 2009, 01:54 PM
  4. Shipping costs for Various Post Codes
    By Derek Lamothe in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 1 Oct 2008, 08:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR