hook_add_to_cart_data($form_values)
ubercart/docs/hooks.php, line 70
Add 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_add_to_cart().
$form_values The values submitted to the Add to Cart form.
An array of data to be merged into the item added to the cart.
| Name | Description |
|---|---|
| Hooks | Allow modules to interact with the Drupal core. |
<?php
function hook_add_to_cart_data($form_values) {
$node = node_load($form_values['nid']);
return array('module' => 'uc_product', 'shippable' => $node->shippable);
}
?>