<script type="text/javascript">
var spConfig = new Product.Config(<?php echo $this->getJsonConfig(); ?>);
</script>
有了这个:
<?php
// get current drop down string
$currentstring = $this->getJsonConfig();
// create new string with true set to false using str_replace function (string replace)
$newstring = str_replace( '"showBothPrices":true,"', '"showBothPrices":false,"', $currentstring );
?>
<!-- render dropdown but with new var ($newstring) -->
<script type="text/javascript">
var spConfig = new Product.Config(<?php echo $newstring ?>);
</script>
1 回答
我已经得到了一些外部帮助,并提出了解决方案 . 这是基于Magento 1.5.1.0 .
在app / design / frontend / default / YOURTEMPLATE / template / catalog / product / view / type / options /中找到文件configurable.phtml .
替换这个:
有了这个:
这仅适用于可配置产品 . 如果你想为简单产品的自定义选项做同样的事情,只需改变这个:
为了这:
在此文件中:app / design / frontend / default / YOURTEMPLATE / template / catalog / product / view / options / type / select.phtml
希望这可以帮助