如何将国家/地区选择更改为magento one step checkout中的输入字段?

时间:2014-03-12 08:27:00

标签: php magento onestepcheckout

billing_fields.phtml 中有

<?php
$billingFields['country_id'] = '
<div class="input-box input-country'.((in_array('country', $formErrors)) ? ' input-error' : '').'">
    <label for="billing:country_id">'.$this->__('Country').' <span class="required">*</span></label><br />
        '.$this->getCountryHtmlSelect('billing').'
</div>';
?>

我只有一个国家/地区和select-tag $ this-&gt; getCountryHtmlSelect(&#39; billing&#39;),而呈现的下拉列表不是用户友好,因为它没有其他选择。我觉得它具有误导性和过时性。我的问题是:

如何在简单(不可编辑)的输入字段中更改上面的代码以显示默认国家/地区

修改 在CBroes getCountryCollection 提示

之后我想出了这个
<?php
$countryCollection = $this->getCountryCollection();
foreach($countryCollection as $country) {
    $country_id = $country['country_id'];
    $countryName = Mage::getModel('directory/country')->load($country_id)->getName();
    $billingFields['country_id'] = '
    <div class="input-box input-country'.((in_array('country', $formErrors)) ? ' input-error' : '').'">
        <label for="billing:country_id">'.$this->__('Country').' </label><br />
            <input type="text" name="billing[country_id]" id="billing:country_id" class="input-text" value="'.$countryName.'" style="width: 83%" readonly="readonly" />
    </div>';
}
?>

前端看起来不错。即使是后端也能识别出给定的值。不幸的是,电子邮件并不适合。那里的国家领域仍然空白。

我缺少什么或如何使此输入合法化,以便magento-emails接受其价值?

0 个答案:

没有答案
相关问题