WooCommerce - excelling eCommerce
How to Skip Checkout Page? (2 posts)

  1. barryanders
    Posted 1 year ago #

    I've got a product category that includes only free products and they are all displaying in a loop. I need to make it so that when a user clicks the "Add to Cart" button, it purchases the product and redirects them straight to the My Account page.

    If that's too difficult, I'm willing to settle on a solution that will automatically activate the submit button on the checkout page if someone can help me achieve that. I've tried this javascript code which has worked for me on ordinary forms so I know it does what it's supposed to do:

    function addtocart () {
    var form = document.getElementsByClassName("checkout")[0];
    window.onload = addtocart;

    It seems to activate an endless loop of redirecting to the checkout page, rather than purchasing the free product. I'm almost there, but I could really use some help!


  2. barryanders
    Posted 1 year ago #

    To put it simple, here's the default Woocommerce progression:

    Shop Loop -> Cart -> Checkout -> Order Confirmation -> Account Page

    Here's what I currently have:

    Shop Loop -> Checkout -> Account Page

    I would prefer this:

    Shop Loop -> Account Page

    But am willing to accept this if I can find a way to automatically submit the checkout form when that page loads so the user doesn't have to click anything:

    Shop Loop -> Checkout -> Account Page

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic