Forums » Plugin: Order Tip for WooCommerce » Required Fields Notices

  • Resolved johnosmond

    (@johnosmond)


    Hi I recently created a topic that I titled “Why Update Checkout”. I wasn’t very clear in that topic (and don’t know how to remove it). So I’m posting this topic which hopefully will be more clear.

    I created a video demonstrating the issue:
    https://youtu.be/sV5hJ7XG12E

    I believe the issue stems from an AJAX POST command that is being executed from within the WooCommerce form object, thereby forcing that form to post.

    Otherwise, great plugin. Thanks for your help with this issue.

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • 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.

    • This reply was modified 2 years, 5 months ago by Vijay Hardaha.
    Thread Starter johnosmond

    (@johnosmond)

    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.

    Thread Starter johnosmond

    (@johnosmond)

    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.

    Thread Starter johnosmond

    (@johnosmond)

    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.

    Plugin Author railmedia

    (@railmedia)

    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

    @railmedia Glat to know.

    Best
    Vijay

    Plugin Author railmedia

    (@railmedia)

    Hi,

    I added this small change in v 1.2.2.

    Please update when possible.

    Best regards

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Required Fields Notices’ is closed to new replies.