Magento可配置产品价格不根据选项变化,
1.浏览器查看js
<pre name="code" class="javascript">< script type = "text/javascript" >
var spConfig = new Product.Config({
"attributes": {
"502": {
"id": "502",
"code": "shoe_size",
"label": "Shoe Size",
"options": [{
"id": "46",
"label": "3",
"price": "0",
"oldPrice": "0",
"products": ["74"]
},
{
"id": "45",
"label": "4",
"price": "0",
"oldPrice": "0",
"products": ["75"]
},
{
"id": "44",
"label": "5",
"price": "0",
"oldPrice": "0",
"products": ["79"]
},
{
"id": "43",
"label": "6",
"price": "0",
"oldPrice": "0",
"products": ["80"]
},
{
"id": "42",
"label": "7",
"price": "0",
"oldPrice": "0",
"products": ["81"]
},
{
"id": "41",
"label": "8",
"price": "0",
"oldPrice": "0",
"products": ["82"]
},
{
"id": "40",
"label": "9",
"price": "100",//改后
"oldPrice": "100", //改后
"products": ["49"]
}]
}
},
"template": "US$#{price}",
"basePrice": "41.95",
"oldPrice": "41.95",
"productId": "135",
"chooseText": "\u9009\u62e9\u9009\u9879...",
"taxConfig": {
"includeTax": false,
"showIncludeTax": false,
"showBothPrices": false,
"defaultTax": 8.25,
"currentTax": 0,
"inclTaxTitle": "\u542b\u7a0e"
}
}); < /script>/
后台设置 fixed 类型,价格 +100。
到这里提交到购物车,价格OK.
但页面上价格不变化
2.\template\catalog\product\price.phtml页面
<span class="price" id="product-price-<?php echo $_id ?><?php //echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->formatPrice($_finalPrice, false) ?>
</span>
id不要后缀。 注释掉后页面价格正常变化了
|