The Cart Page of a WooCommerce store helps customers to review their order before proceeding to the Checkout page to make the payment for the same. It is on the Cart page where the customer can delete an item from their virtual basket or increase the quantity of added items. Once the order is finalised, the customer then clicks on the Proceed to checkout button to go to the Checkout page.
In many cases though, you may want the customer to skip the Checkout page and instead directly go to the Payment Gateway page and make the payment. As a real world example, for stores which accept payments mostly through PayPal, an exclusive button for it is added using plugins such as Express Checkout, in which case the customer can directly go to the PayPal page by clicking on the PayPal Check out button that appears below the Proceed to checkout button.
In case of when the store accepts payments only through PayPal and no other payment method, the “Proceed to checkout” button becomes an overhead for the customer. For these instances, let’s see how we can remove the Proceed to checkout button on the WooCommerce cart page.
Removing the Proceed to checkout button from the Cart page
The following line of code, when added to the functions.php file of your child theme, will result in this button getting removed from the page:
remove_action( 'woocommerce_proceed_to_checkout','woocommerce_button_proceed_to_checkout', 20);
The woocommerce_button_proceed_to_checkout is a function that outputs the Checkout button. By removing this using the woocommerce_proceed_to_checkout hook, the button won’t be rendered.
In this way, your customers can directly go to the payment gateway page to make the payment:
Hi, thanks for your post. I think it can help me a lot. But There are so manly lines of code in functions.php file of my child theme, could you please tell me where exactly to add this line of code?
Hello, can we do the same for the order button ?
This worked. Thanks!