WooCommerce & Gravity Forms: add to cart on radio label selection
-
Thanks in advance for the help!
I have a WooCommerce product that I turned into a donation form via the Gravity Forms WooCommerce add-on.
The goal here is to have a one-page process for the donation form –where all the fields, billing information and credit card information is collected all on one page.
The One Page Checkout WooCommerce extension has helped a lot in doing this, but the form is still not perfect: https://dev.sanma.org/sponsor-a-project/
What I want to do is remove the “Add to cart” button all together and make it so that when people select a price, it will trigger that amount to be added to the cart.
I think the following code is close, but I can’t get it to work:
<script type="text/javascript"> jQuery( document ).ready( function () { $('#input_4_2 input').on('change', function() { $(this).closest("form").submit(); }); }); </script>
The code above triggers the checkout itself, not the add to cart button.
Can you help with this?
Thanks mucho, Roselle
- The topic ‘WooCommerce & Gravity Forms: add to cart on radio label selection’ is closed to new replies.