|
13 | 13 | */
|
14 | 14 | class Create extends \Magento\Backend\App\Action
|
15 | 15 | {
|
| 16 | + /** |
| 17 | + * @var \Magento\Framework\Escaper |
| 18 | + */ |
| 19 | + protected $escaper; |
| 20 | + |
16 | 21 | /**
|
17 | 22 | * @param Action\Context $context
|
18 | 23 | * @param \Magento\Catalog\Helper\Product $productHelper
|
| 24 | + * @param \Magento\Framework\Escaper $escaper |
19 | 25 | */
|
20 |
| - public function __construct(Action\Context $context, \Magento\Catalog\Helper\Product $productHelper) |
| 26 | + public function __construct( |
| 27 | + Action\Context $context, |
| 28 | + \Magento\Catalog\Helper\Product $productHelper, |
| 29 | + \Magento\Framework\Escaper $escaper |
| 30 | + ) |
21 | 31 | {
|
22 | 32 | parent::__construct($context);
|
23 | 33 | $productHelper->setSkipSaleableCheck(true);
|
| 34 | + $this->escaper = $escaper; |
24 | 35 | }
|
25 | 36 |
|
26 | 37 | /**
|
@@ -280,18 +291,19 @@ protected function _processActionData($action = null)
|
280 | 291 | }
|
281 | 292 | }
|
282 | 293 | if (!$isApplyDiscount) {
|
| 294 | + $rr = $this->escaper->escapeHtml($couponCode); |
283 | 295 | $this->messageManager->addError(
|
284 | 296 | __(
|
285 |
| - '"%1" coupon code for item(s) selected do not apply discount', |
286 |
| - $this->_objectManager->get('Magento\Framework\Escaper')->escapeHtml($couponCode) |
| 297 | + '"%1" coupon code was not applied. Do not apply discount is selected for item(s)', |
| 298 | + $rr |
287 | 299 | )
|
288 | 300 | );
|
289 | 301 | } else {
|
290 | 302 | if ($this->_getQuote()->getCouponCode() !== $couponCode) {
|
291 | 303 | $this->messageManager->addError(
|
292 | 304 | __(
|
293 | 305 | '"%1" coupon code is not valid.',
|
294 |
| - $this->_objectManager->get('Magento\Framework\Escaper')->escapeHtml($couponCode) |
| 306 | + $this->escaper->escapeHtml($couponCode) |
295 | 307 | )
|
296 | 308 | );
|
297 | 309 | } else {
|
|
0 commit comments