function uc_order_product_is_shippable in Ubercart 8.4
Same name and namespace in other branches
- 7.3 uc_order/uc_order.module \uc_order_product_is_shippable()
Determines whether a product is shippable or not.
4 calls to uc_order_product_is_shippable()
- Cart::isShippable in uc_cart/
src/ Cart.php - Determines whether a cart contains shippable items or not.
- NewPackageForm::buildForm in shipping/
uc_fulfillment/ src/ Form/ NewPackageForm.php - Form constructor.
- Order::isShippable in uc_order/
src/ Entity/ Order.php - Returns whether an order is considered shippable or not.
- PackageEditForm::buildForm in shipping/
uc_fulfillment/ src/ Form/ PackageEditForm.php - Form constructor.
File
- uc_order/
uc_order.module, line 320 - Handles all things concerning Ubercart orders.
Code
function uc_order_product_is_shippable($product) {
// Return FALSE if the product form specifies this as not shippable.
if (empty($product->data->shippable)) {
return FALSE;
}
// See if any other modules have a say in the matter...
$result = \Drupal::moduleHandler()
->invokeAll('uc_order_product_can_ship', [
$product,
]);
// Return TRUE by default.
if (empty($result) || in_array(TRUE, $result)) {
return TRUE;
}
return FALSE;
}