简体   繁体   English

Magento购物车-动态定价

[英]Magento shopping Cart - Dynamic pricing

Basically I am web designer. 基本上我是网页设计师。 I am a newbie to magento CMS. 我是magento CMS的新手。 I am involved in a new magento ecommerce project. 我参与了一个新的magento电子商务项目。

I want to make a dynamic pricing in my products page. 我想在我的产品页面中进行动态定价。

In my site I am selling curtain cloth so i want dynamic billing to be like 在我的网站上,我销售窗帘布,所以我希望动态计费像

user can give width and height of a particular product I have a fixed price for sq.ft. 用户可以给特定产品的宽度和高度,我对平方英尺有固定的价格。 I need to multiply width and height provided by the user to get a square feet value. 我需要将用户提供的宽度和高度相乘才能获得平方英尺的值。

For example please refer this link. 例如,请参考此链接。

Reference site Url: http://www.woodyattcurtains.com/net-curtains-voiles-c2/net-curtains-c3/ellie-white-net-curtains-p3 参考网站网址: http//www.woodyattcurtains.com/net-curtains-voiles-c2/net-curtains-c3/ellie-white-net-curtains-p3

I want my product page exactly like this. 我希望我的产品页面完全像这样。 I had searched many extensions in magento for easily achieving this result. 我在magento中搜索了许多扩展名,以轻松实现此结果。 But was unlucky. 但是很不幸。 Is there any free extensions in magento to achieve this? magento中是否有免费的扩展程序来实现这一目标? Or else, please guide me to develop this result through any sort of coding. 否则,请指导我通过任何编码来开发此结果。

Magento extension Available but it is paid extension Magento扩展名可用,但是付费扩展名

See you URL Below :-- 在下面看到您的网址:-

The Advanced Variation Pricing extension enables dynamic square foot and square meter pricing for Magento. Advanced Variation Pricing扩展模块可为Magento提供动态平方英尺和平方米的定价。 It also provides the ability to offset the dynamic product price by choosing different custom options and variations. 它还可以通过选择不同的自定义选项和变体来抵消动态产品价格。

http://www.micosolutions.com/magento-extensions/advanced-variation-pricing-for-magento http://www.micosolutions.com/magento-extensions/advanced-variation-pricing-for-magento

Just add this piece of code in your 只需将这段代码添加到您的

app/design/frontend/default/[template_NAME]/template/catalog/product/view.phtml file I had add two new fields for width & height Just like this app / design / frontend / default / [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" />

Also add these php code 还要添加这些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;
?>

Also this script at the end of the file 也是该脚本在文件末尾

<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 = '&#163; &nbsp;'+mq;
 mq1= Math.ceil($('width').getValue() * $('height').getValue() * <?php echo $br_old_price;?>);
 document.getElementById('<?php echo $old_priceID; ?>').innerHTML = '&#163; &nbsp;'+mq1;
}
$('width').observe('change', respondToChange);
$('height').observe('change', respondToChange); 
</script>

There is a problem in this code. 这段代码有问题。 you can able to get prices reflected in all product pages. 您可以在所有产品页面上反映价格。 But you can't pass these updated special price to cart. 但是您不能将这些更新的特价传递给购物车。 Older values will be reflected in cart. 较旧的值将反映在购物车中。 Hope anyone update this code. 希望任何人更新此代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM