Skip WooCommerce Cart Page

Some WooCommerce sites have very little use for the included WooCommerce cart – either they’re only selling one item, a subscription, or just want their users to get through faster. Although it’s not included in the vanilla WooCommerce, we can add that feature with a function – copy the text below into your functions.php file and your users will skip right over the cart and straight to checkout.

This goes particularly well with custom “Add to Cart” button text.

// "Add to Cart" button redirects to Checkout
add_filter ('add_to_cart_redirect', 'redirect_to_checkout');

function redirect_to_checkout() {
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
return $checkout_url;
}

Have any questions or comments about this article, or ways you think it can be improved?
Join the conversation in the comments below, or sign up for my newsletter to recieve periodic updates!

Tags: , , ,

No comments yet.

Leave a Reply

%d bloggers like this: