Created
October 28, 2014 09:08
-
-
Save vishalbasnet23/f59e83843f522221f1f2 to your computer and use it in GitHub Desktop.
WooCommerce Clear Cart Url
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( 'init', 'woocommerce_clear_cart_url' ); | |
| function woocommerce_clear_cart_url() { | |
| global $woocommerce; | |
| if ( isset( $_GET['empty-cart'] ) ) { | |
| $woocommerce->cart->empty_cart(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment