Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #280
    dan
    Participant

    I need to automatically send my user to the checkout after hitting the Add to Cart button.

    Right now, the user clicks the Add to Cart button and then manually go to the Checkout button.

    • This topic was modified 1 year, 3 months ago by dan.
    #281

    In your functions.php add this code snippet

    add_filter (‘woocommerce_add_to_cart_redirect’, function( $url, $adding_to_cart ) {
    return wc_get_checkout_url();
    }, 10, 2 );

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.