Hi,
I'm actually working on a solution for this at the moment, as we dont need zones in Denmark either. But since all the shipping/payment/tax modules are all depending on a geozone, I was thinking about:
* Delete all the danish zones, and make a new one called 'Denmark' (for geozone purposes)
* If the selected country is 'Denmark', hide the zone selection (and auto-select the 'Denmark'-zone).
This way, I don't have to touch anything but the zone() methods, and add a few lines of javascript in a few files.
I would like to hear from Qphoria, as he seems to understand this stuff better than anyone.
I'm actually working on a solution for this at the moment, as we dont need zones in Denmark either. But since all the shipping/payment/tax modules are all depending on a geozone, I was thinking about:
* Delete all the danish zones, and make a new one called 'Denmark' (for geozone purposes)
* If the selected country is 'Denmark', hide the zone selection (and auto-select the 'Denmark'-zone).
This way, I don't have to touch anything but the zone() methods, and add a few lines of javascript in a few files.
I would like to hear from Qphoria, as he seems to understand this stuff better than anyone.
Request Reviews v1.0 released.
A very quick fix:
As described in my previous post, you can remove all the sub-zones for Sweden, and make a new zone called 'Sweden' to not mess up your geo-zone modules (shipping/payment/tax)
When 'Sweden' is selected as country, the zone selection will disappear, but it will make sure the 'Sweden'-zone is chosen.
There are 4 files which requires modification, but it's the same changes to all of them.
-> controller/account/address.php
-> controller/account/create.php
-> controller/checkout/address.php
-> controller/checkout/guest.php
and the respective .tpl files
Note: '57' is country_id for Denmark. You will have to replace it with your id of Sweden. It's 203 by default.
Edit catalog/controller/account/create.php
Find (in function zone(), at the bottom)
Replace with
Edit catalog/view/theme/yourtemplate/template/account/create.tpl
Find:
Replace with:
In the same file, at the bottom, find:
After, insert:
--
Edit: To get rid of the zone name @ invoices and stuff, enter this in the 'Address Format' field for your country:
As described in my previous post, you can remove all the sub-zones for Sweden, and make a new zone called 'Sweden' to not mess up your geo-zone modules (shipping/payment/tax)
When 'Sweden' is selected as country, the zone selection will disappear, but it will make sure the 'Sweden'-zone is chosen.
There are 4 files which requires modification, but it's the same changes to all of them.
-> controller/account/address.php
-> controller/account/create.php
-> controller/checkout/address.php
-> controller/checkout/guest.php
and the respective .tpl files
Note: '57' is country_id for Denmark. You will have to replace it with your id of Sweden. It's 203 by default.
Edit catalog/controller/account/create.php
Find (in function zone(), at the bottom)
Code: Select all
$output .= '<option value="FALSE">' . $this->language->get('text_select') . '</option>';
Code: Select all
$output = '';
if($this->request->get['country_id'] != '57') {
$output .= '<option value="FALSE">' . $this->language->get('text_select') . '</option>';
}
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
<tr id="zoneCheck">
<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
$('select[name=\'zone_id\']').load('index.php?route=account/create/zone&country_id=<?php echo $country_id; ?>&zone_id=<?php echo $zone_id; ?>');
Code: Select all
$(document).ready(function () {
if ($("#country_id").attr('value') == '57') {
$('#zoneCheck').css('display', 'none');
}
$("#country_id").change(function () {
if(this.value == '57') {
$('#zoneCheck').css('display', 'none');
} else {
$('#zoneCheck').css('display', '');
}
});
});
Edit: To get rid of the zone name @ invoices and stuff, enter this in the 'Address Format' field for your country:
Code: Select all
{firstname} {lastname}
{company}
{address_1}
{address_2}
{postcode} {city}
{country}
Request Reviews v1.0 released.
Thanks a lot!
It works great but I have a little question at the bottom of this page:
This last part I dont know where to find?
Best regards,
Mats
It works great but I have a little question at the bottom of this page:
[/color]dbstr wrote:A very quick fix:
As described in my previous post, you can remove all the sub-zones for Sweden, and make a new zone called 'Sweden' to not mess up your geo-zone modules (shipping/payment/tax)
When 'Sweden' is selected as country, the zone selection will disappear, but it will make sure the 'Sweden'-zone is chosen.
There are 4 files which requires modification, but it's the same changes to all of them.
-> controller/account/address.php
-> controller/account/create.php
-> controller/checkout/address.php
-> controller/checkout/guest.php
and the respective .tpl files
Note: '57' is country_id for Denmark. You will have to replace it with your id of Sweden. It's 203 by default.
Edit catalog/controller/account/create.php
Find (in function zone(), at the bottom)Replace withCode: Select all
$output .= '<option value="FALSE">' . $this->language->get('text_select') . '</option>';
Edit catalog/view/theme/yourtemplate/template/account/create.tplCode: Select all
$output = ''; if($this->request->get['country_id'] != '57') { $output .= '<option value="FALSE">' . $this->language->get('text_select') . '</option>'; }
Find: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>
In the same file, at the bottom, find:Code: Select all
<tr id="zoneCheck"> <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>
After, insert:Code: Select all
$('select[name=\'zone_id\']').load('index.php?route=account/create/zone&country_id=<?php echo $country_id; ?>&zone_id=<?php echo $zone_id; ?>');
--Code: Select all
$(document).ready(function () { if ($("#country_id").attr('value') == '57') { $('#zoneCheck').css('display', 'none'); } $("#country_id").change(function () { if(this.value == '57') { $('#zoneCheck').css('display', 'none'); } else { $('#zoneCheck').css('display', ''); } }); });
Edit: To get rid of the zone name @ invoices and stuff, enter this in the 'Address Format' field for your country:
Code: Select all
{firstname} {lastname} {company} {address_1} {address_2} {postcode} {city} {country}
This last part I dont know where to find?
Best regards,
Mats
Log in as admin -> Admin -> Configuration -> Localisation -> Country -> Find Sweden -> Edit
Request Reviews v1.0 released.
Who is online
Users browsing this forum: Orifha and 126 guests