|
Hi,
I found a solution for the problem (It’s not the Backend-Solution - but perhaps someone can use this, to build a plugin..):
You have to edit 4 files:
- .../checkout/onepage/shipping.phtml
- .../checkout/onepage/billing.phtml
- .../core/Mage/Customer/Model/Adress/Abstract.php
- /skin/frontend/default/default (or your skin)/js/opcheckout.js
billing.phtml:
Comment out this Part:
<div class="input-box"> <label for="billing:region"><?php echo $this->__('State/Province') ?> <span class="required">*</span></label><br/> <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none"> <option value=""><?php echo $this->__('Please select region, state or province') ?></option> </select> <script type="text/javascript"> $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>"); </script> <input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none" /> </div>
shipping.phtml
The same:
<div class="input-box"> <label for="shipping:region_id"><?php echo $this->__('State/Province') ?> <span class="required">*</span></label><br /> <select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none"> <option value=""><?php echo $this->__('Please select region, state or province') ?></option> </select> <script type="text/javascript"> $('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>"); </script> <input type="text" id="shipping:region" name="shipping[region]" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none" /></div>
Abstract.php
Comment out:
if ($this->getCountryModel()->getRegionCollection()->getSize() && !Zend_Validate::is($this->getRegionId(), 'NotEmpty')) { $errors[] = $helper->__('Please enter state/province.'); }
opcheckout.js
There are a few code-blocks you have to comment out.
Around line 330:
if (window.billingRegionUpdater) { billingRegionUpdater.update(); }
Around line 440:
shippingRegionUpdater.update(); $('shipping:region_id').value = $('billing:region_id').value; $('shipping:region').value = $('billing:region').value; //shippingForm.elementChildLoad($('shipping:country_id'), this.setRegionValue.bind(this));
Around line 450:
setRegionValue: function(){ $('shipping:region').value = $('billing:region').value; },
Around line 490:
if (window.shippingRegionUpdater) { shippingRegionUpdater.update(); }
Works for me with version 1.2.1.2
Happy coding…
Cheers
|