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

Result count css selector <p> element disappears after first ajax filtering

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.

Hello,

I use flatsome theme, which displays the result count <p> element separately from products, so I need to use"Result count css selector" in ajax mode. It works ok, the element is found, but the wrapper <p> element gets rewritten (only text remains), and because of that, the next filter cannot find it.

Example:

Original element:

<p class="woocommerce-result-count hide-for-medium">
Showing 1–36 of 69214 results</p>

After filtering:

Showing 1–36 of 69214 results

(the wrapper <p> element disappears, only text remains)

I included links in the private section.

Hello

It looks like the functionality that overrides this counter does not work in ajax mode.  Perhaps there is a check like: is_woocommerce() or is_shop() - but this does not work in an ajax request

Hello Pablo,

I looked deeper into your code and found the problem. The result count string is being sanitized, thus the html tags are removed. It is defined in"WOOF_HELPER::sanitize_array" method. The $key is the value, which class should be redrawn, in my case, it is".woocommerce-result-count". Since it is not present in $is_html array, the $data is fully sanitized. I need it to be treated az html, so wp_kses_post() should be used.

As a workaround, I added the following code after line 54 (woocommerce-products-filter/classes/helper.php):

if (get_option('woof_settings') && isset(get_option('woof_settings')['result_count_redraw'])) {
     $is_html[] = get_option('woof_settings')['result_count_redraw'];
}

I'm pretty sure this can be achieved a lot more elegantly, but works for me. As for you, I would appreciate if you colud implement a fix in the next update.

Thank you

Hello

OK! Thank you for your cooperation

I passed this on to the developers