use TaxEngine::getDeliveryCountry in delivery loop

This commit is contained in:
Etienne Roudeix
2013-12-20 11:14:04 +01:00
parent 4cb8ba704b
commit 67d0101dbe

View File

@@ -29,6 +29,7 @@ use Thelia\Exception\OrderException;
use Thelia\Model\CountryQuery; use Thelia\Model\CountryQuery;
use Thelia\Module\BaseModule; use Thelia\Module\BaseModule;
use Thelia\Module\DeliveryModuleInterface; use Thelia\Module\DeliveryModuleInterface;
use Thelia\TaxEngine\TaxEngine;
/** /**
* Class Delivery * Class Delivery
@@ -59,7 +60,7 @@ class Delivery extends BaseSpecificModule
throw new \InvalidArgumentException('Cannot found country id: `' . $countryId . '` in delivery loop'); throw new \InvalidArgumentException('Cannot found country id: `' . $countryId . '` in delivery loop');
} }
} else { } else {
$country = CountryQuery::create()->findOneByByDefault(1); $country = TaxEngine::getInstance($this->request->getSession())->getDeliveryCountry();
} }
foreach ($loopResult->getResultDataCollection() as $deliveryModule) { foreach ($loopResult->getResultDataCollection() as $deliveryModule) {