Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/code/Magento/Directory/Setup/InstallData.php
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,14 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
['BR', 'SE', 'Sergipe'],
['BR', 'TO', 'Tocantins'],
['BR', 'DF', 'Distrito Federal'],
['AU', 'ACT', 'Australian Capital Territory'],
['AU', 'NSW', 'New South Wales'],
['AU', 'VIC', 'Victoria'],
['AU', 'QLD', 'Queensland'],
['AU', 'SA', 'South Australia'],
['AU', 'TAS', 'Tasmania'],
['AU', 'WA', 'Western Australia'],
['AU', 'NT', 'Northern Territory'],
];

foreach ($data as $row) {
Expand Down
22 changes: 22 additions & 0 deletions app/code/Magento/Directory/Setup/UpgradeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
if (version_compare($context->getVersion(), '2.0.2', '<')) {
$this->addCountryRegions($setup, $this->getDataForIndia());
}
if (version_compare($context->getVersion(), '2.0.3', '<')) {
$this->addCountryRegions($setup, $this->getDataForAustralia());
}
}

/**
Expand Down Expand Up @@ -127,6 +130,25 @@ private function getDataForIndia()
];
}

/**
* Australian states data.
*
* @return array
*/
private function getDataForAustralia()
{
return [
['AU', 'ACT', 'Australian Capital Territory'],
['AU', 'NSW', 'New South Wales'],
['AU', 'VIC', 'Victoria'],
['AU', 'QLD', 'Queensland'],
['AU', 'SA', 'South Australia'],
['AU', 'TAS', 'Tasmania'],
['AU', 'WA', 'Western Australia'],
['AU', 'NT', 'Northern Territory']
];
}

/**
* Add country regions data to appropriate tables.
*
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Directory/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_Directory" setup_version="2.0.2">
<module name="Magento_Directory" setup_version="2.0.3">
<sequence>
<module name="Magento_Store"/>
</sequence>
Expand Down