您好,我正在使用 magento 1.7。我有可配置的产品,简单的产品都有自定义选项...我想删除选项旁边的 +$10.00 示例: 自定义选项:大 +$5.00 我希望它显示为大...我仍然希望价格在产品的查看页面上更新。 我尝试编辑 js/varien/product.js 注释掉 str+ 但没有成功
//str+= ' ' + this.formatPrice(excl, true) + ' (' + this.formatPrice(price, true) + ' ' + this.taxConfig.inclTaxTitle + ')';
} else {
//str+= ' ' + this.formatPrice(price, true);
}
}
return str;
},
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
if(showSign){
if(price<0){
//str+= '-';
price = -price;
}
else{
//str+= '+';
}
最佳答案
我在这个问题上苦思冥想了好几个小时,因为它与 CE 1.8 中的可配置产品有关。对我来说,解决方案实际上是在/js/varien/configurable.js 的第 236-258 行中。注释掉以下四行,如图:
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
if(showSign){
if(price<0){
//str+= '-';
price = -price;
}
else{
//str+= '+';
}
}
var roundedPrice = (Math.round(price*100)/100).toString();
if (this.prices && this.prices[roundedPrice]) {
//str+= this.prices[roundedPrice];
}
else {
//str+= this.priceTemplate.evaluate({price:price.toFixed(2)});
}
return str;
},
注释掉上面显示的行的最终效果是下拉列表中给定选项的价格调整消失。我一直在该网站上寻找是否有任何意想不到的后果,但还没有看到任何结果。
关于magento - 如何在 Magento 1.7 中删除自定义选项 +$10.00,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13473305/