I want to delete the checkout button from the cart widget so that a user has to view their cart first and can only checkout from the cart page.
I am sure I have to delete some code somewhere but not sure where.
4
You can do it by using the css or need to check your code to find and remove the button. If you are using the plugin then please check for the hook you are using and edit that one.
With the CSS, you can easily hide the checkout button.
Use it like
.widget_sidebar .checkout_button { display: none; }
There are two ways you can achieve this.
The first method is to remove the button using the Woocommerce Hook. Add the below code in your functions.php file
function my_woocommerce_widget_shopping_cart_proceed_to_checkout() { return; } add_action( 'woocommerce_widget_shopping_cart_buttons', 'my_woocommerce_widget_shopping_cart_proceed_to_checkout', 20 );
Another method is by using the CSS to hide that particular button.
Add display: none to that specific button by identifying its class.
.woocommerce-mini-cart__buttons .checkout.wc-forward {display: none !important;}
If you are using a mini cart you can try this
add_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 20 );
If you are using some plugin then let me know.
You can hide the checkout button multiple ways 1) With Hook
function widget_checkoutbutton() { return; } add_action( 'woocommerce_widget_shopping_cart_buttons','widget_checkoutbutton', 20 );
2) With CSS Identify the class name of checkout button and write display none with root class.
Click here to cancel reply.
4
Answers
You can do it by using the css or need to check your code to find and remove the button. If you are using the plugin then please check for the hook you are using and edit that one.
With the CSS, you can easily hide the checkout button.
Use it like
There are two ways you can achieve this.
The first method is to remove the button using the Woocommerce Hook. Add the below code in your functions.php file
Another method is by using the CSS to hide that particular button.
Add display: none to that specific button by identifying its class.
If you are using a mini cart you can try this
If you are using some plugin then let me know.
You can hide the checkout button multiple ways
1) With Hook
2) With CSS
Identify the class name of checkout button and write display none with root class.