Voici comment rendre l’excellent module “Kiala Locate And Shipping” compatible avec les promotions “Livraison offerte”

( Attention fonctionne uniquement si l’utilisation des grilles tarifaires est désactivée )

Editer le fichier :
app/code/community/Kiala/LocateAndSelect/Model/Carrier/Kiala.php

La modification est à apporter dans la fonction “CollectRates”

/**
     * Collect rates via the original table rates and adapt to Kiala
     *
     * @param Mage_Shipping_Model_Rate_Request $data
     * @return Mage_Shipping_Model_Rate_Result
     */
    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    {
 
        if (!$this->kialaHelper()->isActive('frontend')) {
            return false;
        }
 
        if ($this->kialaHelper()->useTablerates()) {
            $result = parent::collectRates($request);
            if (!$result) {
                return false;
            }
            $method = current($result->getRatesByCarrier('tablerate'));
            if (!$method) {
                Mage::Log("Tablerate not initialised. To add shipping costs, configure magento's standard Tabelrate  shipping method without activating it.", Zend_Log::INFO, 'kiala.log');
                $method = Mage::getModel('shipping/rate_result_method');
            } else {
                Mage::Log("Reset Tablerate  Rate_Results", Zend_Log::INFO, 'kiala.log');
                $result->reset();
            }
        }
        else {
            Mage::Log("Table Rates disabled.", Zend_Log::INFO, 'kiala.log');
            $result = Mage::getModel('shipping/rate_result');
            $method = Mage::getModel('shipping/rate_result_method');
 
            $price = $this->kialaHelper()->getFlatFeeShippingCost();
 
            /**
             * Si les frais de ports sont offerts, on fixe le prix Kiala à 0
             */
            if ($request->getFreeShipping() === true ) {
                $price = '0.00';
            }
 
            $method->setPrice($price);
            $method->setCost($price);
        }
 
        $kialaPoint = $this->getKialaPoint();
        if ($kialaPoint) {
            Mage::Log("Updating Tablerate  method with KialaPoint details", Zend_Log::INFO, 'kiala.log');
            $method->setCarrier('kiala');
            $method->setCarrierTitle($this->getConfigData('title'));
            $method->setMethod('kiala_' . $kialaPoint->getShortId());
            $method->setMethodTitle($kialaPoint->getName());
            $method->setMethodDescription($kialaPoint->getMethodDescription());
            $result->append($method);
        }
        return $result;
    }

Le module Kiala est alors compatible avec les règles frais de port offerts 🙂