Support » Plugin: WooCommerce » Using woocommerce_checkout shortcode for single page, can’t checkout

  • Resolved pinksharpii

    (@pinksharpii)


    I’m building a custom process for a client to accept donations on their site. It’s all done on one page. In the template, depending on what “page” the user is on, I show different template parts. If on page 3, the payment page, I show the [woocommerce_checkout] shortcode. The first time through, it works fine. But if you have errors, like missing a required field, the cart portion and the payment methods show the loading icon forever when the page reloads to show errors, and you can’t checkout even if you fix the errors.

    I have code in functions.php to change the checkout URL to this page to keep it in the single page application, otherwise it was going to the home page.

    Url: https://cfcc.bdcstaging.com/donate-now/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I took out the code to modify the checkout URL. If you add a donation to your cart and go to the /checkout/ url, it works the first time you load the page but any time you go back after address data has been provided, it spins forever.

    Plugin Support RK

    (@riaanknoetze)

    Hi there,

    I think it might require a closer look at the code than what we’re able to do here. With that said, is there any reason why you’re coding that yourself as opposed to using https://www.woocommerce.com/products/woocommerce-one-page-checkout/ ?

    Also, it might be worth reaching out to developers at:

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    As my comment above states, it happens on the default checkout page so it’s not exclusive to my custom solution. There are no errors that I can see either in console or on the server. If I go to the ?wc-ajax=update_order_review url like other forums suggest, I see the -1. So it’s not an ajax issue either. If I set theme to twentyseventeen and delete all other plugins, the issue still occurs.

    Plugin Support RK

    (@riaanknoetze)

    But if you have errors, like missing a required field, the cart portion and the payment methods show the loading icon forever when the page reloads to show errors, and you can’t checkout even if you fix the errors

    I’ve just worked through a sample checkout process and deliberately neglected to fill in any information on step three (where your checkout shortcode is placed). As soon as I correct the errors, however, the spinner “clears” and I’m able to proceed to step 4 and 5 as expected 🙂


    Link to image: http://cld.wthms.co/PpXeS4

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using woocommerce_checkout shortcode for single page, can’t checkout’ is closed to new replies.