socolissimoflexibilite(法国)运输公司不支持免费送货购物车规则

时间:2012-12-07 10:11:01

标签: magento-1.7 shipping carrier

我试图理解为什么我刚创建的免费送货推车并不适用于所有可用的送货方式。 我有一种免费的送货方式,而另一种(socolissimoflexibilite)没有变化。

有人可以给我一个提示,解释或一些配置/数据/代码来检查socolissimoflexibilite送货方式吗? 我的第一次调查引导我进行sales/quote_address_rate收集:一个费率很好地改为0.00€,但不是另一个。

我还检查了报价送货地址:其free_shipping字段设置为1。

帮助?

1 个答案:

答案 0 :(得分:0)

好的,我找到了答案: 我们有一个扩展模块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;
}

现在,socolissimoflexibilite支持freeShipping规则!

相关问题