Last active
February 23, 2021 11:27
-
-
Save Oscar-Abad-Folgueira/d4fd17365470a04b395180221709797a to your computer and use it in GitHub Desktop.
WooCommerce Snippet: Borrar el contenido del carrito cuando salen los clientes de su cuenta
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 | |
/** | |
* @snippet WooCommerce Snippet: Borrar el contenido del carrito cuando salen los clientes de su cuenta | |
* @author Oscar Abad Folgueira | |
* @author_url https://www.oscarabadfolgueira.com | |
* @snippet_url https://www.oscarabadfolgueira.com/ | |
*/ | |
add_action('clear_auth_cookie', 'oaf_borrar_contenido_carrito'); | |
function oaf_borrar_contenido_carrito() { | |
global $woocommerce; | |
$woocommerce->cart->empty_cart(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment