awesomemotive / easy-digital-downloads

Sell digital downloads through WordPress
https://easydigitaldownloads.com
GNU General Public License v2.0
868 stars 473 forks source link

When the Add to Cart behavior is redirect to cart force a direct to cart URL to save 2 page loads. #8044

Open littlepackage opened 4 years ago

littlepackage commented 4 years ago

Enhancement Request

Explain your enhancement (please be detailed)

First of all, thank you so much for your work! Seems like there's a "dark corner" of EDD when:

Justification or use case

It creates a confusing delay for the customer with no spinner (EDD CSS/UX) feedback. Maybe it should probably just skip the AJAX and add to cart during the redirect. Even if EDD CSS were on, this seems to cause a needless delay.

Is there an argument for continuing to use AJAX when redirect to cart is desired by site admin?

cklosowski commented 4 years ago

@littlepackage the AJAX is what handles the adding to the cart. The action of redirecting to the cart, does not add the item to the cart. To do that you'd need to use the direct to cart purchase links as outlined in this doc.

littlepackage commented 4 years ago

Sure I get that, just pointing out a scenario where the UI is poor, esp for someone like me with SLOOOOOOW Internet.

cklosowski commented 2 years ago

I believe we can probably make this an improvement at some point.

Basically if we've decided that the desired action is to redirect to the cart after clicking 'Add to Cart', then we should just make the purchase button be a direct add to cart URL instead of using AJAX to make an HTTP request and then reload the page to the checkout.

We'll have to be mindful of variable priced output as well as multi-purchase mode.