Skip to content

Commit 5cdea28

Browse files
author
Stanislav Idolov
authored
ENGCOM-2747: Feature australian regions #17516
2 parents 3016dd8 + 407cc51 commit 5cdea28

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

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, 'IN', $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)