Last active
October 30, 2023 07:57
-
-
Save SirDarcanos/4442c0fc301b8253e26a31666bb14314 to your computer and use it in GitHub Desktop.
Add an Empty Cart Button in WooCommerce
This file contains hidden or 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_action( 'woocommerce_cart_coupon', 'woocommerce_empty_cart_button' ); | |
function woocommerce_empty_cart_button() { | |
echo '<a href="' . esc_url( add_query_arg( 'empty_cart', 'yes' ) ) . '" class="button" title="' . esc_attr( 'Empty Cart', 'woocommerce' ) . '">' . esc_html( 'Empty Cart', 'woocommerce' ) . '</a>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment