You could add a fixed Value into the Sections, where such Values are used, and DISPLAY IT TO HIDDEN,
meaning, the entire Field Section would not longer be visible either, but the matching value is beeing forwarded.
I have collected a few samples, it's possibly not complete, you have to check on other files and replace existing content by use of one or the other 'solution'!
I used the matching DB Numbers for Switzerland and the Canton of AARGAU set as default value.
Modifed registration code:
template/account/register.tpl
Code: Select all
<tr>
<td style="display: none;">State</td>
<td style="display: none;"><input type="hidden" name="zone_id" value="3095">Alle</td>
</tr>
<tr>
<td style="display: none;">Country</span></td>
<td style="display: none;"><input type="hidden" name="country_id" value="204">Schweiz</td>
</tr>
template/account/adress_form.tpl
Code: Select all
<tr>
<td style="display: none;">State</td>
<td style="display: none;"><input type="hidden" name="zone_id" value="3095">Alle</td>
</tr>
<tr>
<td style="display: none;">Country</span></td>
<td style="display: none;"><input type="hidden" name="country_id" value="204">Schweiz</td>
</tr>
template/affiliate/edit.tpl
Code: Select all
<span class="error"><?php echo $error_city; ?></span>
<?php } ?></td>
</tr>
<tr>
<td style="display: none;">Kanton</td>
<td style="display: none;"><input type="hidden" name="zone_id" value="3095">Alle</td>
</tr>
<tr>
<td style="display: none;">Land</span></td>
<td style="display: none;"><input type="hidden" name="country_id" value="204">Schweiz</td>
</tr>
template/checkout/shipping_address.tpl
Code: Select all
<td><span class="required">*</span> <?php echo $entry_city; ?></td>
<td><input type="text" name="city" value="" class="large-field" /></td>
</tr>
<td><select name="country_id" style="display: none;"><option value="204"></option></select></td><td><select name="zone_id" style="display: none;"><option value="3095"></option></select></td>
<tr>
template/checkout/payment_address.tpl
Code: Select all
<tr>
<td><span class="required">*</span> <?php echo $entry_city; ?></td>
<td><input type="text" name="city" value="" class="large-field" /></td>
</tr>
<tr>
<td><select name="country_id" style="display: none;"><option value="204"></option></select></td><td><select name="zone_id" style="display: none;"><option value="3095"></option></select></td>
</tr>
template/affiliate/register.tpl
Code: Select all
<span class="error"><?php echo $error_city; ?></span>
<?php } ?></td>
</tr>
<tr>
<td style="display: none;">Kanton</td>
<td style="display: none;"><input type="hidden" name="zone_id" value="3095">Alle</td>
</tr>
<tr>
<td style="display: none;">Land</span></td>
<td style="display: none;"><input type="hidden" name="country_id" value="204">Schweiz</td>
</tr>
template/checkout/register.tpl
Code: Select all
<span class="required">*</span> <?php echo $entry_city; ?><br />
<input type="text" name="city" value="" class="large-field" />
<br />
<div style="display: none;">Kanton <input type="hidden" name="zone_id" value="3095">Alle</div>
<div style="display: none;">Land <input type="hidden" name="country_id" value="204">Schweiz</div>
<br />
admin/template/sale/customer_form.tpl
---------------------------------------------------
about line 356-359:
Code: Select all
html += '>' + json['zone'][i]['name'] + '</option>';
}
} else {
html += '<option value="3095"><?php echo $text_none; ?></option>';
about line 356-359:
Code: Select all
html += ' <td><span class="required">*</span> <?php echo $entry_zone; ?></td>';
html += ' <td><select name="address[' + address_row + '][zone_id]"><option value="3095" selected><?php echo $this->language->get('text_none'); ?></option></select></td>';
html += ' </tr>';
Check also for other sections, i.E. Guest Shipments without registration, Admin User Account Edit, and so on...
and modify accordingly.
Samples:
Code: Select all
checkout/guest.tpl
-------------------------
<br />
<span class="required">*</span> <?php echo $entry_country; ?><br />
<select name="country_id" class="large-field">
<option value=""><?php echo $text_select; ?></option>
<?php foreach ($countries as $country) { ?>
<?php if ($country['country_id'] == $country_id) { ?>
<option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
<?php } ?>
<?php } ?>
</select>
<br />
<br />
<span class="required">*</span> <?php echo $entry_zone; ?><br />
<select name="zone_id" class="large-field">
</select>
<br />
---
checkout/guest_shipping.tpl
-------------------------------------
<tr>
<td><span class="required">*</span> <?php echo $entry_country; ?></td>
<td><select name="country_id" class="large-field">
<option value=""><?php echo $text_select; ?></option>
<?php foreach ($countries as $country) { ?>
<?php if ($country['country_id'] == $country_id) { ?>
<option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
<?php } ?>
<?php } ?>
</select></td>
</tr>
<tr>
<td><span class="required">*</span> <?php echo $entry_zone; ?></td>
<td><select name="zone_id" class="large-field">
</select></td>
</tr>
Test PIECE AFTER PIECE carefully, before adding another...
Good Luck
Ernie
openshop.li
Tip: You may later remove all unused Coutry/State DB-Lines from your MySql DB, it saves many hundred lines of unused DB-Content.
PS. KANTON means STATE
LAND means COUNTRY