好的,我找到了答案:我们有一个 module( socolissimoflexibilite
) 扩展了该模块socolissimosimplicite
。
socolissimoflexibilite
重写collectRates()
函数,freeShipping
不再支持。我不得不自己重写这部分。对于使用此模块遇到相同问题的人,这里是诀窍:
在Addonline_SoColissimoFlexibilite_Model_Carrier_ShippingMethod
类中,该collectRates()
函数必须替换为以下代码:
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
{
$rates = parent::collectRates($request);
$shippingAddress = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress();
if ($shippingAddress && $shippingAddress->getData('soco_product_code') == 'RDV') {
foreach ($rates->getAllRates() as $rate) {
if ($rate->getCarrier()===$this->_code) {
$rate->setPrice($rate->getPrice()+(int)Mage::getStoreConfig('carriers/socolissimoflexibilite/rdv_fees'));
}
}
}
if($shippingAddress->getFreeShipping()) {
foreach ($rates->getAllRates() as $rate) {
if($rate->getCarrier() === $this->_code) {
$rate->setPrice(0) ;
$rate->setCost(0) ;
}
}
}
return $rates;
}
现在,freeShipping 规则将得到支持socolissimoflexibilite
!