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
Disable State/Province validation
 
limex
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2012-03-18
 

Besides of the 2 posts above, I have a FREE solution. wink
Here is the snippet of \default\template\checkout\cart\shipping.phtml for 1.6.2

This code leaves only the county for selection. State, Town and ZIP are not shown any more.

At line 44 it is starting to get interesting.

<?php if (false): //if($this->getStateActive()): ?>
                
<li>
                    <
label for="region_id"<?php if ($this->isStateProvinceRequired()) echo ' class="required"' ?>><?php if ($this->isStateProvinceRequired()) echo '<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') ?>" style="display:none;"<?php echo ($this->isStateProvinceRequired() ? ' 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->getEstimateRegionId() ?>");
                       
//]]>
                       
</script>
                       
<input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getEstimateRegion()) ?>"  title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
                   </
div>
                </
li>
            
<?php endif; ?>
            <?php 
if (false): //if($this->getCityActive()): ?>
                
<li>
                    <
label for="city"<?php if ($this->isCityRequired()) echo ' class="required"' ?>><?php if ($this->isCityRequired()) echo '<em>*</em>' ?><?php echo $this->__('City'?></label>
                    <
div class="input-box">
                        <
input class="input-text<?php if ($this->isCityRequired()):?> required-entry<?php endif;?>" id="city" type="text" name="estimate_city" value="<?php echo $this->htmlEscape($this->getEstimateCity()) ?>" />
                    </
div>
                </
li>
            
<?php endif; ?>
                
<li style="display: none;">
                    <
label for="postcode"<?php //if ($this->isZipCodeRequired()) echo ' class="required"' ?>><?php if ($this->isZipCodeRequired()) echo '<em>*</em>' ?><?php echo $this->__('Zip/Postal Code') ?></label>
                    
<div class="input-box">
                        <
input class="input-text validate-postcode<?php if (false): //if ($this->isZipCodeRequired()):?> required-entry<?php endif;?>" type="text" id="postcode" name="estimate_postcode" value="<?php  echo "0815" // echo $this->htmlEscape($this->getEstimatePostcode()) ?>" />
                    </
div>
                </
li>
            </
ul>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Danowah
Jr. Member
 
Total Posts:  6
Joined:  2011-09-19
Brisbane
 

Thanks for your response Lisa!  I’ll give this a go.

Hope it works!

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