Hi there,
Using PHP – there is the option_generate_woocommerce_settings
filter:
https://docs.generatepress.com/article/option_generate_woocommerce_settings/
Which you can use to disable the cart menu: $options[‘cart_menu_item’]
In addition to that you may also need to dequeue wc-cart-fragments
which you can do something like this:
add_action( 'wp_enqueue_scripts', 'bbloomer_disable_woocommerce_cart_fragments', 200 );
function bbloomer_disable_woocommerce_cart_fragments() {
if ( some_condtion_is_met() ) {
wp_dequeue_script( 'wc-cart-fragments' );
}
}