|
Got this somewhere else but racked my brain for days on this…
I needed to put together a few solutions to make my 1.7.0.2 work.
The account create was not working with either showing the drop down or populating the dropdown with the states.
I first needed to change the onepage.phtml from
</div>
<script type="text/javascript" src="<?php echo $this->getJsUrl('varien/accordion.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/opcheckout.js') ?>"></script>
to:
</div>
<script type="text/javascript" src="<?php echo $this->getJsUrl('varien/accordion.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/opcheckout.js') ?>"></script>
<script type="text/javascript"> countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>
Some posts suggest you remove the style="display:none;" from the register.phtml and I only removed the first one in the state section...heres my code
<div class="field">
<label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
<div class="input-box">
<select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>” class="validate-select">
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
</select>
<script type="text/javascript">
//<![CDATA[
$(’region_id’).setAttribute(’defaultValue’, “<?php echo $this->getFormData()->getRegionId() ?>");
//]]>
</script>
<input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getRegion()) ?>” title="<?php echo $this->__('State/Province') ?>” class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>” style="display:none;" />
</div>
</div>
Then I needed to modify this
app\code\core\Mage\Customer\Block\Form\Register.php
lines 41-45 changed from
protected function _prepareLayout()
{
$this->getLayout()->getBlock(’head’)->setTitle(Mage::helper(’customer’)->__(’Create New Customer Account’));
return parent::_prepareLayout();
}
to
protected function _prepareLayout()
{
$this->setShowAddressFields(true);
$this->getLayout()->getBlock(’head’)->setTitle(Mage::helper(’customer’)->__(’Create New Customer Account’));
return parent::_prepareLayout();
}
Hope this helps! My template is not compatible with 1.7 so I had to do some changes.
|