Sometime you want to remove the state/province option in the checkout onepage. Please do as following steps Magento versions (up to Magento CE 1.7)
You have to edit 4 files:
- /checkout/onepage/shipping.phtml
- /checkout/onepage/billing.phtml
- app/core/Mage/Customer/Model/Adress/Abstract.php
-/skin/frontend/default/default (or your skin)/js/opcheckout.js
billing.phtml:
Comment out this Part:
shipping.phtml
The same:
Abstract.php
Comment out:
opcheckout.js
There are a few code-blocks you have to comment out.
Around line 330:
Around line 440:
Around line 450:
Around line 490:
You have to edit 4 files:
- /checkout/onepage/shipping.phtml
- /checkout/onepage/billing.phtml
- app/core/Mage/Customer/Model/Adress/Abstract.php
-/skin/frontend/default/default (or your skin)/js/opcheckout.js
billing.phtml:
Comment out this Part:
01
02
03
04
05
06
07
08
09
10
11
| <div><code> <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> </code></div> <div> |
The same:
1
2
3
4
5
6
7
8
9
| <div><code> <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></code></div> |
Comment out:
1
2
3
4
5
| <div><code> if ( $this ->getCountryModel()->getRegionCollection()->getSize() && !Zend_Validate::is( $this ->getRegionId(), 'NotEmpty' )) { $errors [] = $helper ->__( 'Please enter state/province.' ); } </code></div> <div> |
There are a few code-blocks you have to comment out.
Around line 330:
1
2
3
4
| <div><code> if (window.billingRegionUpdater) { billingRegionUpdater.update(); }</code></div> <div> |
1
2
3
4
| <div><code> 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)); </code></div> |
1
2
3
4
| <div><code> setRegionValue: function (){ $( 'shipping:region' ).value = $( 'billing:region' ).value; },</code></div> <div> |
1
2
3
4
| <div><code> if (window.shippingRegionUpdater) { shippingRegionUpdater.update(); } </code></div> <div> |
Wow! Good suggestion is very useful for the good websites , also helping us for the success in the future. Good manage keep it up.
ReplyDeleteCado Magenge
"http://appdevelopmentcompany.com.au/social-media-optimization.html"
"http://www.appdevelopmentcompany.com.au/email-marketing.html"
”http://www.appdevelopmentcompany.com.au/iphone-application-development.html”
”http://www.appdevelopmentcompany.com.au/magento-development.html”
Sometimes store owners want to remove some states from Magento State/Region list during checkout step because they don't want to ship items to those states. Displaying such states is meaningless. It requires some coding changes. The following blog helped me achieve this.
ReplyDeletehttp://www.demagento.com/magento-how-to-remove-unwanted-states-from-stateregion-list-at-checkout/
Hey,
ReplyDeleteIn magento1.9 is not working what should I do?
I know this for magento 1.7
ReplyDeleteAfter seeing your article I want to say that the presentation is very good and also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts like this.
ReplyDeletePython Online training
python Training in Chennai
Python training in Bangalore
Very cool stuff.Expecting further updates. Java training in Chennai | Certification | Online Course Training | Java training in Bangalore | Certification | Online Course Training | Java training in Hyderabad | Certification | Online Course Training | Java training in Coimbatore | Certification | Online Course Training | Java training in Online | Certification | Online Course Training
ReplyDeletemmorpg oyunlar
ReplyDeleteinstagram takipƧi satın al
tiktok jeton hilesi
Tiktok Jeton Hilesi
antalya saƧ ekimi
TakipƧi
Ä°NSTAGRAM TAKÄ°PĆÄ° SATIN AL
metin2 pvp serverler
Takipci Satın Al
perde modelleri
ReplyDeletesms onay
mobil ƶdeme bozdurma
nft nasıl alınır
ankara evden eve nakliyat
trafik sigortası
dedektƶr
web sitesi kurma
Ask romanlari
Smm Panel
ReplyDeleteSMM PANEL
https://isilanlariblog.com/
instagram takipƧi satın al
hirdavatciburada.com
WWW.BEYAZESYATEKNÄ°KSERVÄ°SÄ°.COM.TR
SERVÄ°S
tiktok jeton hilesi
minecraft premium
ReplyDeleteen son Ƨıkan perde modelleri
nft nasıl alınır
yurtdıÅı kargo
uc satın al
en son Ƨıkan perde modelleri
ƶzel ambulans
lisans satın al
Good content. You write beautiful things.
ReplyDeletetaksi
vbet
sportsbet
hacklink
mrbahis
korsan taksi
mrbahis
vbet
sportsbet
Success Write content success. Thanks.
ReplyDeletekıbrıs bahis siteleri
kralbet
canlı poker siteleri
betmatik
betturkey
betpark
canlı slot siteleri
kocaeli
ReplyDeletekonya
kuÅadası
kĆ¼tahya
malatya
1SHU
aÄrı
ReplyDeleteaksaray
amasya
antep
ardahan
CFZ6T
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
AFL