Post by mWall » Thu Jan 20, 2011 1:17 am

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

User avatar
Newbie

Posts

Joined
Sun Nov 08, 2009 5:31 am
Location - Stockholm, Sweden

Post by Qphoria » Thu Jan 20, 2011 1:22 am

It should just default to "none" then... you can try this

add css to your stylesheet

Code: Select all

#zone_id {
visibility:hidden;
}

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by mWall » Thu Jan 20, 2011 1:26 am

Thanks, we'll check this solution out. I'll be back... :-)

// mWall

User avatar
Newbie

Posts

Joined
Sun Nov 08, 2009 5:31 am
Location - Stockholm, Sweden

Post by jbnmedia » Thu Jan 20, 2011 2:36 am

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.

New member

Posts

Joined
Fri Jun 05, 2009 3:08 am
Location - Sweden

Post by Qphoria » Thu Jan 20, 2011 2:45 am

jbnmedia wrote:not working.
not helpful.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jbnmedia » Thu Jan 20, 2011 5:35 am

http://catemp.credoweb.nu/shop/index.ph ... unt/create

still showing zone on create account page and quick checkout

New member

Posts

Joined
Fri Jun 05, 2009 3:08 am
Location - Sweden

Post by Qphoria » Thu Jan 20, 2011 5:40 am

what consists of "Scandinavia" ? It looks like Sweden and Norway.. Both of those countries have different zones.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jbnmedia » Thu Jan 20, 2011 5:59 am

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.

New member

Posts

Joined
Fri Jun 05, 2009 3:08 am
Location - Sweden

Post by mWall » Thu Jan 20, 2011 4:33 pm

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

User avatar
Newbie

Posts

Joined
Sun Nov 08, 2009 5:31 am
Location - Stockholm, Sweden

Post by jbnmedia » Mon Jan 24, 2011 11:12 pm

can anyone help with this ?

New member

Posts

Joined
Fri Jun 05, 2009 3:08 am
Location - Sweden

Post by dbstr » Wed Jan 26, 2011 9:45 pm

jbnmedia wrote:can anyone help with this ?
http://forum.opencart.com/viewtopic.php ... 349#p39711

Request Reviews v1.0 released.


Active Member

Posts

Joined
Sun Aug 30, 2009 12:20 am

Post by Qphoria » Wed Jan 26, 2011 11:15 pm

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" />

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jbnmedia » Thu Feb 03, 2011 3:35 am

It worked =)

New member

Posts

Joined
Fri Jun 05, 2009 3:08 am
Location - Sweden

Post by infarkt » Tue Mar 01, 2011 5:04 am

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?

User avatar
Newbie

Posts

Joined
Fri Feb 25, 2011 6:12 am
Location - Mongolia

Post by infarkt » Wed Mar 02, 2011 3:43 am

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;
	}
}
?>

User avatar
Newbie

Posts

Joined
Fri Feb 25, 2011 6:12 am
Location - Mongolia

Post by ennad » Tue May 15, 2012 6:52 am

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" />

Newbie

Posts

Joined
Sat May 12, 2012 5:49 pm

Post by thelostart » Fri Jul 13, 2012 3:30 am

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 8)

Newbie

Posts

Joined
Fri Jul 13, 2012 2:11 am

Post by gentleman123 » Sat Mar 02, 2013 11:04 pm

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.

Newbie

Posts

Joined
Fri Dec 28, 2012 7:53 pm

Post by paulfeakins » Thu Apr 14, 2016 11:43 pm


For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom
Who is online

Users browsing this forum: No registered users and 111 guests