• Resolved luiz.coutinho

    (@luizcoutinho)


    I have found a problem with Canadian Post Codes that can be reproduced.
    Please try it out!
    Canadian post codes are alphanumeric strings, for example: S7N1G8

    To reproduce the problem, create the following scenario:

    Number of post code groups: 1
    Number of state groups: 0
    Number of country groups: 1

    Then add these values to them:

    P1: S7N1G8
    C1: Canada

    In the Shipping Rates use:

    5000|1.00|P1
    5000|2.00|C1

    Then add a product that is less than 5000 in weight (I am using g and mm as units) to the shopping cart.

    If you use the exact post code “S7N1G8” that is defined in the P1, the plugin should return the shipping cost US$1.00, but instead it returns US$2.00 because it matched the country, not the post code. I have also tried to use P1=S7N* but it did not work either!

    I believe this has something to do with the way the Post Code validation is defined for Canada because I did the following experiment and it then worked:

    Change P1 to “33300” and C1 to “United States”… then everything works fine and the valued returned is US$1.00.

    Please investigate.

    https://www.ads-software.com/plugins/woocommerce-apg-weight-and-postcodestatecountry-shipping/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Art Project Group

    (@artprojectgroup)

    WooCommerce – APG Weight and Postcode/State/Country Shipping only support numbered post codes, sorry.

    Kind regards.

    Thread Starter luiz.coutinho

    (@luizcoutinho)

    I may understand that the algorithm was designed to treat only numbers in the postcode… but the reality is that the postcode cannot be treated as pure numbers in general because if they were, the following would result in the same postcode range, and they obviously (hopefully) don’t:
    004*; 04*; 4*

    In addition, I believe the plugin is not aware of the system used in each and every country, which is completely acceptable, so I made an experiment: I pretended Canada switched to numeric values and entered a numeric post code. The validation does not complain about me using 331*… but nevertheless, still, the plugin does not find the match even though it is now purely numeric!

    If the answer to this issue is really that the plugin cannot cope with alpha-numeric postcodes, I would say that this was at least a major design overlook. Numbers are nothing more than a special case of Alpha-numeric values… why not treat postcodes as alpha-numeric since this would work for every single country in the world.

    Because of this design decision, this plugin cannot be used for postcode shipping in the following countries, among others:

    Andorra
    Argentina
    Azerbaijan
    Barbados
    Bermuda
    British Virgin Islands
    Brunei
    Canada
    Cayman Islands
    Falkland Islands
    Guernsey
    Isle of Man
    Jersey
    Latvia
    Lithuania
    Malta
    Moldova
    Netherlands
    Saint Vincent and the Grenadines
    Slovenia
    Somalia
    Swaziland
    United Kingdom
    Venezuela

    As a request for future releases, please, check why numbered postcodes do not work with Canada (and I suspect UK as well) and try to include the above countries by generalizing the treatment of post codes as generic strings.

    By the way, as a side note, the expansion of an interval “nnnnn-NNNNN” into actual individual numbers is just wrong! It may result in thousands of postcodes and exceed the limits of the fields and variables being used. It actually did in my case and I had to use only “*” in my ranges. In the same way that it does not make any sense to expand something like “NNN*” it does not make sense to expand intervals. Please, adapt the logic to cope with intervals instead of turning them into real numbers. This feature would not make any sense with alpha-numeric postcodes either.

    I hope these comments can be considered to improve the plugin in future releases.

    Thanks!!!

    Plugin Author Art Project Group

    (@artprojectgroup)

    This is not the first time ;-). Probably we add it in the next PRO version.

    Kind regards.

    Thread Starter luiz.coutinho

    (@luizcoutinho)

    I will probably buy the PRO version if you add these features!… but meanwhile, I’ll be using the following plugin:

    https://www.ads-software.com/plugins/table-rate-shipping-for-woocommerce/

    Their PRO version already works with alphanumeric postcodes! ??

    Regards.

    Plugin Author Art Project Group

    (@artprojectgroup)

    Perfect.

    Kind regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Canadian Post Code not Working’ is closed to new replies.