Post by Andrew_M » Tue Jan 06, 2009 10:24 am

How do you block all countries from ordering except the U.S. and Canada?

Thanks.

New member

Posts

Joined
Sat Jan 03, 2009 1:38 am

Post by Qphoria » Tue Jan 06, 2009 10:44 am

There's not a "good" way to do it currently via the admin menu. That is something planned for 0.8...
For now, the easiest way is to run this sql in your phpmyadmin:

Code: Select all

delete from country where `name` != 'United States' and `name` != 'Canada';

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by fido-x » Tue Jan 06, 2009 10:58 am

Have a look at this thread http://forum.opencart.com/index.php/topic,1613.0.html, since it deals with pretty much the same subject.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Andrew_M » Tue Jan 06, 2009 11:30 am

fido-x wrote: Have a look at this thread http://forum.opencart.com/index.php/topic,1613.0.html, since it deals with pretty much the same subject.
I get this error when I follow those instructions:


Notice: Undefined variable: error_country in /home/x/x/catalog/template/default/content/account_create.tpl on line 86

New member

Posts

Joined
Sat Jan 03, 2009 1:38 am

Post by fido-x » Tue Jan 06, 2009 11:50 am

Add the following line:-

Code: Select all

$view->set('error_country', @$this->error['country']);
after or before

Code: Select all

$view->set('error_city', @$this->error['city']);
in "/catalog/controller/account_create.php" (somewhere around line 89)

EDIT:
Added line should read --

Code: Select all

$view->set('error_country', @$this->error['country_id']);
Last edited by fido-x on Tue Jan 06, 2009 11:55 am, edited 1 time in total.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Andrew_M » Tue Jan 06, 2009 11:56 am

fido-x wrote: Add the following line:-

Code: Select all

$view->set('error_country', @$this->error['country']);
after or before

Code: Select all

$view->set('error_city', @$this->error['city']);
in "/catalog/controller/account_create.php" (somewhere around line 89)

EDIT:
Added line should read --

Code: Select all

$view->set('error_country', @$this->error['country_id']);
Okay, and by making these modifications it will block all countries except U.S. and Canada?

Thanks.

New member

Posts

Joined
Sat Jan 03, 2009 1:38 am

Post by fido-x » Tue Jan 06, 2009 12:03 pm

This will not necessarily "block" countries other than US or Canada, but will flag an error and prevent the creation of an account if the address is outside the US or Canada.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Andrew_M » Tue Jan 06, 2009 10:15 pm

fido-x wrote: This will not necessarily "block" countries other than US or Canada, but will flag an error and prevent the creation of an account if the address is outside the US or Canada.
No error pops up when I attempt to create an account with an address outside the U.S. or Canada. It just does not continue.

Isn't there supposed to be an error?

New member

Posts

Joined
Sat Jan 03, 2009 1:38 am

Post by fido-x » Wed Jan 07, 2009 8:04 am

Andrew_M wrote: No error pops up when I attempt to create an account with an address outside the U.S. or Canada. It just does not continue.

Isn't there supposed to be an error?
If you have followed the instructions properly, you should be getting an error message.

You stated earlier in this thread that you were getting an error--
Andrew_M wrote: Notice: Undefined variable: error_country in /home/x/x/catalog/template/default/content/account_create.tpl on line 86
The original line 86 in RC5 reads --

Code: Select all

</select></td>
Your edited line 86 should read --

Code: Select all

</select><?php if ($error_country) { ?><span class="error"><?php echo $error_country; ?></span><?php } ?></td>
In other words place the inserted code between the and . If you have placed it before the or after the then it will not display.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Andrew_M » Wed Jan 07, 2009 10:35 am

Yes I have edited account_create.tpl and edited line 86 to make it look like

Code: Select all

</select><?php if ($error_country) { ?><span class="error"><?php echo $error_country; ?></span><?php } ?></td>
but it still will not show me an error it will just not continue.

New member

Posts

Joined
Sat Jan 03, 2009 1:38 am

Post by fido-x » Mon Jan 12, 2009 10:39 am

Apologies for not responding sooner to your last post, I've been away from the Internet for a few days. The instructions you have been given, although originally written for 0.7.7, will work in the current version (0.7.9RC6). If you're not getting an error message, you must have missed something (maybe the language file?).

All I can suggest is to go over what you've been told and make sure you have followed the instructions properly.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Mon Jan 12, 2009 10:46 am

fido-x wrote: Apologies for not responding sooner to your last post, I've been away from the Internet for a few days.
HOW DARE YOU! WE ARE DOCKING YOUR PAY

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by fido-x » Mon Jan 12, 2009 11:22 am

Qphoria wrote: HOW DARE YOU! WE ARE DOCKING YOUR PAY
LOL :D Pay? You mean I'm supposed to be getting paid? ;D

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Andrew_M » Mon Feb 02, 2009 9:16 am

That page (http://forum.opencart.com/index.php/topic,1613.0.html) blocks every country except the United States. How do you unblock Canada?

Thanks.

New member

Posts

Joined
Sat Jan 03, 2009 1:38 am

Post by fido-x » Tue Feb 03, 2009 12:52 pm

Andrew_M wrote: That page (http://forum.opencart.com/index.php/topic,1613.0.html) blocks every country except the United States. How do you unblock Canada?

Thanks.
Further down the page that the link goes to (http://forum.opencart.com/index.php/top ... ml#msg7959), you will find this bit of code --

Code: Select all

if ($request->get('country_id') != 38 || $request->get('country_id') != 223) {
  $this->error['country_id'] = $language->get('error_country');
}
Translated into English, the code snippet means -- if the requested country code is not equal to 38 (Canada) OR if the requested country code is not equal to 223 (United States), then output an error.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Tue Feb 03, 2009 1:53 pm

forget this manual nonsense :)

bthirsk has a great contrib for country & zone enable/disable status here:
http://forum.opencart.com/index.php/topic,2887.0.html

Works perfect!

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Andrew_M » Tue Feb 03, 2009 10:45 pm

Qphoria wrote: forget this manual nonsense :)

bthirsk has a great contrib for country & zone enable/disable status here:
http://forum.opencart.com/index.php/topic,2887.0.html

Works perfect!
I'm getting this error when I go to Localization > Country:

Code: Select all

Error: Unknown column 'country_status' in 'field list'
Error No: 1054
select country_id, name, country_status, iso_code_2, iso_code_3 from country order by name asc limit 0, 20

New member

Posts

Joined
Sat Jan 03, 2009 1:38 am

Post by Qphoria » Tue Feb 03, 2009 10:50 pm

Andrew_M wrote:
Qphoria wrote: forget this manual nonsense :)

bthirsk has a great contrib for country & zone enable/disable status here:
http://forum.opencart.com/index.php/topic,2887.0.html

Works perfect!
I'm getting this error when I go to Localization > Country:

Code: Select all

Error: Unknown column 'country_status' in 'field list'
Error No: 1054
select country_id, name, country_status, iso_code_2, iso_code_3 from country order by name asc limit 0, 20
First you need to post in "that" thread as that would be the support thread. Second, you need to read the included readme on the steps needed to execute the included sql file needed to use it.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Andrew_M » Wed Feb 04, 2009 6:16 am

Qphoria wrote:
Andrew_M wrote:
Qphoria wrote: forget this manual nonsense :)

bthirsk has a great contrib for country & zone enable/disable status here:
http://forum.opencart.com/index.php/topic,2887.0.html

Works perfect!
I'm getting this error when I go to Localization > Country:

Code: Select all

Error: Unknown column 'country_status' in 'field list'
Error No: 1054
select country_id, name, country_status, iso_code_2, iso_code_3 from country order by name asc limit 0, 20
First you need to post in "that" thread as that would be the support thread. Second, you need to read the included readme on the steps needed to execute the included sql file needed to use it.
How do you "execute" country.sql?

Could you PLEASE give me step by step instructions? Thanks.

New member

Posts

Joined
Sat Jan 03, 2009 1:38 am

Post by bthirsk » Wed Feb 04, 2009 6:43 am

Log into PHPMyAdmin and open up you database. Click on SQL Query at the top for the screen and a Query box will open. Paste the SQL into this box and press the go button at the bottom.
You will get a confirmation that the query has updated 240 row in country and 3841 in zone.
You are done.
Just logout and have a beer.

Brent


Active Member

Posts

Joined
Wed Sep 03, 2008 11:33 am
Location - Canada
Who is online

Users browsing this forum: No registered users and 2 guests