I am using expresso store as my checkout form (which is already using the checkout & product tags to wrap the products inside of the cart), but need an additional form which consists of a simple textbox and button inside of these tags which will redeem a specific coupon. If I use the HTML tag, the button to go to the next step does not work (as there are now two forms on the page). How would I be able to include this form and then link the 'Redeem' button to a function that I already have in my module? Is there a way to achieve this?
2 Answers
Follow Justin's good advice for coupon redemption using the built-in Store functionality. See Update Cart on the Checkout Tag Docs.
How would I be able to include this form and then link the 'Redeem' button to a function that I already have in my module?
Then along with using the native update cart function you can run your own method when a coupon is redeemed by putting your method in an extension that uses one of Store's Hooks. See Store's Order Update Hooks.
You should be able to add a field for the coupon code into your existing HTML form for the checkout then just include an update cart button next to the coupon code input.