Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to Add Continue Shopping Button in WooCommerce Cart?

Are you looking to improve your WooCommerce cart page by providing your customers with an easy way to continue shopping? Imagine your customers adding items to their cart and then, instead of navigating back or searching for the shop page, they see a clear invitation to continue shopping. This code snippet provides a button linking back to your main shop page right on the cart page.

add_action( 'woocommerce_before_cart_table', 'ts_add_continue_shopping_button_to_cart' );

function ts_add_continue_shopping_button_to_cart() {
    $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) );

    echo '<div class="woocommerce-message">';
    echo '<a href="' . esc_url($shop_page_url) . '" class="button">Continue Shopping →</a> Would you like to add some more goods?';
    echo '</div>';
}

Output

The following output shows that the “Continue Shopping” button is displayed on the WooCommerce cart page.

How to Add Continue Shopping Button in WooCommerce Cart?

The above customization will redirect the button to the Shop page. Similarly, you can also redirect to custom url after user clicks proceed to checkout on the WooCommerce cart page.

Browse more in: Code Snippets, WooCommerce How Tos, WooCommerce Tutorials

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible.

Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

By using our site, you acknowledge that you have read and understood our Privacy Policy and Terms & Conditions.