function commerce_xquantity_xquantity_added_to_cart_msg_alter in Commerce Extended Quantity 8
Implements hook_TYPE_alter().
Allows to alter or remove the 'An Item added to your cart.' message.
See also
\Drupal\commerce_xquantity\Form\XquantityAddTocartForm::submitForm()
\Drupal\commerce_cart\EventSubscriber\CartEventSubscriber::displayAddToCartMessage()
File
- ./
commerce_xquantity.module, line 35 - Contains commerce_xquantity.module.
Code
function commerce_xquantity_xquantity_added_to_cart_msg_alter(&$msg, XquantityAddTocartForm $form) {
// Alter the message using data from an order, order item or variation.
// $msg = t('Congratulations! @entity added to <a href=":url">your cart</a>.', [
// @entity' => $form->getEntity()->label(),
// ':url' => Drupal\Core\Url::fromRoute('commerce_cart.page')->toString(),
// ]);
// OR, remove the message.
// $msg = NULL;
}