From the design standpoint, drop-down is an excellent feature which helps creating cleaner layout and automatically validates the input. While working with Magento 1 or Magento 2, the best example is country and state drop down lists.
Talking about Australia, majority of the older Magento 1 and Magento 2 versions don’t include states drop down list for it. Magento developers need to deal with creating a list of states while adding forms or in the backend configuration. So here, I’ve come up with the SQL script to import Australian states in Magento here!
You may use the SQL script while creating shipping rules, setting a default state for a country, allowing customers to select shipping state in Australia while placing orders, etc. Anything related to Australian states in Magento development and the script is ready for you ?
SQL Script to Import Australian States in Magento:
INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES
(NULL, 'AU', 'NSW', 'New South Wales'),
(NULL, 'AU', 'QLD', 'Queensland'),
(NULL, 'AU', 'VIC', 'Victoria'),
(NULL, 'AU', 'WA', 'Western Australia'),
(NULL, 'AU', 'TAS', 'Tasmania'),
(NULL, 'AU', 'SA', 'South Australia'),
(NULL, 'AU', 'NT', 'Northern Territory'),
(NULL, 'AU', 'ACT', 'Australian Capital Territory')
INSERT INTO directory_country_region_name( locale, region_id, name )
SELECT 'en_US' AS "language", region_id, default_name
WHERE country_id = 'AU'
The implementation is very easy, however, feel free to post your doubts in the comments section below and I’d be happy to help.
Thank you ?
Get Weekly Updates
Never miss Magento tips, tricks, tutorials, and news.
Thank you for subscribing.
Something went wrong.