PHP code example of silvercommerce / geozones

1. Go to this page and download the library: Download silvercommerce/geozones library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

silvercommerce / geozones example snippets


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")
        )
    ),
    $