Автор: Adam Piotrowski (adam@wellcommerce.org)
Пример #1
0
 /**
  * @param CouponInterface|null $coupon
  *
  * @return bool
  * @throws CouponException
  */
 public function useCoupon(CouponInterface $coupon = null)
 {
     if (!$this->couponChecker->isValid($coupon)) {
         throw new CouponException($this->couponChecker->getError());
     }
     $this->applyCartCoupon($coupon);
     return true;
 }