Skip to content

Instantly share code, notes, and snippets.

@drugan
Last active September 1, 2017 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drugan/ae65acc2e552454fba14a2067c254a54 to your computer and use it in GitHub Desktop.
Save drugan/ae65acc2e552454fba14a2067c254a54 to your computer and use it in GitHub Desktop.
Change the message seen by a customer after product variation is added to the Shopping Cart.
<?php
/**
* Implements hook_commerce_add_to_cart_message_alter().
*
* Apply this patch: https://www.drupal.org/node/2905624#comment-12242300
* Place this code into YOUR_MODULE.module file replacing YOUR_MODULE placeholder
* with your modules' name.
*/
function YOUR_MODULE_commerce_add_to_cart_message_alter(&$message, &$order, &$order_item) {
// Alter $message or $order or $order_item data for your needs.
// For example, do not show Add to cart message at all:
$message = [];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment