You are here

function basic_cart_is_product in Basic cart 7.2

Same name and namespace in other branches
  1. 7.3 basic_cart.module \basic_cart_is_product()

Helper function. Returns true if given node (node object or string node type) is a product.

2 calls to basic_cart_is_product()
basic_cart_handler_field_addtocart::render in views/basic_cart_handler_field_addtocart.inc
Overrides views_handler_field::render().
basic_cart_handler_field_price::render in views/basic_cart_handler_field_price.inc
Overrides views_handler_field::render().

File

./basic_cart.module, line 235

Code

function basic_cart_is_product($node) {
  $type = is_object($node) ? $node->type : $node;

  // Getting node types.
  $node_types = basic_cart_product_types();
  if (empty($node_types) || !is_array($node_types)) {
    return FALSE;
  }
  return in_array($type, $node_types);
}