You are here

function hook_commerce_cart_order_convert in Commerce Core 7

Allows modules to perform additional processing to convert an anonymous shopping cart order to an authenticated cart.

When anonymous users login to the site, if they have shopping cart orders, those are converted to authenticated shopping carts. This means their uid and mail properties are updated along with the uid of any referenced customer profiles. Additional modules can implement their own logic via this hook, such as canceling any existing shopping cart orders the user might already have prior to conversion of the anonymous cart.

Modules that implement this hook do not need to save changes to the order, as the Cart module will save the order after invoking the hook.

Parameters

$order_wrapper: The entity metadata wrapper for the order being refreshed.

$account: The user account the order will belong to.

See also

commerce_cart_order_convert()

1 invocation of hook_commerce_cart_order_convert()
commerce_cart_order_convert in modules/cart/commerce_cart.module
Converts an anonymous shopping cart order to an authenticated cart.

File

modules/cart/commerce_cart.api.php, line 99
Hooks provided by the Cart module.

Code

function hook_commerce_cart_order_convert($order_wrapper, $account) {

  // No example.
}