How to add WooCommerce continue shopping button
In this article we are going to be taking a look at how to add a continue shopping button to your WooCommerce store. We will also be looking at why you might want to include this type of button on your WooCommerce store.
One of the best ways to increase your conversion rate is to make it easy for people looking to make a purchase. This is especially true for eCommerce sites, where customers are there to make one purchase only. One of the best ways to create an additional call-to-action that will encourage customers to buy additional products is by adding a “continue shopping” button to your online shop
The “Continue Shopping” button might seem like an ordinary button but it can greatly help you improve conversion and boost your e-commerce sales. This type of buttons are used to show the users that they have already placed their previous order and therefore they can continue shopping without having any effect on their current cart or to have to go through the purchasing process again.
The continue shopping button can help you improve conversion and boost your e-commerce performance.
Adding this type of button to your WooCommerce store is simple and you can do this yourself with a few lines of code in a simple code snippet. We are also going to take a look at the different plugins that will allow you to add this button to your store in a more easy way.
Adding continue shopping button with a code
To add the continue shopping button we need two things. First we need the code that is going to add the button and the link to where the button should redirect. Second we need to decide where do we want to add the button. As always you can add the custom code snippet with Code Snippets Plugin or via the WooCommerce theme functions.php file.
The code snippet will look something like this:
<?php /** * Add Continue Shopping Button on Cart Page **/ add_action( 'woocommerce_before_cart_table', 'my_add_continue_shopping_button_to_cart' ); function my_add_continue_shopping_button_to_cart() { $my_shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) ); echo '<div class="woocommerce-message">'; echo ' <a href="'.$my_shop_page_url.'" class="button">Continue Shopping</a>'; echo '</div>'; }
The code is quite straightforward. The above code is adding the button to the WooCommerce cart page, before the actual WooCommerce cart table. The $my_shop_page_url variable is used to get the actual shop url where we want to link to, and then we just print some HTML code to show the message and the button.
If you want to add the button to the cart button actions section of the checkout page, you can use the following action instead:
add_action( 'woocommerce_cart_actions', 'my_add_continue_shopping_button_to_cart' );
Adding continue shopping button with plugin
If you are not comfortable with adding custom PHP code to your WooCommerce store, you can achieve similar result by using a dedicated WordPress plugin. For example the Continue Shopping Anywhere for WooCommerce is a simple plugin that gives you the option to add the button to different sections of your WooCommerce store without the need of custom code. You have the option to choose to show the button on your:
- Single product page
- Cart Page
- Checkout page
All you have to do is install the plugin and choose the options that you want under the settings page of the plugin.
Conclusion
Adding a “continue shopping” button is a simple way to encourage customers to make more purchases. This article has shown you how to add this button to your WooCommerce store and explained why it’s such an important feature for e-commerce sites.