Home Forums WoodMart support forum Programmatically remove the mini-cart from the menu

Programmatically remove the mini-cart from the menu

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #575418

    schokologo
    Participant

    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

    #575520

    Hung Pham
    Keymaster

    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,

    #575550

    schokologo
    Participant

    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?

    #575783

    Hung Pham
    Keymaster

    Hi schokologo,

    Unfortunately, there is no hook, so it is better to use Disable option.

    Regards,

Viewing 4 posts - 1 through 4 (of 4 total)