Page 1 of 1
Remove/disable Zone/State?
Posted: Thu Jan 20, 2011 1:17 am
by mWall
Is there any way to remove or disable the required field "Zone" from OpenCart?
In the Scandinavian countries we have absolutely no use whatsoever of Zone/State/Län. All taxes and shipping are the same wherever you live in the country.
// mWall
Re: Remove/disable Zone/State?
Posted: Thu Jan 20, 2011 1:22 am
by Qphoria
It should just default to "none" then... you can try this
add css to your stylesheet
Re: Remove/disable Zone/State?
Posted: Thu Jan 20, 2011 1:26 am
by mWall
Thanks, we'll check this solution out. I'll be back... :-)
// mWall
Re: Remove/disable Zone/State?
Posted: Thu Jan 20, 2011 2:36 am
by jbnmedia
I have now tried that,
I have added it to the stylesheet for the current theme.
catalog/view/template/myskin/stylesheet/stylesheet.css
not working.
Re: Remove/disable Zone/State?
Posted: Thu Jan 20, 2011 2:45 am
by Qphoria
jbnmedia wrote:not working.
not helpful.
Re: Remove/disable Zone/State?
Posted: Thu Jan 20, 2011 5:35 am
by jbnmedia
http://catemp.credoweb.nu/shop/index.ph ... unt/create
still showing zone on create account page and quick checkout
Re: Remove/disable Zone/State?
Posted: Thu Jan 20, 2011 5:40 am
by Qphoria
what consists of "Scandinavia" ? It looks like Sweden and Norway.. Both of those countries have different zones.
Re: Remove/disable Zone/State?
Posted: Thu Jan 20, 2011 5:59 am
by jbnmedia
yes it is sweden we are talking about we dont want to use zone/län when registering account because its the same shipping and payments costs. just disable the the zone/state/län in create account and quick checkout would be nice.
Re: Remove/disable Zone/State?
Posted: Thu Jan 20, 2011 4:33 pm
by mWall
Qphoria wrote:what consists of "Scandinavia" ? It looks like Sweden and Norway.. Both of those countries have different zones.
Yes, both countries have administrative Zones (Län/Fylke) and they are indeed different. But they are
never used in connection with any business or trading. And no properly localized webshops in Scandinavia use zones. Having Zone/State/Län/Fylke as a required field only confuses people and makes them wonder if we know what we're doing.
So, if you or anyone else would please walk us through a detailed description of how to remove/disable this required field, we would be very grateful.
Thanks,
// mWall
Re: Remove/disable Zone/State?
Posted: Mon Jan 24, 2011 11:12 pm
by jbnmedia
can anyone help with this ?
Re: Remove/disable Zone/State?
Posted: Wed Jan 26, 2011 9:45 pm
by dbstr
Re: Remove/disable Zone/State?
Posted: Wed Jan 26, 2011 11:15 pm
by Qphoria
1. EDIT THE FOLLOWING FILES:
catalog/controller/account/create.php
catalog/controller/account/address.php
catalog/controller/checkout/guest_step_1.php
2. IN EACH FILE FIND & REMOVE:
Code: Select all
If ($this->request->post['zone_id'] == 'FALSE') {
$this->error['zone'] = $this->language->get('error_zone');
}
3. EDIT THE FOLLOWING FILES:
catalog/view/theme/YOURTHEME/template/account/create.tpl
catalog/view/theme/YOURTHEME/template/account/address.tpl
catalog/view/theme/YOURTHEME/template/account/guest_step_1.tpl
4. IN EACH FILE FIND:
Code: Select all
<tr>
<td><span class="required">*</span> <?php echo $entry_zone; ?></td>
<td><select name="zone_id">
</select>
<?php if ($error_zone) { ?>
<span class="error"><?php echo $error_zone; ?></span>
<?php } ?></td>
</tr>
5. REPLACE WITH:
Code: Select all
<input type="hidden" name="zone_id" value="0" />
Re: Remove/disable Zone/State?
Posted: Thu Feb 03, 2011 3:35 am
by jbnmedia
It worked =)
Re: Remove/disable Zone/State?
Posted: Tue Mar 01, 2011 5:04 am
by infarkt
That worked but only for billing address, I removed shipping_zones too however when It goes to /index.php?route=checkout/guest_step_2
I get an error message on the top
Code: Select all
Notice: Undefined index: zone_id in /catalog/model/shipping/free.php on line 7
I have free shipping on all of my products, how do I modify my free.php so I don't get this error?
Re: Remove/disable Zone/State?
Posted: Wed Mar 02, 2011 3:43 am
by infarkt
This is the code of free.php how to I change it so It does not check for zones?
Code: Select all
<?php
class ModelShippingFree extends Model {
function getQuote($address) {
$this->load->language('shipping/free');
if ($this->config->get('free_status')) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('free_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')");
if (!$this->config->get('free_geo_zone_id')) {
$status = TRUE;
} elseif ($query->num_rows) {
$status = TRUE;
} else {
$status = FALSE;
}
} else {
$status = FALSE;
}
if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
$status = FALSE;
}
$method_data = array();
if ($status) {
$quote_data = array();
$quote_data['free'] = array(
'id' => 'free.free',
'title' => $this->language->get('text_description'),
'cost' => 0.00,
'tax_class_id' => 0,
'text' => $this->currency->format(0.00)
);
$method_data = array(
'id' => 'free',
'title' => $this->language->get('text_title'),
'quote' => $quote_data,
'sort_order' => $this->config->get('free_sort_order'),
'error' => FALSE
);
}
return $method_data;
}
}
?>
Re: Remove/disable Zone/State?
Posted: Tue May 15, 2012 6:52 am
by ennad
Is there a way to do this in Opencart 1.5.2.1? Some of these files don´t exist in this version. I assume lots have changed..
Qphoria wrote:1. EDIT THE FOLLOWING FILES:
catalog/controller/account/create.php
catalog/controller/account/address.php
catalog/controller/checkout/guest_step_1.php
2. IN EACH FILE FIND & REMOVE:
Code: Select all
If ($this->request->post['zone_id'] == 'FALSE') {
$this->error['zone'] = $this->language->get('error_zone');
}
3. EDIT THE FOLLOWING FILES:
catalog/view/theme/YOURTHEME/template/account/create.tpl
catalog/view/theme/YOURTHEME/template/account/address.tpl
catalog/view/theme/YOURTHEME/template/account/guest_step_1.tpl
4. IN EACH FILE FIND:
Code: Select all
<tr>
<td><span class="required">*</span> <?php echo $entry_zone; ?></td>
<td><select name="zone_id">
</select>
<?php if ($error_zone) { ?>
<span class="error"><?php echo $error_zone; ?></span>
<?php } ?></td>
</tr>
5. REPLACE WITH:
Code: Select all
<input type="hidden" name="zone_id" value="0" />
Re: Remove/disable Zone/State?
Posted: Fri Jul 13, 2012 3:30 am
by thelostart
Hi ennad,
Check:
http://www.opencart.com/index.php?route ... on_id=7283
An extension via VQMod which disables the mandatory setting of the Zone (Region/State) field immediately
EDIT: Also added an option to completely hide the field

Re: Remove/disable Zone/State?
Posted: Sat Mar 02, 2013 11:04 pm
by gentleman123
Qphoria solution is correct however dont forget to edit pages where you edit and save the info
for example admin/controller/sales/customer also delete the code there that qphoria mentioned.
Re: Remove/disable Zone/State?
Posted: Thu Apr 14, 2016 11:43 pm
by paulfeakins