Update to BE theme breaks Woocommerce - Sensei Pro button
Hi,
I have successfully used BE theme + Woocommerce + Sensei + Sensei Pro (WC Paid Courses) combination on my website for a while.
Recently PURCHASE THIS COURSE button stopped working. It came up with a tick as if it was adding product to cart, but nothing got added. State of Mind ONLINE CAPABILITY PROGRAM – State of Mind Sydney
I reached out to the plugin developers and got this answer:
* * * *
I've spoke to one of our developers and he said mentioned this:
Looking here, I don't see any modifications related to Sensei Pro that might affect the "Buy Course" button logic. The only recent changes that might affect it are some translation fixes, mostly related to the conversion from Sensei WooCommerce Paid Courses to Sensei Pro, but these don't change the logic at all.
Playing a little bit with the page you just linked using browser's inspectors, looks like the issue reported is more related to a theme's fault, which tries to add a product_id
based on the value attribute of the submit button if the result isn't "undefined" (but that check really doesn't make any sense).
He also provided this code snippet which you could try to use:
add_action( 'wp_footer', function () { ?> <script> jQuery(document).ready(function() { jQuery(".single_add_to_cart_button").val("undefined") }); </script> <?php } );
You could implement this using https://wordpress.org/plugins/code-snippets/. Hope this helps!
* * * *
I applied the code snippet through the plugin suggested and INDEED the PURCHASE THIS COURSE button works, but makes ALL OTHER ADD TO CART buttons not work. For example, this one: N.O.W. Pods – State of Mind Sydney
Before applying the code snippet above, I have done EXTENSIVE troubleshooting - disabling and enabling ALL plugins one at a time, to see if it makes a difference. Testing the site on TWENTY - TWENTY and YES, indeed everything works with default theme.
Thus, it seems to be theme issue.
Please don't get back to me with a blanket "our support does not cover this" answer - as it is clearly a BE theme update that broke the site.
Sensei is a WIDELY respected WOOCOMMERCE official add-on. AND with earlier versions of BE theme, everything worked fine - for years. And now - it does not. I really hope you guys can look into this and come up with a fix. I have been useing BE theme for many years, on several sites, and it is my go to theme, but if issues like this can't be fixed, I need to look elsewhere. So, I am really hopeful that you guys will have some positive news for me soon.
THANK YOU!
Comments
Hi,
Please, go to WooCommerce -> Settings -> Products, disable the AJAX option, and check if the problem persists.
Thanks
Thank you very much for this effective and simple advice!
You are welcome.
If you have any other questions or problems, feel free to ask.
Thanks