How to Skip Checkout Page?
-
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]; form.submit(); } 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!
- The topic ‘How to Skip Checkout Page?’ is closed to new replies.