1

In the checkout process of magento, customers are allowed to select countries. In administration in magento administrator is allowed to restricted shipping only to selected or one country, in my case one country which is Bosnia and Herzegovina. Even I have restricted doing business only in my country, i would like to be able to not allowed to customer to change the country to empty field, which is still present.

Bellow is the code:

<select title="Country" class="validate-select" id="billing:country_id" name="billing[country_id]">
<option value=""> </option>
<option selected="selected" value="BA">Bosna i Hercegovina</option>
</select>

I would like to delete, somehow, unnecessary empty option, and that would be the following code:

<option value=""> </option>

Thanks :)

2

a real easy fix will be doing it by css

select.your_class_or_id_of_the_select_element option[value=""] { display :none; }

0

You could also do it like this by adding the following to app/design/frontend/mytheme/default/template/onestepcheckout/checkout.phtml duplicated from the core file:

jQuery("#billing\\:country_id option[value='']").remove();
jQuery("#shipping\\:country_id option[value='']").remove();

This will remove from both shipping and billing forms if the separate form is activated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.