The problem is because of coding standards.
Plugin is using <button>...</button> for each tip value but plugin developer didn’t specified type="button" in button tag.
so it’s acting like <button type="submit"> on page load. so basically when you click the tip button, you actually submit the form, and when the form submits it proceed the checkout, and the validation for fields starts.
the simple solution to fix this issue is to specify type="button" in the tip button HTML tag and the problem will be gone.
Thanks.
Hi Vijay. Thanks for the reply, but that did not fix the issue.
I found the <button> elements that add the tips and inserted the type=”button” attribute like you suggested. That caused the plugin to stop working and somehow caused most of my site to freeze.
I tried it several times thinking I might have made a mistake, but it broke it every time.
Not sure, but I think those buttons need to be submit buttons because the plugin works with an ajax POST command.
make sure you change double quote if you’re doing copy/paste type="button"
<button id="woo_order_
will be changed to
<button type="button" id="woo_order_
submit button is only required to submit a form. you might be making typing mistake that’s why your website is breaking after making change on the file.
you have to make changes in frontend/views/main.views.class.php file you’ll find 4-5 button HTML tag in that file make changes in all those button tags.
Hi Vijay. Well, I tried again. This time I recorded my steps. I think what you’re saying makes sense, but there is something else happening.
My guess is that maybe the plugin author is using a jQuery selector to select and control the on(“click”) property of the buttons, and perhaps changing the type breaks that. ???
Anyway, here is the screen-cast:
https://youtu.be/Otl0eiTpyQM
Can you check the error log in console and log file or in woocommerce log(in the backend) when you have that spinning issue?
I can’t test it right now. spinning comes when you have an error in the ajax response. so you need to figure out when you make changes in the file then what mistake is causing the error and stopping ajax to work properly.
Well, I don’t know what to say here. I tried to recreate the error again to look at the console like you suggested, and now it works fine. Not sure what changed on my end, but thank you for your suggestions.
Hope this thread helps someone else with a similar issue.
Haha, Cheers \(‘_’)/ Good to know it’s solved.
Hi guys,
@vijayhardaha thanks a lot for spotting this. It has definitely slipped on my end. I’ll push another update in the following days and I’ll include the type attribute on the <button> tags.
Best,
Adrian
Hi,
I added this small change in v 1.2.2.
Please update when possible.
Best regards