Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | protected function validate(ItemInterface $item, PurchaseContext $context) |
||
27 | { |
||
28 | if (!$item->isProduct()) { |
||
29 | return; |
||
30 | } |
||
31 | |||
32 | $ProductType = $item->getProductClass()->getProductType(); |
||
33 | $Deliveries = $this->deliveryRepository->findBy(['ProductType' => $ProductType]); |
||
34 | |||
35 | if (empty($Deliveries)) { |
||
36 | throw new ItemValidateException('cart.product.not.producttype', ['%product%' => $item->getProductClass()->getProduct()->getName()]); |
||
37 | } |
||
38 | } |
||
39 | |||
45 |