PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

assignment to undeclared variable woof_current_values after 2.2.9.3 update

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Updated from 2.2.8 (which worked without js error) to 2.2.9.3 and now get the following JS error in the browser console when I load a page with filters on it, like a product category archive and none of the filters actually do anything.

Uncaught ReferenceError: assignment to undeclared variable woof_current_values
<anonymous> https://URL/wp-content/plugins/woocommerce-products-filter/js/front_comprssd.js?ver=2.2.9.3:1
jQuery 4
front_comprssd.js:1:184
<anonymous> https://URL/wp-content/plugins/woocommerce-products-filter/js/front_comprssd.js?ver=2.2.9.3:1
jQuery 4
i
fireWith
ready
J

If I roll back it all works again. Thoughts?

Hello

Enter valid purchase code on the secret area https://c2n.me/4gzEoak.png and provide there link to the site with issue

"Thoughts" - reset browser cache, check cache plugins settings about js links

Tried clearing the cache and disabling JS optimization features in caching plugin. Also ensured I have my web inspector open in the browser and cache not enabled when reproducing issue.

Hello

Please  drop  me  wp-admin access - https://share.pluginus.net/image/i20210618130614.png -> https://share.pluginus.net/image/i20210618130637.png

Access provided!

Hello

Please fix  this  error = https://share.pluginus.net/image/i20220930090339.png

It seems you found the issue. Your code update caused that javascript output (from the WOOF settings panel) to encode the > incorrectly. See screenshot of the settings panel: https://share.getcloudapp.com/llud6nA9

If you can fix the WOOF code so it doesn't run that javascript box's value through htmlentities, then that would solve that problem :)

Hello

We have made field clearing as required for all wordpress plugins. You can  disable  it. In  file -  wp-content\plugins\woocommerce-products-filter\index.php - delete  this  code - https://share.pluginus.net/image/i20221003085150.png

Thanks, that fixes it. When this plugin updates, it's going to overwrite those changes though - will this be fixed in all upcoming updates to the plugin?

Hello

You need to do this every plugin update.

Hi Pablo,

Help me to understand this logic. The plugin provides a field where you can enter Javascript. Yet when I enter valid Javascript in the very box that is specifically for this purpose, it breaks the plugin functionality entirely on the site. Instead of considering this a bug that is to be fixed in the next release, you consider it valid behaviour that *I* need to patch on every update?

So I can avoid this foolishness, is there another way to apply Javascript that runs after WOOF has initialized on the page? If so, please provide sample code that I can place in my main javascript file for my theme.

Hello

Please  use  JS event - 'woof_ajax_done'

Unfortunately, Wordpress has such new requirements for authors. Of course we will look for a solution

Can you provide an example of how the woof_ajax_done event is to be used? I'm accustomed to events being triggered on selectors, but I don't know what the selector would be for this.

As for the settings option"JavaScript Code After AJAX is Done" -- since code entered here could cause the entire plugin to fail, should there be a warning underneath its title indicating that it doesn't always work and an example of how to use the woof_ajax_done event in theme code? Or a link to a KB article on your site about all this?

 

Hello

jQuery(document).on('woof_ajax_done', function(){

alert();

});

I will forward your idea to the developers

Thank you! This worked well.

I'd strongly recommend deprecating the JS box that's in the extension settings in favour of using the above javascript event code, and perhaps provide steps showing how people could use it. I put it in the theme's javascript, but you could recommend a couple plugins that do the job as well.

Hello

Ok!

I recommend you use a child theme for this.