0
因为我发现在Magento选项框中默认值这里:Magento的属性选项框默认值
/app/design/frontend/default/mytheme/template/catalog/product/view/type/options/configurable.phtml
<select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
<option><?php echo $this->__('Choose an Option...') ?></option>
</select>
它显示“选择选项...”作为默认值
我试试
<script>
$(function() {
$("#attribute525 option:first-child").attr("selected", true); //color
$("#attribute272 option:first-child").attr("selected", true); //size
});
</script>
使默认值每个属性设置为第一个每个属性的选项,
但它不起作用。
您好,感谢您对配置的选项为了答案,但它还是像以前一样向我展示'选择一个选项...',还有另一种方式,那就是不使用硬编码?欢呼声@Slimshadddyyy – user3558854
你可以在这里看到http://inchoo.net/ecommerce/magento/how-to-make-configurable-options-autoselected-on-configurable-product-view-page/ – Slimshadddyyy