• Resolved andynick

    (@andynick)


    Great plugin, but unfortunately this code (below) has started to appear on my Woocommerce site (Front End).
    By a process of elimination, I discovered that if I deactivate the Options for Twenty Twenty-One plugin, the code disappears…

    `jQuery( function( $ ) { $(document).ready(function() { $( document.body ).on( “blur”, “input#billing_email, select#billing_state”, function() { $(document.body).trigger(“update_checkout”); }); }); });

    Obviously, I have deactivated the plugins temporarily.

    I have Options for Twenty Twenty-One Premium.
    Please can you help?

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Oliver Campion

    (@domainsupport)

    Hi Andy,

    Our plugins for Twenty Twenty-One don’t use jQuery as the theme doesn’t use it.

    We’ve installed WooCommerce on our test site and had a look at the Checkout page with our plugins activated but we’re not seeing the issue you mention.

    Does the jQuery code appear on any other pages?

    Where exactly does the code appear? As we cannot replicate this issue it’s going to be tricky to resolve without an example to investigate.

    Please note that due to WordPress forum guidelines, we are not allowed to talk about premium plugins in this support forum.

    Oliver

    Thread Starter andynick

    (@andynick)

    Thank you for your speedy reply Oliver! Great service as ever!
    I don’t know what jQuery is – I’ve only heard of it!

    We’re using Twenty Twenty-One theme, so if you don’t use it, and the theme doesn’t, then is it fair to assume that one of our other plugins is conflicting with Options for Twenty Twenty-One??

    The code appears right at the bottom of the checkout page – above the footer.

    I will re-activate the Options for Twenty Twenty-One plugins and continue to deactivate the other plugins on that site.

    We have Options for Twenty Twenty-One on three other sites, and are getting no errors on those, so that suggests it’s something to do with WooCommerce, doesn’t it??

    You can replicate the issue on our site (once I re-activate the plugins) by adding a product to your cart and then going to checkout. To remove the item from the cart, use the back button to go back to the cart.

    If there’s nothing in your cart and you go to Checkout it’ll redirect you back to the empty cart. That’s not where the code appears.
    Best wishes,
    Andy

    • This reply was modified 3 years, 1 month ago by andynick.
    Thread Starter andynick

    (@andynick)

    When I said we are getting no errors on our other three sites, I should have said the one with the code appearing is the only site we have with WooCommerce on it – and the plugins on the other sites are all pretty much the same. That’s why I suspect a WooCommerce plugin. (Hope that makes sense).

    Options for Twenty Twenty-One plugins are active on the site with the issue again. I’ll leave it active until tomorrow.
    Best wishes, Andy

    Thread Starter andynick

    (@andynick)

    Hello Oliver,
    I just activated your plugin again, and then went through all our other (20) plugins, deactivating each one in turn and then re-loading the checkout page to see whether it made any difference. None of them had any effect.

    Would it be a good idea to delete and then reinstall the Options for Twenty Twenty-One plugins in case they’ve somehow become corrupted?? If I do that, will I lose my previous settings??

    What about one of those database “cleaning plugins” (if you happen to know of a good one). I used “WP Clean Up” this afternoon, but it had no effect on the issue.

    I’m suspecting the WooCommerce PayPal Payments plugin, because upgrading to it (a new PP plugin) is the only real change we’ve mad to the site in ages – but I’m at a loss.

    I REALLY hope I don’t have to ditch Options for Twenty Twenty-One.
    Andy

    Plugin Author Oliver Campion

    (@domainsupport)

    That’s very strange, we’ve added a test product to our test site, added it to the basket and the jQuery code that appears on your site (we can see it on your site now) doesn’t appear on our test site.

    The code that appears is set to update the checkout when the user stops using the email or state (county) fields in the checkout.

    Is this functionality familiar? Have you used a plugin or custom code to do this?

    Why it is being shown on the page is a but baffling!

    I’m looking further at this for you now.

    Oliver

    Plugin Author Oliver Campion

    (@domainsupport)

    One thing to test … can you try turning the sidebar off by unticking the selected locations in “Customizer – General Options – Inject Sidebar”?

    I have a feeling that it MAY be what’s causing the problem.

    Let me know.

    Thanks,

    Oliver

    Thread Starter andynick

    (@andynick)

    That did it, Oliver!
    I must go now, my dinner’s ready!
    I’ll be back in touch tomorrow, but if it comes to a choice, losing the sidebar is preferable to losing Options for Twenty Twenty-One!
    Thanks again for your help.
    Andy

    Plugin Author Oliver Campion

    (@domainsupport)

    OK, so this is what I assume is happening …

    In order to show a sidebar, the plug-in uses JavaScript to wrap the content in an element which it then injects the sidebar into.

    Your WooCommerce installation uses JavaScript (jQuery in this instance) in the page content to perform a cart update task. JavaScript placed like this isn’t great but it would normally work fine.

    The problem is that the process of wrapping the content and injecting the sidebar stops the JavaScript from working and instead is showing it on the page.

    The best way to fix this will be to stop using the sidebar on that page.

    For the meantime, you can do this by turning the sidebar off altogether and then turning it back on page by page (edit the pages you want to display the sidebar on and click to show it in “Theme Options” panel).

    In the future we will allow that toggle to turn the sidebar off as well on a page per page basis.

    I’ll update this thread when it’s been done.

    Oliver

    Thread Starter andynick

    (@andynick)

    Thanks Oliver, that sounds good, but I’m busy upgrading another site at the moment, so I’ll probably wait for your upgrade.
    Thanks again for your excellent plugin – and support!
    Andy

    Plugin Author Oliver Campion

    (@domainsupport)

    Hello Andy,

    We have just pushed an update that adds this functionality.

    Kind regards,

    Oliver

    Thread Starter andynick

    (@andynick)

    Thanks Oliver – that will be very useful!
    Best wishes, Andy

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘jQuery code appearing on checkout page’ is closed to new replies.