Simple PHP Code To Add Continue Shopping Button on Cart Page in Woocommerce

Written by :

Posted on :

Tags :

Share :

Facebook
Twitter
LinkedIn
Reddit
Pinterest

What This PHP Code Does:

Adds a “Return to Shop” button on the cart page of your Woocommerce website so that users can easily get back to your store in order to continue shopping.

How To Implement:

Go to Appearance > Theme Editor or via FTP and open the functions.php file. At the very bottom add the below code. 

The Code:

				
					// Add continue shopping button to WooCommerce cart
add_action('woocommerce_cart_actions', function() {
  ?>
  <a class="button wc-backward" href="<?php echo esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ) ); ?>"> <?php _e( 'Return to shop', 'woocommerce' ) ?> </a>
  <?php
});
				
			

Leave a Reply

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

READY FOR A TOTALLY AWESOME WEBSITE?