Add a ‘Continue Shopping’ Button to Woo Commerce Checkout and Cart Page

By default WooCommerce Cart page does not have a ‘Continue Shopping’ or ‘Return to Store’ button. However if you go to the cart page when the cart is empty, there is a  ‘Return to Store’ button.

We just need to add this button code to the cart page when the cart has items.

 

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
});

 


2 Comments

  • Randy Holcomb

    November 13, 2019

    So, where is it that I add this snippet?

    Reply
    • LWD

      November 14, 2019

      You’ll need to add it to your theme’s functions.php file

      Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.