From 749487e9678696de104cee22539a7d690e881481 Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Tue, 17 Jun 2014 00:37:53 +0200 Subject: [PATCH] Added getDeliveryCountry() method --- core/lib/Thelia/Coupon/BaseFacade.php | 10 ++++++++++ core/lib/Thelia/Coupon/FacadeInterface.php | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/core/lib/Thelia/Coupon/BaseFacade.php b/core/lib/Thelia/Coupon/BaseFacade.php index 5794df673..6df4675ea 100644 --- a/core/lib/Thelia/Coupon/BaseFacade.php +++ b/core/lib/Thelia/Coupon/BaseFacade.php @@ -21,6 +21,7 @@ use Thelia\Core\HttpFoundation\Request; use Thelia\Core\Template\ParserInterface; use Thelia\Core\Template\TemplateHelper; use Thelia\Model\AddressQuery; +use Thelia\Model\Country; use Thelia\Model\Coupon; use Thelia\Model\CouponQuery; use Thelia\Cart\CartTrait; @@ -149,6 +150,15 @@ class BaseFacade implements FacadeInterface return $total; } + + /** + * @return Country the delivery country + */ + public function getDeliveryCountry() + { + return $this->getContainer()->get('thelia.taxEngine')->getDeliveryCountry(); + } + /** * Return the Checkout currency EUR|USD * diff --git a/core/lib/Thelia/Coupon/FacadeInterface.php b/core/lib/Thelia/Coupon/FacadeInterface.php index 8a4d004a3..2201dfb69 100644 --- a/core/lib/Thelia/Coupon/FacadeInterface.php +++ b/core/lib/Thelia/Coupon/FacadeInterface.php @@ -18,6 +18,7 @@ use Symfony\Component\Translation\TranslatorInterface; use Thelia\Condition\ConditionEvaluator; use Thelia\Core\HttpFoundation\Request; use Thelia\Core\Template\ParserInterface; +use Thelia\Model\Country; use Thelia\Model\Coupon; /** @@ -51,6 +52,11 @@ interface FacadeInterface */ public function getDeliveryAddress(); + /** + * @return Country the delivery country + */ + public function getDeliveryCountry(); + /** * Return an Customer a CouponManager can process *