Programmatically remove the mini-cart from the menu
-
Hi,
I’m trying to remove – not hide – the mini-cart on certain conditions.
I tried
remove_action(‘woocommerce_before_mini_cart’, ‘woodmart_before_mini_cart’, 10);
remove_action( ‘woocommerce_widget_shopping_cart_buttons’, ‘woodmart_mini_cart_view_cart_btn’, 10 );
remove_action( ‘woocommerce_widget_shopping_cart_before_buttons’, ‘render_shipping_progress_bar’, 10 );
without success.
Please advise how to achieve this.
Thanks
Hi schokologo,
Thanks for reaching to us.
There are few options when you added products to cart which can be found under Theme Settings > Shop > Shop https://prnt.sc/Ve3FxwkyPdoj
Regards,
Thank you,
I already know about this option, but we need to set it conditionally depending on any different options.
In the header-elements/cart.php there is an if statement:
if ( ! woodmart_woocommerce_installed() || $params[‘style’] == ‘disable’ || ( ! is_user_logged_in() && woodmart_get_opt( ‘login_prices’ ) ) ) {
return;
}
I just need to set the $params[‘style’] to ‘disable’. Is there a hook for this? What would be the most efficient way?
Hi schokologo,
Unfortunately, there is no hook, so it is better to use Disable option.
Regards,