Created
September 4, 2020 08:50
-
-
Save Konark-Web/0d2ac570486fa1b3770853263df3ad6b to your computer and use it in GitHub Desktop.
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
function clear_cart_after_logout() { | |
WC()->cart->empty_cart(); | |
// $cart = new WC_Cart(); | |
// $cart->empty_cart( $clear_persistent_cart = true ); | |
} | |
add_action('wp_logout', 'clear_cart_after_logout'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment