Need to hide the amount of items added to the cart in the success message that appears after adding an item  in WooCommerce, the wc_add_to_cart_message_html filter has you covered.


Add the below code snippet to your functions.php

View the code on Gist.

On line 24 a ternary operator has been removed which displayed the quantity if greater than 1 – now when you add an item the message will just reference the product title.


You can also now adjust the other text that is used by adjusting the values in the $added_text variable.


Leave a Reply