Skip to content

Commit 87c7997

Browse files
ENGCOM-2747: Feature australian regions #17516
- Merge Pull Request #17516 from maximbaibakov/magento2:feature_australian_regions - Merged commits: 1. 1b8b012 2. b1fcec4 3. 020ca36 4. ebb517b
2 parents b4b7538 + ebb517b commit 87c7997

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

app/code/Magento/Directory/Setup/InstallData.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,14 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
809809
['BR', 'SE', 'Sergipe'],
810810
['BR', 'TO', 'Tocantins'],
811811
['BR', 'DF', 'Distrito Federal'],
812+
['AU', 'ACT', 'Australian Capital Territory'],
813+
['AU', 'NSW', 'New South Wales'],
814+
['AU', 'VIC', 'Victoria'],
815+
['AU', 'QLD', 'Queensland'],
816+
['AU', 'SA', 'South Australia'],
817+
['AU', 'TAS', 'Tasmania'],
818+
['AU', 'WA', 'Western Australia'],
819+
['AU', 'NT', 'Northern Territory'],
812820
];
813821

814822
foreach ($data as $row) {

app/code/Magento/Directory/Setup/UpgradeData.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
4646
if (version_compare($context->getVersion(), '2.0.2', '<')) {
4747
$this->addCountryRegions($setup, $this->getDataForIndia());
4848
}
49+
if (version_compare($context->getVersion(), '2.0.3', '<')) {
50+
$this->addCountryRegions($setup, $this->getDataForAustralia());
51+
}
4952
}
5053

5154
/**
@@ -127,6 +130,25 @@ private function getDataForIndia()
127130
];
128131
}
129132

133+
/**
134+
* Australian states data.
135+
*
136+
* @return array
137+
*/
138+
private function getDataForAustralia()
139+
{
140+
return [
141+
['AU', 'ACT', 'Australian Capital Territory'],
142+
['AU', 'NSW', 'New South Wales'],
143+
['AU', 'VIC', 'Victoria'],
144+
['AU', 'QLD', 'Queensland'],
145+
['AU', 'SA', 'South Australia'],
146+
['AU', 'TAS', 'Tasmania'],
147+
['AU', 'WA', 'Western Australia'],
148+
['AU', 'NT', 'Northern Territory']
149+
];
150+
}
151+
130152
/**
131153
* Add country regions data to appropriate tables.
132154
*

app/code/Magento/Directory/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Directory" setup_version="2.0.2">
9+
<module name="Magento_Directory" setup_version="2.0.3">
1010
<sequence>
1111
<module name="Magento_Store"/>
1212
</sequence>

0 commit comments

Comments
 (0)