只需添加这段代码在你的
应用程序/设计/前端/预设/ [TEMPLATE_NAME] /template/catalog/product/view.phtml文件 我不得不增加两个新领域对于宽度&高度就这样
<label for="height"><?php echo "Height" ?></label>
<input type="text" name="height" id="height" maxlength="30" value="1" title="<?php echo 'Height' ?>" class="input-text" />
<label for="width"><?php echo "Width" ?></label>
<input type="text" name="width" id="width" maxlength="30" value="1" title="<?php echo 'Width' ?>" class="input-text" />
还添加这些PHP代码
<?php $br_special_price = $_product->getSpecialPrice();
$br_old_price = $_product->getPrice();
$an_id = $_product->getId();
$special_priceID="product-price-".$an_id;
$old_priceID="old-price-".$an_id;
?>
而且这个脚本在文件
<script type="text/javascript">
var mq= 0;
function respondToChange(event) {
mq= Math.ceil($('width').getValue() * $('height').getValue() * <?php echo $br_special_price;?>);
document.getElementById('<?php echo $special_priceID; ?>').innerHTML = '£ '+mq;
mq1= Math.ceil($('width').getValue() * $('height').getValue() * <?php echo $br_old_price;?>);
document.getElementById('<?php echo $old_priceID; ?>').innerHTML = '£ '+mq1;
}
$('width').observe('change', respondToChange);
$('height').observe('change', respondToChange);
</script>
年底有这个代码的问题。您可以在所有产品页面中反映价格。但是你不能将这些更新的特价卖给购物车。旧价值将反映在购物车中。希望任何人更新此代码。
无用然后如果没有反映到购物车 – itsazzad 2013-06-21 14:40:51