Replace Price Difference with Actual Price in Mage

2019-03-18 03:04发布

I have a configurable product with 3 options, see below:

enter image description here

I want to replace the +£24.00 and the +£75.00 with the actual prices of the products.

So instead it would say: £69.00 and £120.00

I have located the code being in js/varien/product.js

I've spent a bit of time chopping and changing the code, but can't quite decipher what needs to change. Line 240 downwards in this file handles the JavaScript events for configurable products.

I'd appreciate any help here.

8条回答
放我归山
2楼-- · 2019-03-18 03:43

In 1.7 (not sure when this was changed) things were changed around. it ends up that the price string is built in PHP, inside Mage/Catalog/Block/Product/View/Options/Abstract.php in the _formatPrice function when called from Mage/Catalog/Block/Product/View/Options/Type/Select.php

Notice that changing any of those 2 classes is going to provoke a change through the site and not just in that specific combo

查看更多
可以哭但决不认输i
3楼-- · 2019-03-18 03:47

This extension might be helpful, I've used it in the past (and it appears to be maintained):

http://www.magentocommerce.com/magento-connect/Matt+Dean/extension/596/simple-configurable-products

查看更多
登录 后发表回答