Doensnt work with The Shop Theme
-
Hey Taisho,
you plugin was working fine, and after update it stoped to work. I am using the shop theme.
https://www.loom.com/share/1f1728c196e34b6a8ad61e9fcd58fd16
The page I need help with: [log in to see the link]
-
Hello,
what was the last version when the plugin worked correctly for you? Does the 500 error (network tab in Chrome dev tools) on the page load appear when the plugin is deactivated?
I see that the inline js doesn’t exist in the page’s HTML what is the direct reason why the buttons don’t work. JS is enqueued inline instead of using a js file since version 2.3.
Best Regards
-
This reply was modified 6 years, 6 months ago by
taisho.
To further help with troubleshooting, you could put this line as the 1st line of the function
qib_enqueue_script()in plugin’s PHP file:echo 'test';This would give an answer to whether the function executes at all. If the ‘test’ doesn’t show up on the top of the screen, you may try to change this line:
add_action( 'template_redirect', 'qib_enqueue_script' );to:
add_action( 'template_redirect', 'qib_enqueue_script', 20 );and this:
add_action( 'template_redirect', 'qib_add_to_cart_quantity_handler' );to:
add_action( 'template_redirect', 'qib_add_to_cart_quantity_handler', 30 );-
This reply was modified 6 years, 6 months ago by
taisho.
Added the echo ‘test’; and also changed the lines add_action( ‘template_redirect’, ‘qib_enqueue_script’ ); and add_action( ‘template_redirect’, ‘qib_add_to_cart_quantity_handler’ );
It doesnt help. Maybe you can write me an email so I will provide you access to admin?
The “test” shows up, so the function executes and the other code lines that I gave are definitely not needed then.
The problem is with built-in WooCommerce function
wc_enqueue_js. Somehow the script doesn’t get added to page’s HTML. It’s definitely not a simple bug because it works correctly on a few test environments. I had no other reports of such a problem and version 2.3. was released a couple of weeks ago.Please deactivate the plugin and check whether error 500 still appears on page load. If it does, it may be the reason why the
wc_enqueue_jsfunction breaks. If there is no error 500 after deactivation it means that the plugin causes it, which would be very strange and hard to troubleshoot.I deactivated the plugin. Could you please check again?
The error 500 (in chrome F12, Network tab, then reload the page) still persists with the plugin deactivated. It means that the HTML document is not correctly loaded for some reason. The 500 errors are rather hard to troubleshoot.
Probably this error also happened with the old plugin version but using a separate file for the scripts made the plugin work correctly anyway. There is a big chance that when this error is gone, the plugin will work as it should.
Got error log:
[Wed Aug 14 13:30:56 2019] [error] [client *****] The WC_Cart::get_cart_url function is deprecated since version 2.5. Replace with wc_get_cart_url.
Any idea?
It means that something, possibly your theme uses
WC()->cart->get_cart_url()that no longer works since WooCommerce version 2.5 andwc_get_cart_urlshould be used instead.I see that now the website works correctly with the current version of Qty Increment Buttons, so I’m closing this topic.
-
This reply was modified 6 years, 5 months ago by
taisho.
-
This reply was modified 6 years, 6 months ago by
The topic ‘Doensnt work with The Shop Theme’ is closed to new replies.