【www.bbyears.com--magento】
Magento设置Express paypal,在产品详细页面或者购物车页面点击
直接跳转到Paypal结帐页面的时候没有相关运费,而正常的结帐流程运费计算没有问题。
以默认的运输方式Flat Rate来说,可以重写方法(模块重写自己搞定 LOL):
app/code/core/Mage/Paypal/Model/Express/Checkout.php @function returnFromPaypal
在
代码如下
if ($this->_api->getShippingRateCode()) {
if ($code = $this->_matchShippingMethodCode($shippingAddress, $this->_api->getShippingRateCode())) {
// possible bug of double collecting rates :-/
$shippingAddress->setShippingMethod($code)->setCollectShippingRates(true);
}
}
之后加入:
代码如下
if(empty($code)){
$code = "flatrate_flatrate ";
$shippingAddress->setShippingMethod($code)->setCollectShippingRates(true);
}
$code的值可改为各自的首选默认运输方式。
提示,如果有朋友能有更好的解决办法可以留言给我。