我在产品中添加了自定义选项作为单选按钮。它在前端显示良好,但在我的自定义选项标签上方,默认显示“无”单选按钮。有没有办法去掉这个。

请检查屏幕截图 -

enter image description here

谢谢。

有帮助吗?

解决方案

使该选项成为必需的。

或者

重写方法 getValuesHtml 在班上 Mage_Catalog_Block_Product_View_Options_Type_Select, ,您需要注释这些行(从第 101 行开始):

    if (!$_option->getIsRequire()) {
             $selectHtml .= '<li><input type="radio" id="options_' . $_option->getId() . '" class="'
            . $class . ' product-custom-option" name="options[' . $_option->getId() . ']"'
            . ($this->getSkipJsReloadPrice() ? '' : ' onclick="opConfig.reloadPrice()"')
            . ' value="" checked="checked" /><span class="label"><label for="options_'
            . $_option->getId() . '">' . $this->__('None') . '</label></span></li>';
    }
许可以下: CC-BY-SA归因
scroll top