function hook_add_to_cart_data in Ubercart 6.2
Same name and namespace in other branches
- 5 docs/hooks.php \hook_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_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_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_add_to_cart_data in uc_attribute/
uc_attribute.module - Stores the customer's choices in the cart.
- uc_product_add_to_cart_data in uc_product/
uc_product.module - Implements hook_add_to_cart_data().
7 invocations of hook_add_to_cart_data()
- uc_cart_links_process in uc_cart_links/
uc_cart_links.pages.inc - Process 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_edit_products in uc_order/
uc_order.admin.inc - Populates the product add/edit div on the order edit screen.
- uc_product_add_to_cart_form_submit in uc_product/
uc_product.module - Form submission handler for uc_product_add_to_cart_form().
- uc_product_kit_add_to_cart in uc_product_kit/
uc_product_kit.module - Implements hook_add_to_cart().
File
- docs/
hooks.php, line 73 - These are the hooks that are invoked by the Ubercart core.
Code
function hook_add_to_cart_data($form_values) {
$node = node_load($form_values['nid']);
return array(
'module' => 'uc_product',
'shippable' => $node->shippable,
);
}