Page 1 of 1

Extension released: Remove Region Dropdown When No Regions

Posted: Tue Jul 17, 2018 5:39 pm
by OC2PS
Go to Extension page

In OpenCart, addresses have a "Region" field. After the user has entered the country, the dropdown is updated to show the regions within that country. So far, so good.

However, for countries without regions, this function is a bit odd. If a country has no regions under it (e.g. Hungary or Singapore), then the dropdown seems to give users contradictory information, saying "Please select", and "No regions" at the same time. This can be very confusing for users.

This extension simply disables the region dropdown for countries that don't have any regions under them.

Installation v 3.0+ and Updates
  1. From OpenCart Admin > Extensions > Extensions Installer, upload the file you have downloaded.
  2. After success message, go to OpenCart Admin > Extensions > Modifications, and click the Refresh button.
Frequently Asked Questions
  1. Does this extension work with my theme? It has been developed for OpenCart Default theme, and should work with most themes that use the same structure.
  2. Does this extension work with Journal 2 theme? Yes.
  3. Does this extension work with OpenCart 3.x? Yes.
  4. Where are the settings? There are none.
  5. I have an idea. Great! Post it as a reply to this thread.
  6. I am having a problem with this extension. Please click Get Support on this page.
If you need me to do a paid customization for your theme, PM me.

I hope you enjoy this extension. Please donate to enable me to maintain and further develop it.

Re: Extension released: Remove Region Dropdown When No Regions

Posted: Mon Sep 24, 2018 10:57 am
by tiredman
Hi there,
Thank you for your extension.
I have installed OC v3.0.2.0 in the default theme and the default store is in the country, Singapore.
Customers are supposed to register before a purchase can be made.
After installing your extension, stage/region for countries like Hungary, the pull-down menu shows at ---None---. That's what it is meant to be.
For Singapore however, it still requires you to choose a Stage/Region before one can proceed further. There is only 1 option to choose, and that's Singapore. Was it meant to be like this, or like the Hungary example above? This appears in the View cart – estimate shipping as well as a customer registers a new account and adds a new address.
For Singapore customers...:
The Add address requirements have 3 compulsory settings for us:
* City: Singapore
* Country: Singapore
* State/Region: Singapore

Do note that I have made the address settings in System -> Localisation -> Countries -> Country Name: Singapore
Address format as:
{firstname} {lastname}

However, City and State/Region still appears in all adddress requirements for Singapore. Did I miss out on something in my settings?
If this is what your extension is meant to be, then that's fine. Please accept this as a feedback to you that for Singapore addresses, it doesn't work.

Re: Extension released: Remove Region Dropdown When No Regions

Posted: Mon Sep 24, 2018 3:40 pm
by OC2PS
That's likely because OpenCart ships with "Singapore" region for "Singapore" country (in the database). You should be able to fix it by deleting Singapore zone from the database.