Post by nodric » Tue Oct 18, 2011 1:53 am

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.

The Best 4x4xfar


Active Member

Posts

Joined
Wed Jul 06, 2011 10:39 pm

Post by aurevilly » Wed Oct 26, 2011 1:13 am

Solved, but it would be nice if you'd post what solved your problem :)

Cheers,
aurevilly.

User avatar
New member

Posts

Joined
Thu Sep 29, 2011 4:32 am
Location - Sherbrooke, Canada

Post by nodric » Tue Nov 01, 2011 11:39 pm

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

The Best 4x4xfar


Active Member

Posts

Joined
Wed Jul 06, 2011 10:39 pm

Post by aurevilly » Tue Nov 08, 2011 5:02 am

Thanks for your answer!

Happy coding!

User avatar
New member

Posts

Joined
Thu Sep 29, 2011 4:32 am
Location - Sherbrooke, Canada

Post by comprido » Sat Apr 28, 2018 6:42 am

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.

Pedro Martin - websitesbuilder.com.au
Checkout my free extensions: https://www.opencart.com/index.php?rout ... r=comprido


User avatar
New member

Posts

Joined
Mon Sep 10, 2012 11:46 pm
Who is online

Users browsing this forum: No registered users and 29 guests