| @@ 425-437 (lines=13) @@ | ||
| 422 | $countryIso3 = $order->deliveryAddress->country; |
|
| 423 | $country = $this->manager->getRepository('Shopware\Models\Country\Country')->findOneBy(['iso3' => $countryIso3]); |
|
| 424 | ||
| 425 | if (!$country) { |
|
| 426 | return new Shipping([ |
|
| 427 | 'isShippable' => false, |
|
| 428 | 'messages' => [ |
|
| 429 | new Message([ |
|
| 430 | 'message' => 'order_not_shippable_to_country', |
|
| 431 | 'values' => [ |
|
| 432 | 'country' => $countryIso3, |
|
| 433 | ] |
|
| 434 | ]) |
|
| 435 | ] |
|
| 436 | ]); |
|
| 437 | } |
|
| 438 | ||
| 439 | if (count($order->orderItems) == 0) { |
|
| 440 | throw new \InvalidArgumentException( |
|
| @@ 485-497 (lines=13) @@ | ||
| 482 | } |
|
| 483 | ||
| 484 | $shippingMethods = Shopware()->Modules()->Admin()->sGetPremiumDispatches($country->getId()); |
|
| 485 | if (empty($shippingMethods)) { |
|
| 486 | return new Shipping([ |
|
| 487 | 'isShippable' => false, |
|
| 488 | 'messages' => [ |
|
| 489 | new Message([ |
|
| 490 | 'message' => 'order_not_shippable_to_country', |
|
| 491 | 'values' => [ |
|
| 492 | 'country' => $countryIso3, |
|
| 493 | ] |
|
| 494 | ]) |
|
| 495 | ] |
|
| 496 | ]); |
|
| 497 | } |
|
| 498 | ||
| 499 | $shippingMethod = reset($shippingMethods); |
|
| 500 | ||