Where can I the html select tag for countries on the checkout page?
<div class="field form-group">
<label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
<div class="input-box">
<?php echo $this->getCountryHtmlSelect('billing') ?>
</div>
</div>
with this $this->getCountryHtmlSelect('billing')
, it returns the html select tag below,
<select name="billing[country_id]" id="billing:country_id" class="validate-select" title="Country" >
<option value="" > </option>
<option value="AF" >Afghanistan</option><option value="AL" >Albania</option>
<option value="DZ" >Algeria</option>
...
But I need to add a class name to the select
tag,
class="form-control validate-select"
But where can I find this select
tag?
Best Answer
The country select box is prepared by the block,
To change its behavior you just need override the function to you local folder like below.
Just copy the
core\Mage\Checkout\Block\Onepage\Billing.php
to you local folder likelocal\Mage\Checkout\Block\Onepage\Billing.php
Now you just need to put the below code in that file see I have added the "form-control" to
setClass()
function.its done now your class will be added to the select box.