Page 1 of 1

SOLVED - Remove Countries from Estimate Shipping List

Posted: Tue Oct 18, 2011 1:53 am
by nodric
Hi all,

Probably an old question (I did search without result).

I want to remove countries from the list that appears in the drop down on the estimate shipping and taxes section of the shopping cart.

Reason: We only ship standard to the USA, however will ship overseas but need to quote on a case by case basis. We have modified the Free Shipping module to allow non US GeoZones to select the option 'contact me for a shipping quote blah blah'.

We only want the following countries to appear in the Estimate Shipping area, USA and NON USA (we created the latter as a new country).

All countries apart from the USA are currently disable in OC, yet they all still appear in the list. The only GeoZones we have defined are also US only.

Any help appreciated.

Re: SOLVED - Remove Countries from Estimate Shipping List

Posted: Wed Oct 26, 2011 1:13 am
by aurevilly
Solved, but it would be nice if you'd post what solved your problem :)

Cheers,
aurevilly.

Re: SOLVED - Remove Countries from Estimate Shipping List

Posted: Tue Nov 01, 2011 11:39 pm
by nodric
aurevilly wrote:Solved, but it would be nice if you'd post what solved your problem :)

Cheers,
aurevilly.
Sorry about that. In the end it was as simple as clearing the browser cache after making the changes... We live and learn Doh

Re: SOLVED - Remove Countries from Estimate Shipping List

Posted: Tue Nov 08, 2011 5:02 am
by aurevilly
Thanks for your answer!

Happy coding!

Re: SOLVED - Remove Countries from Estimate Shipping List

Posted: Sat Apr 28, 2018 6:42 am
by comprido
So model/localisation/country.php has a line wich explain that the getCountries() function used on the checkout cart.php file just retrieve the STATUS=1 countries from the database:

$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "country WHERE status = '1' ORDER BY name ASC");

Wich means that we don't need to remove any country or zone to remove them from the estimate shipping block on the opencart cart view.

For example, to enable just Australia (ID:13) and Spain (ID:195), is enough with a query like:

UPDATE `oc_zone` SET `status` = '0' WHERE `oc_zone`.`status` = 1;
UPDATE `oc_country` SET `status` = '0' WHERE `oc_country`.`status` = '1'
UPDATE `oc_country` SET `status` = '1' WHERE `oc_country`.`country_id` = '13'
UPDATE `oc_country` SET `status` = '1' WHERE `oc_country`.`country_id` = '195'
UPDATE `oc_zone` SET `status` = '1' WHERE `oc_zone`.`country_id` = 13
UPDATE `oc_zone` SET `status` = '1' WHERE `oc_zone`.`country_id` = 195

Your country list will look like: http://prntscr.com/jb1nr7

Simple.