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
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
It should just default to "none" then... you can try this
add css to your stylesheet
add css to your stylesheet
Code: Select all
#zone_id {
visibility:hidden;
}
http://catemp.credoweb.nu/shop/index.ph ... unt/create
still showing zone on create account page and quick checkout
still showing zone on create account page and quick checkout
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.
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.Qphoria wrote:what consists of "Scandinavia" ? It looks like Sweden and Norway.. Both of those countries have different zones.
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
http://forum.opencart.com/viewtopic.php ... 349#p39711jbnmedia wrote:can anyone help with this ?
Request Reviews v1.0 released.
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:
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:
5. REPLACE WITH:
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');
}
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>
Code: Select all
<input type="hidden" name="zone_id" value="0" />
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
I have free shipping on all of my products, how do I modify my free.php so I don't get this error?
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
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;
}
}
?>
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:3. EDIT THE FOLLOWING FILES:Code: Select all
If ($this->request->post['zone_id'] == 'FALSE') { $this->error['zone'] = $this->language->get('error_zone'); }
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:5. REPLACE WITH: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>
Code: Select all
<input type="hidden" name="zone_id" value="0" />
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
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

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.
for example admin/controller/sales/customer also delete the code there that qphoria mentioned.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Who is online
Users browsing this forum: No registered users and 104 guests