fahimmurshed

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

Jun 15th, 2021
1,003
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. * Add Continue Shopping Button on Cart Page & Checkout page
  3. * Add to theme functions.php file or Code Snippets plugin
  4. */
  5. add_action( 'woocommerce_before_cart_table', 'woo_add_continue_shopping_button_to_cart' );
  6. add_action( 'woocommerce_before_checkout_form', 'woo_add_continue_shopping_button_to_cart' );
  7.  
  8. function woo_add_continue_shopping_button_to_cart() {
  9.  $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) );
  10.  
  11.  echo '<div class="woocommerce-message">';
  12.  echo ' <a href="'.$shop_page_url.'" class="button">Continue Shopping →</a> Would you like some more goods?';
  13.  echo '</div>';
  14. }
RAW Paste Data