fahimmurshed

Add Continue Shopping Button on Cart Page on WooCommerce

Jun 15th, 2021
679
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. * Add Continue Shopping Button on Cart (& checkout) Page
  3. */
  4.  
  5. add_action( 'woocommerce_after_cart_table', 'woo_add_continue_shopping_button_to_cart' );
  6.  
  7. function woo_add_continue_shopping_button_to_cart() {
  8.  $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
  9.  
  10.  echo '<div class="">';
  11.  echo ' <a href="'.$shop_page_url.'" class="button">Continue Shopping</a>';
  12.  echo '</div>';
  13. }
  14.  
  15. add_action( 'woocommerce_before_checkout_form', 'woo_add_continue_shopping_button_to_checkout' );
  16.  
  17. function woo_add_continue_shopping_button_to_checkout() {
  18.  $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) );
  19.  
  20.  echo '<div class="woocommerce-message">';
  21.  echo ' <a href="'.$shop_page_url.'" class="button">Continue Shopping</a> Not finished shopping ?';
  22.  echo '</div>';
  23. }
RAW Paste Data