2012-12-07 29 views
0

我想了解爲什麼我剛剛創建的免費送貨cartrule不適用於所有可用的送貨方式。 我有一種免費的運輸方式,其他(socolissimoflexibilite)不會更改。免費送貨購物車規則不支持socolissimoflexibilite(法國)承運人

有人可以給我一個提示,解釋或一些配置/數據/代碼來檢查socolissimoflexibilite送貨方式? 我的第一項調查將我引向sales/quote_address_rate系列:一個價格改爲0.00€,但不是另一個。

我也查報價送貨地址:其free_shipping字段設置爲1。

幫助?

回答

0

好的我找到了答案: 我們有一個模塊(socolissimoflexibilite)擴展模塊socolissimosimplicitesocolissimoflexibilite重寫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