Created
October 10, 2014 06:40
-
-
Save vishalbasnet23/0f3e433b038584091e50 to your computer and use it in GitHub Desktop.
Simple filter to add empty 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
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