Remove cart functionality from WooCommerce so it doesn’t remember the products [closed]
Not sure if this is the right way to do it but I finally found an answer here: https://stackoverflow.com/a/49382476/2308992 and did the following: add_action( ‘woocommerce_add_to_cart_validation’, function( $passed, $product_id, $quantity ) { if( ! WC()->cart->is_empty() ) { wc_empty_cart(); } return $passed; }, 20, 3); What this does basically before WooCommerce tries to add anything in the … Read more