From 06d7eb4fc10fe6a7e6ef35af333470205dc983d5 Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Sat, 10 May 2014 01:29:54 +0200 Subject: [PATCH] Implemented getDeliveryAddress() --- core/lib/Thelia/Coupon/BaseFacade.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/lib/Thelia/Coupon/BaseFacade.php b/core/lib/Thelia/Coupon/BaseFacade.php index bdc87261d..eac753376 100644 --- a/core/lib/Thelia/Coupon/BaseFacade.php +++ b/core/lib/Thelia/Coupon/BaseFacade.php @@ -20,6 +20,7 @@ use Thelia\Condition\ConditionEvaluator; use Thelia\Core\HttpFoundation\Request; use Thelia\Core\Template\ParserInterface; use Thelia\Core\Template\TemplateHelper; +use Thelia\Model\AddressQuery; use Thelia\Model\Coupon; use Thelia\Model\CouponQuery; use Thelia\Cart\CartTrait; @@ -75,7 +76,12 @@ class BaseFacade implements FacadeInterface */ public function getDeliveryAddress() { - // @todo: Implement getDeliveryAddress() method. + try { + return AddressQuery::create()->findPk($this->getRequest()->getSession()->getOrder()->chosenDeliveryAddress); + } + catch(\Exception $ex) { + throw new \LogicException("Failed to get delivery address (" . $ex->getMessage() . ")"); + } } /**