2017 © Pedro Peláez
 

silverstripe-vendormodule geozones

Add generic 'geo-zones' a full list of country specific regions and the ability to categorise them into zones

image

silvercommerce/geozones

Add generic 'geo-zones' a full list of country specific regions and the ability to categorise them into zones

  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 52 % Grown

The README.md

SilverCommerce GeoZones

Scrutinizer Code Quality, (*1)

Adds a list of ISO-3166-2 "Subdivisions" and allows for these to be divided up into "Zones" (which can be used for geographical identicifation), (*2)

The initial list is generated based on data provided by the Debian project. more at:, (*3)

https://salsa.debian.org/iso-codes-team/iso-codes/blob/master/data/iso_3166-2.json, (*4)

NOTE This module just provides data that you can then work with on your SilverStripe project., (*5)

Instalation

Easiest is to install via composer:, (*6)

composer require silvercommerce/geozones

Setup

All GeoZone settings are linked to SiteConfig, to setup new Zones, or add new regions, you can do this by visit site settings and selecting the "GeoZones" tab., (*7)

Region Selection Field

This module also provides a RegionSelectionField which is a simple ajax powered form field that can be used to filter the regions list by a pre-defined country code., (*8)

You can add a RegionSelectionField to your code via the following:, (*9)

use SilverCommerce\GeoZones\Forms\RegionSelectionField;

$form = Form::create(
    $this,
    'PostageForm',
    $fields = FieldList::create(
        DropdownField::create(
            'Country',
            'Country',
            array_change_key_case(
                i18n::getData()->getCountries(),
                CASE_UPPER
            )
        ),
        RegionSelectionField::create(
            "Region",
            "County/State",
            "Country" // name of the field in this form responsible for setting a country code
        )
    ),
    $actions = FieldList::create(
        FormAction::create(
            "doSetPostage",
            _t('SilverCommerce\ShoppingCart.Search', "Search")
        )
    ),
    $required = RequiredFields::create(array(
        "Country",
        "Region"
    ))
);

NOTE You must add a field to the same form that is responsible for setting a valid country code (ISO 3166 2 character) for RegionSelectionField to work., (*10)

The Versions

14/04 2018

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/silvercommerce/geozones

Add generic 'geo-zones' a full list of country specific regions and the ability to categorise them into zones

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe countries iso 3166 regions zones subdivisions

14/04 2018

1.1.0

1.1.0.0 https://github.com/silvercommerce/geozones

Add generic 'geo-zones' a full list of country specific regions and the ability to categorise them into zones

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe countries iso 3166 regions zones subdivisions

05/04 2018

1.0.2

1.0.2.0 https://github.com/silvercommerce/geozones

Add generic 'geo-zones' a full list of country specific regions and the ability to categorise them into zones

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe countries iso 3166 regions zones subdivisions

02/04 2018

1.0.1

1.0.1.0 https://github.com/silvercommerce/geozones

Add generic 'geo-zones' a full list of country specific regions and the ability to categorise them into zones

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe countries iso 3166 regions zones subdivisions

02/04 2018

1.0.0

1.0.0.0 https://github.com/silvercommerce/geozones

Add generic 'geo-zones' a full list of country specific regions and the ability to categorise them into zones

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe countries iso 3166 regions zones subdivisions