You are here

function hook_uc_cart_item_insert in Ubercart 8.4

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

Act on cart item entities when inserted.

Parameters

\Drupal\uc_cart\CartItemInterface $entity: The cart item entity object.

1 function implements hook_uc_cart_item_insert()

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

uc_cart_entity_test_uc_cart_item_insert in uc_cart/tests/modules/uc_cart_entity_test/uc_cart_entity_test.module
Implements hook_uc_cart_item_insert().

File

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

Code

function hook_uc_cart_item_insert(CartItemInterface $entity) {
  \Drupal::messenger()
    ->addMessage(t('An item was added to your cart'));
}