Archived topic
Woocommerce Mini Cart Change Link
5 replies · Started by Jonathan on September 21, 2021
Hello,
Instead of the mini cart link going to the basket I'd like it to go straight to the checkout page. We've one simple product and so we redirect the shop page straight to the cart page missing out the basket altogether.
regards,
Jonathan
Hi there,
by default the mini cart should show Cart and Checkout links.
Do you simply want to remove the Cart link ?
If I can't replace it, yes?
You can add this PHP Snippet to remove the Cart Button:
remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_button_view_cart', 10 );
NOTE: You will need to clear the cart transients cache ( simple way is to add / remove ) something from the cart to see it update.
Then a little CSS to make the Checkout button fill the width:
.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a {
width: 100%;
}
Thanks
You're welcome