Adventure Documentation

DeliveryCountryController extends CollectionController
in package

This controller describes the behavior of Delivery Countries.

Use the controller to generate a collection of ProductDeliveryCountry entities.

Tags
see
ProductDeliveryCountry

Main entity of collection

Table of Contents

__construct()  : mixed
getCountryState()  : string
If a certain country has states, use this method to fetch the English name of the state by providing the two-letter ISO 3166-2 for the state.
getCountryStates()  : array<string|int, mixed>
Get the states of a country.
klarnaB2BCountriesIso()  : array<string|int, string>
Helper function for Klarna Checkout that has limited country availability with B2B purchases
toFormat()  : string
Given a two-letter ISO 3166-1 alpha-2 country string or instance of ProductDeliveryCountry object it will return it will return the correctly formatted country iso for that country name.

Methods

__construct()

public __construct() : mixed
Tags
Return values
mixed

getCountryState()

If a certain country has states, use this method to fetch the English name of the state by providing the two-letter ISO 3166-2 for the state.

public getCountryState(mixed $state[, mixed $countryIso = 'US' ]) : string

Currently only the United States of America is supported.

Parameters
$state : mixed
$countryIso : mixed = 'US'
Tags
see

DeliveryCountryController/getCountryStates Support method to fetch all states

Return values
string

The English name of the state

getCountryStates()

Get the states of a country.

public getCountryStates([mixed $iso = 'US' ]) : array<string|int, mixed>

Currently only the United States of America is supported.

Parameters
$iso : mixed = 'US'
Tags
see

DeliveryCountryController/getCountryState Support method to fetch the name of a single state

Return values
array<string|int, mixed>

key/value pair of ISO 3166-2 => English name

klarnaB2BCountriesIso()

Helper function for Klarna Checkout that has limited country availability with B2B purchases

public static klarnaB2BCountriesIso() : array<string|int, string>
Tags
Return values
array<string|int, string>

toFormat()

Given a two-letter ISO 3166-1 alpha-2 country string or instance of ProductDeliveryCountry object it will return it will return the correctly formatted country iso for that country name.

public toFormat(mixed $country[, string $format = 'ISO 3166-1 alpha-3' ]) : string

Currently only ISO 3166-1 alpha-3 format is supported.

Parameters
$country : mixed
$format : string = 'ISO 3166-1 alpha-3'
Tags
Return values
string

If found the country in ISO 3166-1 alpha-3 format else empty string


        

Search results