Home Forums WoodMart support forum Information about available hooks in the ajax mini-cart popup

Information about available hooks in the ajax mini-cart popup

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #463633

    [email protected]
    Participant

    Hello,

    I’m trying to add an alert message or any content really to the mini-cart sidebar, before the cart and checkout buttons. The condition for it is if the client role is a b2b client. But I can figure the conditions myself. ideally the checkout button needs to be disabled/hidden or not rendered if the conditions are not met.

    I’ve been trying multiple hooks for mini-carts but no luck. Can you suggest me something to help?

    Thanks.

    #463733

    Luke Nielsen
    Keymaster

    Hello,

    Please provide your access to the admin dashboard and the code you add to the mini cart, so we will investigate it.

    Looking forward to hearing back from you!

    Kind Regards

    #463734

    [email protected]
    Participant

    Sure, I’ll send you the access as well as the functions I use to achieve a similar thing on the cart and checkout pages.

    I’ll send the functions and access in the extra information field.

    #463809

    Luke Nielsen
    Keymaster

    Hello,

    The code that you sent is intended for the shopping cart page. But if you want the buttons to hide on the mini cart, you need to use this woocommerce_widget_shopping_cart_before_buttons hook, when you want to hide the buttons it just needs to remove the button hooks:

    add_action( 'woocommerce_widget_shopping_cart_buttons', 'woodmart_mini_cart_view_cart_btn', 10 );
    add_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 20 );

    Kind Regards

    #463887

    [email protected]
    Participant

    Thanks,

    I managed to display the alert and hide the buttons, however if user adds another item in the mini-cart, it refreshes and the alert disappears, checkout button appears. As if the custom function is not considered.

    I’ll accept only showing some message in the mini-art, but it would be great if that message stays fixed all the time, even when user refreshes the cart.

    Thanks.

    #464056

    Luke Nielsen
    Keymaster

    Hello,

    We can’t say for sure why your custom content is missing after the update. Because WooCommerce is responsible for updating the shopping cart.

    In the meantime, feel free to ask me any questions you may have.

    Kind Regards

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