Skip navigation
Help

hook_uc_add_to_cart_data

7 uc_cart.api.php hook_uc_add_to_cart_data($form_values)

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.

Related topics

2 functions implement hook_uc_add_to_cart_data()

10 invocations of hook_uc_add_to_cart_data()

File

ubercart/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);
}