Hi,
see my issue here
https://stackoverflow.com/questions/63149087/unable-to-clear-woocomerce-cart-when-navigating-to-a-new-page-inside-wordpress
this code doesnt clear the cart, only after second refresh (hard ctrl + F5)
there is no cache enabled.
add_action( 'template_redirect', 'woocommerce_clear_cart' );
function woocommerce_clear_cart() {
global $woocommerce, $post;
if( $post->ID == 1) {
WC()->cart->empty_cart();
WC()->session->set('cart', array());
}
}
im seeing the products in the minicart and on the cart page itself.
does woodmart have a cache im not aware of ?
any suggestions ?