enter image description here

i want to make this change to my site.

after adding product in cart, i want to integrate more buttons in that notice showed in image. I want inside to place button:

  • Continue Shopping and Finish Shopping buttons .

How to do this? i searched on google and found some functions for this, but none of them was ok for my needs. This is one of them:

 * Custom Add To Cart Messages
 * Add this to your theme functions.php file
add_filter( 'wc_add_to_cart_message', 'custom_add_to_cart_message' );
function custom_add_to_cart_message() {
global $woocommerce;
// Output success messages
if (get_option('woocommerce_cart_redirect_after_add')=='yes') :
    $return_to  = get_permalink(woocommerce_get_page_id('shop'));
    $message    = sprintf('<a href="%s" class="button">%s</a> %s', 
$return_to, __('Continue Shopping &rarr;', 'woocommerce'), __('Product 
 successfully added to your cart.', 'woocommerce') );
else :
    $message    = sprintf('<a href="%s" class="button">%s</a> %s', 
get_permalink(woocommerce_get_page_id('cart')), __('View Cart &rarr;', 
'woocommerce'), __('Product successfully added to your cart.', 
'woocommerce') );
    return $message;
/* Custom Add To Cart Messages */

Read more here: How to add more buttons into WooCommerce Add to Cart notice?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: