Coupon.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Checkout\Block\Cart;
  7. /**
  8. * @api
  9. * @since 100.0.2
  10. */
  11. class Coupon extends \Magento\Checkout\Block\Cart\AbstractCart
  12. {
  13. /**
  14. * @param \Magento\Framework\View\Element\Template\Context $context
  15. * @param \Magento\Customer\Model\Session $customerSession
  16. * @param \Magento\Checkout\Model\Session $checkoutSession
  17. * @param array $data
  18. * @codeCoverageIgnore
  19. */
  20. public function __construct(
  21. \Magento\Framework\View\Element\Template\Context $context,
  22. \Magento\Customer\Model\Session $customerSession,
  23. \Magento\Checkout\Model\Session $checkoutSession,
  24. array $data = []
  25. ) {
  26. parent::__construct($context, $customerSession, $checkoutSession, $data);
  27. $this->_isScopePrivate = true;
  28. }
  29. /**
  30. * @return string
  31. * @codeCoverageIgnore
  32. */
  33. public function getCouponCode()
  34. {
  35. return $this->getQuote()->getCouponCode();
  36. }
  37. }