by Adam Preiser updated May 13, 2020

How To Send Buyers Direct To Checkout WooCommerce

The easiest way to increase sales on your e-commerce shop right now.

Share:

Share on facebook
Share on twitter
Share on linkedin

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.

WooCommerce Skip Cart Code

add_filter( 'woocommerce_add_to_cart_redirect', 'skip_woo_cart' );
 
function skip_woo_cart() {
   return wc_get_checkout_url();
}

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

Both snippet will work on WooCommerce 4 and newer.

Video Transcript

Adam
Adam
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.

Join The Conversation

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

  1. Brilliant, worked well.

    In my catalogue page, the code also changed the add to cart button, which was not ideal because I would’ve preferred it to go to single product page. So I just deleted the 2nd line of code

    add_filter( ‘woocommerce_product_single_add_to_cart_text’, ‘cw_btntext_cart’ );
    function cw_btntext_cart() {
    return __( ‘Go To Checkout’, ‘woocommerce‘ );
    }

  2. I used the above code in code snippet plugin and there is no change. I am using masterstudy lms theme.

  3. Thanks for taking your time to write this post and share your knowledge with us.

  4. very helpful! Do you have maybe also a code to change the color of the Add To Cart Button Text?

  5. I want ask that is it possible to redirect “Add cart” button to Vendor?
    I want my customers to communicate with product vendor directly.
    Please help guys…!
    Cheers!

  6. When I activate the snippets I get There has been a critical error on your website.

  7. Thanks so much Adam! I have subscribed and hit the bell to get more of your tutorials. You explain things so well and as a non techy person, with your help, I’m actually able to get my wp website up and running! Thanks again!!!

  8. thanks for the TUT

    but it seems the code handle is deprecated:

    Notice: add_to_cart_redirect is deprecated since version 3.0.0! Use woocommerce_add_to_cart_redirect instead.

    Notice: WC_Cart::get_checkout_url is deprecated since version 2.5! Use wc_get_checkout_url instead.

    any feedback on this

  9. Adam, thanks a million for this. Will definitely be checking out more of your work!
    Quick question: Is there anyway to have two buttons? One that keeps the original “Add to Cart” as well as the additional “Buy Now”? For example, maybe someone is on a spending spree and is keen to add 2 or 3 products.
    Anyway, thanks again!

    1. Did you figure out how to do this? I am also keen to know how!
      Thanks in advance.

  10. Hi! Adam,

    Thank you for your video and it helps me a lot.
    I would like to ask you how can I translate button text for different language.
    If you give a tip, it will be great.

    1. You can use a plugin like Loco Translate. But in the snippet, you can name the button whatever you want.

      1. Thanks, Adam..
        Could you please let me know a little bit details?
        If I want to replace the ‘Go To CheckOut’ in the Change Add To Cart Button Text with english-french multilingual site, how can I do that?

        Thanks in advance,

        1. Usually the multilingual plugin will let you choose what it says, what everything says really.

  11. I have inserted this code to skip the cart for products but it seems like it is working for only few products.
    I want it to work for all products

  12. Firstly, Thanks for all your awesome tutorials!

    I’ve encountered a problem while using this snippet. I have products set to allow only 1 item in the cart. The problem is that when someone has more than 1 item in the cart and they click the buy now button, it doesn’t send them through to the checkout page.

    The normal process would be -> user is sent to cart with a warning that ‘Product can’t be added to cart’. This doesn’t happen now because I’m bypassing the cart and therefore, it’s simply reloading the current page and the user is left hanging.

    Is there any way I can fix this?

    Thanks

  13. In addition to my first comment, if the customer clicks on the small VIEW CART to move on from the BUY NOW, it takes them to the CHECKOUT PAGE, with no VIEW CART, or even an option to VIEW CART, and there is no option to CONTINUE SHOPPING, once on the CHECKOUT PAGE….

    1. This is code to send a buyer straight to checkout. I am not sure what the confusion is. If this is not the behavior you are after, then this is not for your situation.

  14. I followed the steps and was pleased to see the results…..(EXCEPT)….when the customer clicks the former ADD TO CART button, that became BUY NOW button, the page stayed the same, with a small text button that said VIEW CART right next to the BUY NOW button, so the cart page wasn’t by passed. Any suggestions on how to eliminate this fly in the ointment ?

  15. 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

    1. If this code caused that ( and I don’t see how that is possible ) I would suggest just removing it entirely from your site.

  16. Great video and codes!!

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

  17. Hi,
    I have installed the plugin and pasted the code and followed all the steps on the video but I get nothing. The Tab doesn’t change and the link doesn’t work. It doesn’t even give an error message. Please could you help?

    By the way, CartFlows is brilliant. Works very well. Improved the look of the checkout and Thank you page 100%.

  18. 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?

  19. How can I remove the view cart button and the message on the checkout page?

  20. It does not work on quick view option any solution please help?

  21. Sir I love video, I actually learnt WordPress through your Chanel.Thank you so much Sir.
    Sir please can you do a video on how to customize woocommerce my account page or maybe suggest a plugin . Thanks

  22. Dear Adam,

    I need to click two times on the button to go to the checkout page. Any idea how to fix that?

    Best regards,

  23. Hi Adam,
    This snippets is amazing.

    Can you make another one to change on checkout page?

  24. 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. Just check that for me because I am getting an error when I change it to wc_get_checkout_url

      1. use the code like this..

        $cw_redirect_url_checkout = wc_get_checkout_url();

  25. 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.

  26. 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.

    1. Not that I am aware of, but you can use the custom function in this post to change the button label.

  27. Hi, need to add one more button with a Buy Now Future..help as soon as possible…

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

  29. 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

  30. 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

  31. 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?

  32. Thank you! Code snippets takes a lot of breakage risk away 🙂

Stay Up To Date

Enter your name and email for the latest news, updates, and tutorials.