You are here

function uc_order_is_shippable in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_order/uc_order.module \uc_order_is_shippable()
  2. 7.3 uc_order/uc_order.module \uc_order_is_shippable()
5 calls to uc_order_is_shippable()
customer.itpl.php in uc_order/templates/customer.itpl.php
uc_order_condition_is_shippable in uc_order/uc_order_workflow.inc
uc_order_pane_ship_to in uc_order/uc_order_order_pane.inc
Handle the "Ship to" order pane.
uc_paypal_ec_review_form in payment/uc_paypal/uc_paypal.module
uc_paypal_wpp_charge in payment/uc_paypal/uc_paypal.module

File

uc_order/uc_order.module, line 2856

Code

function uc_order_is_shippable($order) {
  if (!is_array($order->products) || empty($order->products)) {
    return FALSE;
  }
  foreach ($order->products as $product) {

    // Return FALSE if the product form specifies this as not shippable.
    if ($product->data['shippable'] == FALSE) {
      $results[] = FALSE;
      continue;
    }

    // See if any other modules have a say in the matter...
    $result = module_invoke_all('cart_item', 'can_ship', $product);

    // Return TRUE by default.
    if (empty($result) || in_array(TRUE, $result)) {
      $results[] = TRUE;
      continue;
    }
    $results[] = FALSE;
  }
  return in_array(TRUE, $results);
}