You are here

function hook_uc_add_to_cart_data in Ubercart 7.3

Same name and namespace in other branches
  1. 8.4 uc_cart/uc_cart.api.php \hook_uc_add_to_cart_data()

Adds extra information to a cart item's "data" array.

This is effectively the submit handler of any alterations to the Add to Cart form. It provides a standard way to store the extra information so that it can be used by hook_uc_add_to_cart().

Parameters

$form_values: The values submitted to the Add to Cart form.

Return value

An array of data to be merged into the item added to the cart.

2 functions implement hook_uc_add_to_cart_data()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

uc_attribute_uc_add_to_cart_data in uc_attribute/uc_attribute.module
Stores the customer's choices in the cart.
uc_product_uc_add_to_cart_data in uc_product/uc_product.module
Implements hook_uc_add_to_cart_data().
10 invocations of hook_uc_add_to_cart_data()
uc_cart_links_process in uc_cart_links/uc_cart_links.pages.inc
Processes a Cart Link to fiddle with the cart and redirect the user.
uc_catalog_buy_it_now_form_submit in uc_product/uc_product.module
Form submission handler for uc_catalog_buy_it_now_form().
uc_order_add_product_form in uc_order/uc_order.order_pane.inc
Sets the quantity and attributes of a product added to the order.
uc_order_edit_products_add in uc_order/uc_order.order_pane.inc
Form submit callback: add a product to an order.
uc_product_add_to_cart_form in uc_product/uc_product.module
Form to add the $node product to the cart.

... See full list

File

uc_cart/uc_cart.api.php, line 70
Hooks provided by the Cart module.

Code

function hook_uc_add_to_cart_data($form_values) {
  $node = node_load($form_values['nid']);
  return array(
    'module' => 'uc_product',
    'shippable' => $node->shippable,
  );
}