Plugin Directory

Changeset 2815669


Ignore:
Timestamp:
11/10/2022 04:42:27 AM (3 years ago)
Author:
chthnc
Message:

fix: match NZ region codes introduced in WooCommerce 7.1.0

Location:
new-zealand-shipping-zones-for-woocommerce
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • new-zealand-shipping-zones-for-woocommerce/tags/1.0.1/README.txt

    r2812434 r2815669  
    77Tested up to: 6.1
    88Requires PHP: 5.6.2
    9 Stable tag: 1.0.0
     9Stable tag: 1.0.1
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7575No, deactivating or deleting the plugin will not remove the shipping zones. Shipping zones can be manually removed via WooCommerce > Shipping > Shipping Zones.
    7676
     77= Why did my zone regions for North Island and South Island shipping zones disappear? =
     78
     79Region codes were updated in the [WooCommerce 7.1.0 release](https://github.com/woocommerce/woocommerce/pull/35011). Shipping zones configured with this plugin prior to the WooCommerce 7.1.0 release are no longer recognised by WooCommerce.
     80
     81The easiest solution is to manually reassign the correct regions for the North Island and South Island zones.
     82
    7783= Where do the postcodes come from? =
    7884
     
    8187== Changelog ==
    8288
     89= 1.0.1 =
     90
     91* Fix: Update region codes for configuring zone regions in North Island and South Island shipping zones. Affects new installs on WooCommerce 7.1.0+. See [Update New Zealand subdivisions in states.php](https://github.com/woocommerce/woocommerce/pull/35011).
     92
    8393= 1.0 =
    8494
  • new-zealand-shipping-zones-for-woocommerce/tags/1.0.1/api/class-woocommerce-nz-shipping-zones-api.php

    r2392118 r2815669  
    100100
    101101        if ( ! in_array( $zone_name, $all_zone_names, true ) ) {
    102             $regions = $this->get_zone_data( 'nz-regions.json' );
     102            if ( version_compare( WC_VERSION, '7.1.0', '<' ) ) {
     103                $regions = $this->get_zone_data( 'nz-regions-legacy.json' );
     104            } else {
     105                $regions = $this->get_zone_data( 'nz-regions.json' );
     106            }
    103107
    104108            $standard_zone = new WC_Shipping_Zone();
  • new-zealand-shipping-zones-for-woocommerce/tags/1.0.1/api/data/nz-regions.json

    r2392118 r2815669  
    11{
    2     "NL": "2",
    3     "AK": "2",
    4     "WA": "2",
    5     "BP": "2",
    6     "TK": "2",
    7     "GI": "2",
    8     "HB": "2",
    9     "MW": "2",
    10     "WE": "2",
    11     "NS": "3",
    12     "MB": "3",
    13     "TM": "3",
    14     "WC": "3",
    15     "CT": "3",
    16     "OT": "3",
    17     "SL": "3"
     2    "NTL": "2",
     3    "AUK": "2",
     4    "WKO": "2",
     5    "BOP": "2",
     6    "TKI": "2",
     7    "GIS": "2",
     8    "HKB": "2",
     9    "MWT": "2",
     10    "WGN": "2",
     11    "NSN": "3",
     12    "MBH": "3",
     13    "TAS": "3",
     14    "WTC": "3",
     15    "CAN": "3",
     16    "OTA": "3",
     17    "STL": "3"
    1818}
  • new-zealand-shipping-zones-for-woocommerce/tags/1.0.1/woocommerce-nz-shipping-zones.php

    r2812434 r2815669  
    1414 * Plugin URI: https://wordpress.org/plugins/new-zealand-shipping-zones-for-woocommerce/
    1515 * Description: Sets up New Zealand standard and rural shipping zones for WooCommerce.
    16  * Version: 1.0.0
     16 * Version: 1.0.1
    1717 * Author: Daniel Shaw
    1818 * Author URI: https://danielshaw.co.nz/
     
    2424 * Domain Path: /languages
    2525 * WC requires at least: 2.6.0
    26  * WC tested up to: 7.0.1
     26 * WC tested up to: 7.1.0
    2727 */
    2828
     
    3535 * The current plugin version.
    3636 */
    37 define( 'WOOCOMMERCE_NZ_SHIPPING_ZONES_VERSION', '1.0.0' );
     37define( 'WOOCOMMERCE_NZ_SHIPPING_ZONES_VERSION', '1.0.1' );
    3838
    3939/**
  • new-zealand-shipping-zones-for-woocommerce/trunk/README.txt

    r2812434 r2815669  
    77Tested up to: 6.1
    88Requires PHP: 5.6.2
    9 Stable tag: 1.0.0
     9Stable tag: 1.0.1
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7575No, deactivating or deleting the plugin will not remove the shipping zones. Shipping zones can be manually removed via WooCommerce > Shipping > Shipping Zones.
    7676
     77= Why did my zone regions for North Island and South Island shipping zones disappear? =
     78
     79Region codes were updated in the [WooCommerce 7.1.0 release](https://github.com/woocommerce/woocommerce/pull/35011). Shipping zones configured with this plugin prior to the WooCommerce 7.1.0 release are no longer recognised by WooCommerce.
     80
     81The easiest solution is to manually reassign the correct regions for the North Island and South Island zones.
     82
    7783= Where do the postcodes come from? =
    7884
     
    8187== Changelog ==
    8288
     89= 1.0.1 =
     90
     91* Fix: Update region codes for configuring zone regions in North Island and South Island shipping zones. Affects new installs on WooCommerce 7.1.0+. See [Update New Zealand subdivisions in states.php](https://github.com/woocommerce/woocommerce/pull/35011).
     92
    8393= 1.0 =
    8494
  • new-zealand-shipping-zones-for-woocommerce/trunk/api/class-woocommerce-nz-shipping-zones-api.php

    r2392118 r2815669  
    100100
    101101        if ( ! in_array( $zone_name, $all_zone_names, true ) ) {
    102             $regions = $this->get_zone_data( 'nz-regions.json' );
     102            if ( version_compare( WC_VERSION, '7.1.0', '<' ) ) {
     103                $regions = $this->get_zone_data( 'nz-regions-legacy.json' );
     104            } else {
     105                $regions = $this->get_zone_data( 'nz-regions.json' );
     106            }
    103107
    104108            $standard_zone = new WC_Shipping_Zone();
  • new-zealand-shipping-zones-for-woocommerce/trunk/api/data/nz-regions.json

    r2392118 r2815669  
    11{
    2     "NL": "2",
    3     "AK": "2",
    4     "WA": "2",
    5     "BP": "2",
    6     "TK": "2",
    7     "GI": "2",
    8     "HB": "2",
    9     "MW": "2",
    10     "WE": "2",
    11     "NS": "3",
    12     "MB": "3",
    13     "TM": "3",
    14     "WC": "3",
    15     "CT": "3",
    16     "OT": "3",
    17     "SL": "3"
     2    "NTL": "2",
     3    "AUK": "2",
     4    "WKO": "2",
     5    "BOP": "2",
     6    "TKI": "2",
     7    "GIS": "2",
     8    "HKB": "2",
     9    "MWT": "2",
     10    "WGN": "2",
     11    "NSN": "3",
     12    "MBH": "3",
     13    "TAS": "3",
     14    "WTC": "3",
     15    "CAN": "3",
     16    "OTA": "3",
     17    "STL": "3"
    1818}
  • new-zealand-shipping-zones-for-woocommerce/trunk/woocommerce-nz-shipping-zones.php

    r2812434 r2815669  
    1414 * Plugin URI: https://wordpress.org/plugins/new-zealand-shipping-zones-for-woocommerce/
    1515 * Description: Sets up New Zealand standard and rural shipping zones for WooCommerce.
    16  * Version: 1.0.0
     16 * Version: 1.0.1
    1717 * Author: Daniel Shaw
    1818 * Author URI: https://danielshaw.co.nz/
     
    2424 * Domain Path: /languages
    2525 * WC requires at least: 2.6.0
    26  * WC tested up to: 7.0.1
     26 * WC tested up to: 7.1.0
    2727 */
    2828
     
    3535 * The current plugin version.
    3636 */
    37 define( 'WOOCOMMERCE_NZ_SHIPPING_ZONES_VERSION', '1.0.0' );
     37define( 'WOOCOMMERCE_NZ_SHIPPING_ZONES_VERSION', '1.0.1' );
    3838
    3939/**
Note: See TracChangeset for help on using the changeset viewer.