Php 注册表-前缀为Magento中的单选按钮

Php 注册表-前缀为Magento中的单选按钮,php,forms,magento,registration,Php,Forms,Magento,Registration,如何更改单选按钮中的默认前缀选项。默认代码位于app/design/frontend/base/default/template/customer/widget/name.phtml中,前缀代码为: <?php if ($this->showPrefix()): ?> <div class="field name-prefix"> <label for="<?php echo $this->getFieldId('prefi

如何更改单选按钮中的默认前缀选项。默认代码位于app/design/frontend/base/default/template/customer/widget/name.phtml中,前缀代码为:

<?php if ($this->showPrefix()): ?>
    <div class="field name-prefix">
        <label for="<?php echo $this->getFieldId('prefix')?>"<?php if ($this->isPrefixRequired()) echo ' class="required"' ?>><?php if ($this->isPrefixRequired()) echo '<em>*</em>' ?><?php echo $this->getStoreLabel('prefix') ?></label>
        <div class="input-box">
            <?php if ($this->getPrefixOptions() === false): ?>
                <input type="text" id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" value="<?php echo $this->escapeHtml($this->getObject()->getPrefix()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->getStoreLabel('prefix')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?> />
            <?php else: ?>
                <select id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" title="<?php echo Mage::helper('core')->quoteEscape($this->getStoreLabel('prefix')) ?>" class="<?php echo $this->helper('customer/address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?>>
                <?php foreach ($this->getPrefixOptions() as $_option): ?>
                    <option value="<?php echo $_option?>"<?php if ($this->getObject()->getPrefix()==$_option):?> selected="selected"<?php endif; ?>><?php echo $this->__($_option)?></option>
                <?php endforeach; ?>
                </select>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>

>

编辑基本布局是一个坏主意,因为任何更改都将在下一次Magento更新后消失。 您首先需要将此文件复制到您自己的主题,即。e
app/design/frontend/default/[您的主题]/template/customer/widget/name.phtml

之后,您可以将此代码更改为以下内容:


>

你好,太好了谢谢你,你能看看这里吗?也许你有什么想法?很高兴我能帮忙。请把这篇文章标为答案。那我就要解决你的另一个问题了。