public function ShippingOrderManager::hasShipments in Commerce Shipping 8.2
Checks if the given order has shipments.
Parameters
\Drupal\commerce_order\Entity\OrderInterface $order: The order.
Return value
bool TRUE if the order has shipments, FALSE otherwise.
Overrides ShippingOrderManagerInterface::hasShipments
File
- src/
ShippingOrderManager.php, line 80
Class
Namespace
Drupal\commerce_shippingCode
public function hasShipments(OrderInterface $order) {
return $order
->hasField('shipments') && !$order
->get('shipments')
->isEmpty();
}