When adding a product to the cart on the product page (or archive page with the AJAX add to cart feature disabled) WooCommerce by default shows a good basic notice to let customers know their product has been added to the cart.

Personalizing this text for your store by changing the text / adding or changing links can give a more unified feeling of your entire webshop. For example if you use WooCommerce primarily as a quotation tool, or want to show a link to the shop page or checkout changing the 'Added to cart' notice is the best way to go.

Changing the 'Added to Cart' Notice Text

To change the text in this notice you can use a simple code snippet. I'll show multiple variations of this code snippet that will change the texts and links in there.

Changing the Text

The text in the notice comes in two forms, a singular and plural variation. The most commonly used one is the singular variant, the plural is shown on grouped products for example.

The following code snippet changes the text output meant for a site where only quotes can be requested and products can't actually be purchased at this time through WooCommerce.

Checkout Link

Another thing I'd like to recommend is change the link from "View cart" to something like "Go to checkout" or "Return to overview" depending on what works best for the store. Below a variation of the code snippet that changes the link to direct the customer to the checkout, skipping the cart page completely.

Side note; If you want to completely redirect the customer to the checkout immediately after adding a product to the cart, I've created a plugin that allows you to configure this; WooCommerce Add to Cart Redirect.

Removing the 'Added to Cart' Notice Completely

If wanted you can also completely remove the 'Added to cart' notice. This can be done with a simple one line code snippet.

add_filter( 'wc_add_to_cart_message_html', '__return_empty_string' );

No notice will appear anymore on any page. This can for example be beneficial when you're only selling one product and want to redirect the customer to the checkout immediately without showing the notice.

Categories: Uncategorized

About the author: Jeroen Sormani is actively building WordPress, WooCommerce and Easy Digital Downloads plugins. Slightly obsessed by writing high quality code.
Follow Jeroen on Twitter

Leave a Reply

Your email address will not be published. Required fields are marked *