【发布时间】:2015-03-09 11:40:03
【问题描述】:
我正在尝试使用 Magento reloadPrice() 和 jQuery 来刷新价格。我有一个带有自定义选项的可配置产品。如果没有 jQuery,该选项的 SELECT 代码是:
<select id="select_281" class=" required-entry product-custom-option" title="" name="options[281]" onchange="opConfig.reloadPrice()">
<option value="0"></option>
<option rel="1" price="0" value="275"></option>
<option rel="2" price="0" value="276"></option>
</select>
使用 jQuery,我删除了 Prototype onchange 代码并尝试计算我的选项的价格(比如 50 美元):
jQuery('#select_281').removeAttr('onchange').change(function(){
//Price of the option to add to a basic price of the conf product
price = 50;
optionsPrice.changePrice('opConfig', price);
optionsPrice.reload();
});
可配置产品的价格:$150。
添加一个选项 (SELECT):我们添加 $50。
新价格$200 显示在产品页面中,但不在购物车页面中:购物车页面仅显示 150 美元,这是不正确的。
有人可以帮忙吗?
最好的问候, 通信。
【问题讨论】: