function basic_cart_get_cart in Basic cart 7
Same name and namespace in other branches
- 8.6 basic_cart.inc \basic_cart_get_cart()
- 8 basic_cart.inc \basic_cart_get_cart()
- 8.0 basic_cart.inc \basic_cart_get_cart()
- 8.2 basic_cart.inc \basic_cart_get_cart()
- 8.3 basic_cart.inc \basic_cart_get_cart()
- 8.4 basic_cart.inc \basic_cart_get_cart()
- 8.5 basic_cart.inc \basic_cart_get_cart()
- 7.3 basic_cart.cart.inc \basic_cart_get_cart()
- 7.2 basic_cart.cart.inc \basic_cart_get_cart()
Function for shopping cart retrieval.
Parameters
int $nid: We are using the node id to store the node in the shopping cart
Return value
mixed Returning the shopping cart contents. An empty array if there is nothing in the cart
7 calls to basic_cart_get_cart()
- basic_cart_add_to_cart in ./
basic_cart.cart.inc - Callback function for cart/add/.
- basic_cart_block_view in ./
basic_cart.module - Implements hook_block_view().
- basic_cart_cart in ./
basic_cart.cart.inc - Callback function for cart listing.
- basic_cart_cart_form in ./
basic_cart.cart.inc - Shopping cart form.
- basic_cart_checkout in ./
basic_cart.cart.inc - Checkout form implementation.
File
- ./
basic_cart.cart.inc, line 178 - Basic cart shopping cart implementation functions.
Code
function basic_cart_get_cart($nid = NULL) {
if (isset($nid)) {
return $_SESSION['basic_cart']['cart'][$nid];
}
if (isset($_SESSION['basic_cart']['cart'])) {
return $_SESSION['basic_cart']['cart'];
}
// Empty cart.
return array();
}