示例#1
0
 /**
  * Checks if product of an item is in active state.
  *
  * @param ItemInterface $item
  *
  * @throws ProductNotValidException
  * @throws ProductNotFoundException
  *
  * @return bool
  */
 protected function validateIfItemProductActive(ItemInterface $item)
 {
     $product = $item->getProduct();
     if (!$product) {
         throw new ProductNotFoundException('item ' . $item->getId());
     }
     if (!$product->isValidShopProduct($this->defaultCurrency)) {
         throw new ProductNotValidException($product->getId());
     }
     return true;
 }