Add Products Directly To Checkout In WooCommerce

Would you like to make the buying process using WooCommerce shorter? Today we'll share how to add products directly to checkout in WooCommerce

Updated on September 2, 2022
Add Products Directly To Checkout In WooCommerce

Typically, using the WooCommerce WordPress plugin, when you want to buy some products, you need to add them to the cart page and view the cart, and only after that can you load the checkout page. Some people think this is a long process. See in this article how to add products directly to checkout in WooCommerce and skip the cart page.

WooCommerce developers often complain about the long process of going through several screens to see the result of their work. A typical workflow bypasses the cart pages and goes straight to the checkout page. This dramatically shortens the development process and allows developers and users to see the result of the dev processes immediately.

Add Products Directly To Checkout In WooCommerce
Skip cart pages in the WooCommerce WordPress plugin

Add Products Directly To Checkout In WooCommerce?

The process of skipping cart pages and going straight to the checkout page in Woocommerce start with the following step:

Go To WooCommerce > Settings > Products > Display

Add Products Directly To Checkout In WooCommerce?

On this screen, uncheck the two options in the Add to cart behavior section.

The next step of the process is to add a code snippet to the functions.php (located in the theme folder). This code snippet adds a filter that redirects straight to the checkout pages:


add_filter('add_to_cart_redirect', 'cw_redirect_add_to_cart');
function cw_redirect_add_to_cart() {
global $woocommerce;
$cw_redirect_url_checkout = $woocommerce->cart->get_checkout_url();
return $cw_redirect_url_checkout;
}

Once the code has been added, the click action will redirect to the checkout page. As a result, the button’s label in the WooCommerce product should be changed from “Add to Cart” to “Go to Checkout”. For this, I will add the following filter to the functions.php:


add_filter( 'woocommerce_product_single_add_to_cart_text', 'cw_btntext_cart' );
add_filter( 'woocommerce_product_add_to_cart_text', 'cw_btntext_cart' );< function cw_btntext_cart() { return __( 'Go To Checkout', 'woocommerce' ); }

Add Products Directly To Checkout In WooCommerce
Add Products Directly To Checkout In WooCommerce

Using Cashier Plugin

  • Firstly, Go to: WordPress Admin > WooCommerce > Settings > Checkout.
  • Give the Buy Now button a name that users will see on your website. It can be “Buy Now”, “Proceed to Checkout,” “Buy Now,” or others.
  • Under Add to Cart and Checkout, select the option to replace Add to Cart with Buy Now for all products. All your Add to Cart buttons will change to Buy Now, enabling direct checkout for your entire store.
  • Keep existing cart items in Buy Now? – To enable direct checkout only for products clicked on the “Buy Now” link, activate this option.
  • Checkout in Popup – Enabling this setting will display the checkout form in a popup on the same page when you click the Buy Now button. However, this setting is only for guest users and users whose checkout details were previously unavailable.
  • Finally, Buying in two steps? – Enable this setting if you want user confirmation to enable direct checkout.

How To Make Direct Checkout Links In WooCommerce

Video Tutorial

To create a direct checkout link for an essential WooCommerce product, all you need is the ID of that specific product. This will generate the default add-to-cart link that comes with WC core. You can find it by hovering over a product in the product list or editing individual products and looking for their URL structure. The link to put a product directly into the cart is as follows: If you want to skip all pages and go straight to checkout, the link is: As you can see, you can link to any page on your website and add the following Parameters of the shopping cart:

Directly Checkout Add Guide For WooCommerce Conclusion

The fundamental problem I discussed in this tutorial was the long series of screens that developers and users often wish to skip and go straight to the checkout page. The solution is straightforward and involves adding code snippets to functions.php. If you need help with the answer, do leave a comment.