How To Send Buyers Direct To Checkout WooCommerce

The easiest way to increase sales on your e-commerce shop right now.
by Adam @ WPCrafter   |   Last Updated: July 16, 2019
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on email

The more steps you put your buyer through, the less likely it is that they will complete the purchase.

Thats a fact! But there is something you can do about it.

In this tutorial I will show you how to skip the cart all together and send your buyers straight to the checkout page.

Skip Cart Code

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;
}

Change Add To Cart Button Text

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' );
}

Video Transcript

Adam @ WPCrafter

Adam @ WPCrafter

My passion is making the best quality video tutorial online, for non-techies. When I am not behind the camera, I am usually helping out one of my YouTube subscribers.

28 thoughts on “How To Send Buyers Direct To Checkout WooCommerce”

  1. x

    I need help please!!!

    I just used the codes but somehow, it send trusted badges that were suposed to appear only in my checkout page, right on all of my product pages and its crashing them. I have no clue about how this happened

    Please I need help, I can provide acces if necesario, I dont know whats wrong

  2. Great video and codes!!

    Its posible for you to give a code that allow people to pay from paypal without leaving the website??

  3. M

    I have a problem with this, cause when I enable snippets, on the checkout page I got notification: “You must be logged in to checkout.” How can I fix this?

  4. J

    Some of the code is deprecated now Adam, you need some updates to yours 🙂

    add_to_cart_redirect – Use woocommerce_add_to_cart_redirect
    get_checkout_url – Use wc_get_checkout_url

    1. J
      James Van der Hoven

      Just check that for me because I am getting an error when I change it to wc_get_checkout_url

  5. k

    is there coding to add to remove items from the check out page.
    plus
    having a problem the shipping options not showing unless you fill in the form. is there a way to show the shipping regardless where you live as it does not matter to my products.

  6. Thanks for the code Sir. I want to know if is possible to change add to cart or buy now to (call to buy) using the normal shot code
    thanks.

  7. C

    Hi Adam, I added the snippet and I am still getting the same error, please advise? The site can not be reached

  8. Hi

    Thanks for the code and video but we want to add New Button with Buy Now. So we want to Buttons one is Add to Cart which works normal and one is Buy Now, Which will skip cart and and all.

    Can you please guide us how to add extra button?

    Thanks

  9. B

    hello, my cart remains empty despite of adding products to it, and I have ttried everything out there but it still persists, will you please help me here. cart remains empty on IOS but not on android

  10. h

    Hey Adam, thanks, its very helpful.
    However, when I used these code snippets, On the cartflows checkout page, I am getting a message on top “this product has been added to your cart… then there is a “view cart button” towards right and this text on it is not visible unless I hover over the mouse over it (button and text both are orange hence appears as a bar, once i hover the text goes black)
    How do I change this color?

Leave a Comment

Your email address will not be published. Required fields are marked *