Last active
February 17, 2024 12:50
-
-
Save bradleysa/7d1448253097784daf94 to your computer and use it in GitHub Desktop.
WooCommerce: Add Continue Shopping Button on Cart Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add Continue Shopping Button on Cart Page | |
* Add to theme functions.php file or Code Snippets plugin | |
*/ | |
add_action( 'woocommerce_before_cart_table', 'woo_add_continue_shopping_button_to_cart' ); | |
function woo_add_continue_shopping_button_to_cart() { | |
$shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) ); | |
echo '<div class="woocommerce-message">'; | |
echo ' <a href="'.$shop_page_url.'" class="button">Continue Shopping →</a> Would you like some more goods?'; | |
echo '</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome!!!!