diff --git a/core/lib/Thelia/Coupon/BaseFacade.php b/core/lib/Thelia/Coupon/BaseFacade.php index b137fb7ab..bdc87261d 100644 --- a/core/lib/Thelia/Coupon/BaseFacade.php +++ b/core/lib/Thelia/Coupon/BaseFacade.php @@ -18,6 +18,8 @@ use Symfony\Component\Translation\Translator; use Symfony\Component\Translation\TranslatorInterface; use Thelia\Condition\ConditionEvaluator; use Thelia\Core\HttpFoundation\Request; +use Thelia\Core\Template\ParserInterface; +use Thelia\Core\Template\TemplateHelper; use Thelia\Model\Coupon; use Thelia\Model\CouponQuery; use Thelia\Cart\CartTrait; @@ -43,6 +45,9 @@ class BaseFacade implements FacadeInterface /** @var Translator Service Translator */ protected $translator = null; + /** @var ParserInterface The thelia parser */ + private $parser = null; + /** * Constructor * @@ -197,6 +202,23 @@ class BaseFacade implements FacadeInterface return $this->container->get('thelia.translator'); } + /** + * Return platform Parser + * + * @return ParserInterface + */ + public function getParser() + { + if ($this->parser == null) { + $this->parser = $this->container->get('thelia.parser'); + + // Define the current back-office template that should be used + $this->parser->setTemplateDefinition(TemplateHelper::getInstance()->getActiveAdminTemplate()); + } + + return $this->parser; + } + /** * Return the main currency * THe one used to set prices in BackOffice diff --git a/core/lib/Thelia/Coupon/FacadeInterface.php b/core/lib/Thelia/Coupon/FacadeInterface.php index 35b0c3891..40e4e2948 100644 --- a/core/lib/Thelia/Coupon/FacadeInterface.php +++ b/core/lib/Thelia/Coupon/FacadeInterface.php @@ -17,6 +17,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Translation\TranslatorInterface; use Thelia\Condition\ConditionEvaluator; use Thelia\Core\HttpFoundation\Request; +use Thelia\Core\Template\ParserInterface; use Thelia\Model\Coupon; /** @@ -129,6 +130,12 @@ interface FacadeInterface * @return TranslatorInterface */ public function getTranslator(); + /** + * Return platform ParserInterface + * + * @return ParserInterface + */ + public function getParser(); /** * Return the main currency diff --git a/core/lib/Thelia/Coupon/Type/RemoveXAmount.php b/core/lib/Thelia/Coupon/Type/RemoveXAmount.php index d8d473963..5ee212b27 100644 --- a/core/lib/Thelia/Coupon/Type/RemoveXAmount.php +++ b/core/lib/Thelia/Coupon/Type/RemoveXAmount.php @@ -33,7 +33,7 @@ class RemoveXAmount extends CouponAbstract { return $this->facade ->getTranslator() - ->trans('Remove X amount to total cart', array(), 'coupon'); + ->trans('Fixed Amount Discount', array(), 'coupon'); } /** @@ -45,7 +45,7 @@ class RemoveXAmount extends CouponAbstract { return $this->facade ->getTranslator() - ->trans('Amount removed from the cart', array(), 'coupon'); + ->trans('Discount amount', array(), 'coupon'); } /** @@ -58,7 +58,7 @@ class RemoveXAmount extends CouponAbstract $toolTip = $this->facade ->getTranslator() ->trans( - 'This coupon will remove the entered amount to the customer total checkout. If the discount is superior to the total checkout price the customer will only pay the postage. Unless if the coupon is set to remove postage too.', + 'This coupon will subtracts a set amount from the total cost of an order. If the discount is greater than the total order corst, the customer will only pay the shipping, or nothing if the coupon also provides free shipping.', array(), 'coupon' ); diff --git a/core/lib/Thelia/Coupon/Type/RemoveXPercent.php b/core/lib/Thelia/Coupon/Type/RemoveXPercent.php index 8019e564f..db0a011ea 100644 --- a/core/lib/Thelia/Coupon/Type/RemoveXPercent.php +++ b/core/lib/Thelia/Coupon/Type/RemoveXPercent.php @@ -116,7 +116,7 @@ class RemoveXPercent extends CouponAbstract { return $this->facade ->getTranslator() - ->trans('Percentage removed from the cart', array(), 'coupon'); + ->trans('Percent Discount', array(), 'coupon'); } /** @@ -129,7 +129,7 @@ class RemoveXPercent extends CouponAbstract $toolTip = $this->facade ->getTranslator() ->trans( - 'This coupon will remove the entered percentage to the customer total checkout. If the discount is superior to the total checkout price the customer will only pay the postage. Unless if the coupon is set to remove postage too.', + 'This coupon will offert a flat percentage off a shopper\'s entire order (not applied to shipping costs or tax rates). If the discount is greater than the total order corst, the customer will only pay the shipping, or nothing if the coupon also provides free shipping.', array(), 'coupon' );