Try the Demo

Magento Forum

   
Page 2 of 2
State drop down not showing in Checkout
 
fevis
Member
 
Total Posts:  45
Joined:  2011-02-24
 

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

Thanks man smile

 Signature 

Devilfish Media | Developing Magento sites

 
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

 Signature 

Joseph
Loose Tea TechE
BigTeaHouse

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

Chris Czyzewicz - 09 May 2012 05: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

 Signature 

@heydarian

 
Magento Community Magento Community
Magento Community
Magento Community
 
ruizoscar1007
Jr. Member
 
Total Posts:  2
Joined:  2012-09-10
 

I have a 1.6 template and working with magento 1.7
<script type="text/javascript"> countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>

this one worked perfectly!!!

 
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
 
Monty22
Guru
 
Avatar
Total Posts:  686
Joined:  2013-01-01
 

When Magento Store is upgraded to latest 1.7 Version then sometimes states drop down while checkout in not show.

First of all check your onepage.phtml of new version then compare this with the same file of older version then you will find that following code lines are missing.

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

Simply paste above mentioned lines in top of onepage.phtml of newer version. It comes like:

<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>

Monty
iLoveMage

Best magento Extensions

 Signature 

Get 15% discount on all our extensions Use code MON15 | Risk-free purchase with our 14 days Money Back Guarantee policy!

 
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 !!

 Signature 

Website Development Company
Web Design Company in New York

 
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:  2
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
 
davidmst
Sr. Member
 
Avatar
Total Posts:  259
Joined:  2012-02-08
 

you can use extension: Easy One Page Checkout . thanks

 Signature 

Free & Paid Magento extensions by MageBay
Mega Dropdown Menu, Left Mega Menu, Accordion and Responsive Menu for Magento. MCP MenuCreatorPro is a great Menu Extension
http://menucreatorpro.com/
http://menucreatorpro.com/livedemo/
http://menucreatorpro.com/livedemo/index.php/admin/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ferligt
Jr. Member
 
Total Posts:  17
Joined:  2011-06-18
 
Chris Czyzewicz - 09 May 2012 05: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
Magento Community
Magento Community
    Back to top
Page 2 of 2