function commerce_product_reference_commerce_checkout_order_can_checkout in Commerce Core 7
Implements hook_commerce_checkout_order_can_checkout().
File
- modules/
product_reference/ commerce_product_reference.module, line 1473 - Defines a field type for referencing products from other entities.
Code
function commerce_product_reference_commerce_checkout_order_can_checkout($order) {
// Allow orders with one or more product line items to proceed to checkout.
// If there are no line items on the order, redirect away.
$wrapper = entity_metadata_wrapper('commerce_order', $order);
if (commerce_line_items_quantity($wrapper->commerce_line_items, commerce_product_line_item_types()) > 0) {
return TRUE;
}
}