From 6698dcda4b5e120143aaa37667e79451af190d17 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 31 Jan 2012 09:48:28 +0000 Subject: [PATCH] Add to cart message hook --- woocommerce-functions.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/woocommerce-functions.php b/woocommerce-functions.php index 5d973d00d9e..6df2c5f8f05 100644 --- a/woocommerce-functions.php +++ b/woocommerce-functions.php @@ -379,13 +379,17 @@ function woocommerce_add_to_cart_message() { // Output success messages if (get_option('woocommerce_cart_redirect_after_add')=='yes') : - $return_to = (wp_get_referer()) ? wp_get_referer() : home_url(); - - $woocommerce->add_message( sprintf('%s %s', $return_to, __('Continue Shopping →', 'woocommerce'), __('Product successfully added to your cart.', 'woocommerce') )); + $return_to = (wp_get_referer()) ? wp_get_referer() : home_url(); + + $message = sprintf('%s %s', $return_to, __('Continue Shopping →', 'woocommerce'), __('Product successfully added to your cart.', 'woocommerce') ); else : - $woocommerce->add_message( sprintf('%s %s', get_permalink(woocommerce_get_page_id('cart')), __('View Cart →', 'woocommerce'), __('Product successfully added to your cart.', 'woocommerce') )); + + $message = sprintf('%s %s', get_permalink(woocommerce_get_page_id('cart')), __('View Cart →', 'woocommerce'), __('Product successfully added to your cart.', 'woocommerce') ); + endif; + + $woocommerce->add_message( apply_filters('woocommerce_add_to_cart_message', $message) ); } /**