Changing the position of the buttons on Mini Cart

This topic has 4 replies, 2 voices, and was last updated 1 years, 1 months ago ago by Rose Tyler

  • Avatar: Hempednyc
    Hempednyc
    Participant
    November 15, 2023 at 20:42

    Hi.

    We are trying to replace the position of the Checkout button to be on top of the View Cart button on the Mini Cart widget.

    We have used the famous code with no luck, seems that something is overriding it.

    remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_button_view_cart', 10 );
    remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 20 );
    
    add_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 10 );
    add_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_button_view_cart', 20 );
    3 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    November 16, 2023 at 08:25

    Hello, Hempednyc,

    Thank you for reaching out to us with your request.

    Please try to use custom CSS code:

    .mini-cart-buttons {
        display: flex;
        flex-direction: column;
    }
    .et_element .mini-cart-buttons .wc-forward:not(.btn-checkout) {
        order: 2;
        border-color: #020201 !important;
    }
    .mini-cart-buttons .button.btn-checkout.wc-forward {
        order: 1;
        margin-top: 0;
        margin-bottom: 5px;
    }

    Kind Regards,
    8theme team

    Avatar: Hempednyc
    Hempednyc
    Participant
    November 16, 2023 at 17:39

    Thanks, we will try that as well.

    But we are very curious to know why the above functions doesn’t work for WooCommerce with your theme. Can you explain please?

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    November 16, 2023 at 17:48

    Hello, Hempednyc,

    1/ Please note that we can’t be responsible for your custom code.

    2/ Do a search and check an example of coding that work – https://www.8theme.com/search/?bbp_search=woocommerce_widget_shopping_cart_buttons&bbp_forum_id=128990

    Kind Regards,
    8theme team

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.