Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function get($cartId)
 {
     /** @var  \Magento\Sales\Model\Quote $quote */
     $quote = $this->quoteRepository->get($cartId);
     $data = [Coupon::COUPON_CODE => $quote->getCouponCode()];
     $output = $this->couponBuilder->populateWithArray($data)->create();
     return $output;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function get($cartId)
 {
     $storeId = $this->storeManager->getStore()->getId();
     /** @var  \Magento\Sales\Model\Quote $quote */
     $quote = $this->quoteLoader->load($cartId, $storeId);
     $data = [Coupon::COUPON_CODE => $quote->getCouponCode()];
     $output = $this->couponBuilder->populateWithArray($data)->create();
     return $output;
 }