Changing the position of the buttons on Mini Cart

3 replies2 participantsUpdated by Rose Tyler

  • Avatar: Hempednyc
    Hempednyc
    Participant

    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

    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

    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

    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

Want to reply? Log in, or register with your ThemeForest purchase code, to reply to this topic.

Login / Register