I want to remove the "Proceed to checkout" buttons in the cart if the cart amount is below 20$.
I found a way to remove the default checkout button with this code:
function disable_checkout_button() {
// Set this variable to specify a minimum order value
$minimum = 20;
$total = WC()->cart->cart_contents_total;
if( $total < $minimum ){
remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 );
}
}
But the PayPal Express Checkout button is still there. Is there a way to remove that button in the same way?
I didn't found an hook to do it.
EDIT: I read here, that the PayPal buttons are added to the cart page using the woocommerce_proceed_to_checkout
hook.
But adding the following line doesn't do anything for me:
remove_action( 'woocommerce_proceed_to_checkout', 'display_paypal_button', 20 );