Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 2
State drop down not showing in Checkout
 
puntable
Member
 
Avatar
Total Posts:  50
Joined:  2011-02-24
Denmark
 

Solution posted by Chris Czyzewicz works perfect (Magento 1.7.0.2).

Thanks man smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
JoeDaddy717
Jr. Member
 
Total Posts:  1
Joined:  2010-05-22
 

Worked perfect for me as well.  Thanks guys!  Magento ver. 1.7.0.2

 
Magento Community Magento Community
Magento Community
Magento Community
 
Heydarian
Member
 
Avatar
Total Posts:  69
Joined:  2009-05-11
Dallas, TX
 
juliang4321 - 25 June 2012 06:58 PM

Chris Czyzewicz - 09 May 2012 04:21 PM
I don\’t know if this is the error you have, but when I loaded the checkout/onepage page, I was getting the same problem with the State dropdown.  I had a firebug error that said countryRegions had not been defined.  I looked in onepage.phtml in the new version, and this line that I had in the old onepage.phtml was missing:
<script type=\"text/javascript\">countryRegions <?php echo $this->helper(\'directory\')->getRegionJson() ?></script>

It goes at the top with these lines:
<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>

That might have been something I manually did before or who knows, but adding that line in my custom template fixed it for me.

I had to modify the code a bit to work on mine. Try this one if the above does not work.

<script type="text/javascript"countryRegions <?php echo $this->helper('directory')->getRegionJson() ?></script>

Your second code fixed my problem too. (Version 1.7)

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
webdez
Jr. Member
 
Total Posts:  1
Joined:  2011-03-26
 

Thankyou so so so so so much Chris Czyzewicz and the rest of you....I had the same problem and is now fixed...yippeeeeee!!

Diana xx grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
jessicaatkins9
Jr. Member
 
Total Posts:  2
Joined:  2012-11-22
 

Solution:
Add this code at the top of the file: /app/design/frontend/base/default/template/ checkout/onepage.phtml

<div class="page-title">
<h1><?php echo $this->__('Checkout') ?></h1>
</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>

Now refresh your magento checkout page, you can see state dropdown.

Thanks & Good Luck !!

 
Magento Community Magento Community
Magento Community
Magento Community
 
thedae2k
Jr. Member
 
Total Posts:  1
Joined:  2012-07-04
 

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.

 
Magento Community Magento Community
Magento Community
Magento Community
 
vbkun
Jr. Member
 
Total Posts:  3
Joined:  2012-07-30
 

I was having the same problem, adding the code

<script type="text/javascript"countryRegions <?php echo $this->helper('directory')->getRegionJson() ?></script>
to the onepage.html solved it partially.

Now i get the dropdown but just for some countries, not all of them. Any clues?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mcsmythe
Jr. Member
 
Total Posts:  2
Joined:  2010-10-20
 

Solution posted by Chris Czyzewicz works perfect (Magento 1.7.0.2) I just wanted to add my 2 bits of thanks. Thanks!! It worked and love the knowledge of the forums. I would be dead in the water without this forum and folks like Chris along with everyone else in the community..

 
Magento Community Magento Community
Magento Community
Magento Community
 
meclotel
Jr. Member
 
Total Posts:  6
Joined:  2011-11-14
 

I have this problem but it only happens on firefox.

Chrome and IE works. On firefox the dropdown for regions doesn’t show up.

I made the fix above but still no fix.

On firebug on the field it shows:

<select id="billing:region_id" class="validate-select" style="display:none;" title="Judetul" name="billing[region_id]" defaultvalue="">

On chrome when i inspect element i get:

<select id="billing:region_id" name="billing[region_id]" title="Judetul" class="validate-select required-entry" style="" defaultvalue="">
Why the difference?

Some help please?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dolciaiuti
Jr. Member
 
Total Posts:  1
Joined:  2011-11-16
 

I just want to say a massive thank you to Chris, you saved me smile

Andrea

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ferligt
Jr. Member
 
Total Posts:  17
Joined:  2011-06-18
 
Chris Czyzewicz - 09 May 2012 04:21 PM

solution

why is there not a thanks button here?
but, thanks!

just needed to remove the backslashes to make it work here.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kramlig
Jr. Member
 
Total Posts:  1
Joined:  2013-07-18
 

Thank you for this.. Its! working. Saves a lot of time.

 
Magento Community Magento Community
Magento Community
Magento Community
 
PATEK56
Jr. Member
 
Total Posts:  3
Joined:  2011-09-23
 
digitalpur - 05 May 2012 02:15 AM

Hello Stuart,


I have just checked. We had a week ago, similar case with a customer.

We have just overwritten the persistent folder in his template.

And then it works great. But do not forget to first make a backup.

Check your Files (persistent or checkout) \app\design\frontend\default\[your Theme]\template
Some files are missing there.


Have a nice weekend

E.Hassan
DIGITALPUR

Thanks for sharing this tip, it solved my problem (checkout process stuck at billing address step).

copied app/design/frontend/base/default/template/checkout folder content into app/design/frontend/default/[my theme]/template/checkout folder. Right on !
Thanks again for your help.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2