在Magento中,如何在商品页面上显示商品的运费?

问题描述

| 我想在Magento的实际产品页面上注明运输费用,以便客户看到要花多少钱。我可以从购物篮页面添加运费估算器。但是我真正想要的是在产品价格下方写上一行文字,说是从XX.XX英镑起 我看过本教程:http://aneeshsreedharan.wordpress.com/2010/04/28/estimating-shipping-rate-on-product-details-page-in-magento/#comment-10,但它不适用于我在Magento 1.4.2上-我认为本教程使用的是较旧的版本。 我目前仅使用一种基于权重的表格费率发送方法。 编辑:我最终解决了这个问题:令人尴尬的是,我没有意识到博客正在剥离格式。它正在将\'更改为' 现在,我可以确认以下代码确实显示了发货情况:
<?php
if($_product->isSaleable())
{
$quote = Mage::getModel(\'sales/quote\');
$quote->getShippingAddress()->setCountryId(\'*\');
$quote->addProduct($_product);
$quote->getShippingAddress()->collectTotals();
$quote->getShippingAddress()->setCollectShippingRates(true);
$quote->getShippingAddress()->collectShippingRates();
$rates = $quote->getShippingAddress()->getShippingRatesCollection();

foreach ($rates as $rate)
{
echo $rate->getPrice();
}
}
?>
    

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)