- This topic has 2 replies, 2 voices, and was last updated 11 years, 7 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Add an item to the cart using javascript instead of the button
This may be a dumb question, but I have a need to submit information via a form and would like to be able to put an add to cart button on the page, but hidden, but still show the price, quantity and variations (I’ve figured out that part).
The question is how can I “activate” the add to cart using php or javascript?
Each eStore payment buttons have a class attached to it. So using JQuery you can target that button and deactivate or reactivate it (set the status of the input form to be disabled) from your JQuery code. You will need good JQuery understanding to develop custom code like that though.
Also, check this feature of eStore that might give you an alternative way to do what you are after:
That might be a great solution. The problem is I have a quantity and variation for the button that needs to be sent. If I could dynamically send that info it would work.
Otherwise, what I need is to use code to “press” the hidden add to cart button after processing my form.