public function TestPacker::applies in Commerce Shipping 8.2
Determines whether the packer applies to the given order.
Parameters
\Drupal\commerce_order\Entity\OrderInterface $order: The order.
\Drupal\profile\Entity\ProfileInterface $shipping_profile: The shipping profile.
Return value
bool TRUE if the packer applies to the given order, FALSE otherwise.
Overrides PackerInterface::applies
File
- tests/
modules/ commerce_shipping_test/ src/ Packer/ TestPacker.php, line 24
Class
- TestPacker
- Creates a shipment per order item.
Namespace
Drupal\commerce_shipping_test\PackerCode
public function applies(OrderInterface $order, ProfileInterface $shipping_profile) {
return $shipping_profile->address->country_code == 'FR';
}