Skip Navigation

[Closed] View filters aren't disabled on load, only after clicking a filter

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 19 replies, has 2 voices.

Last updated by Shane 4 years ago.

Assisted by: Shane.

Author
Posts
#1894409

Tell us what you are trying to do?
Have the filters that aren't available be grayed out on page load

How to reproduce:
Go to https://toolset.com/documentation/user-guides/views/filtering-views-by-taxonomy/. To see the filters grayed out, click a color family in the lefthand sidebar or click "clear filters".

What is the link to your site?
hidden link

#1894991

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ken,

Thank you for getting in touch.

In order to best help with this you you will need to let me know how this search was built.

Was it done using the Classic views editor or was it done use the Block editor with our Toolset Blocks plugin.

Please let me know and we can take alone from there.

Thanks,
Shane

#1895119

Hello Shane,

This was built using the Classic views editor.

Thanks,
Corey

#1895233

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ken,

Thank you for the information.

In this case you will need to do the follow:
1. Edit your view and scroll to the Custom Search Settings
2. Select Let me choose individual settings manually
3. Under "Which options to display in the form inputs" Select "Show only available options for each input"

From there you can choose the action of the elements based on their type.

Please let me know if this helps.
Thanks,
Shane

#1895303

Thanks Shane,

We already have that enabled actually. Each input type is set to "disable". if I change that to "hide" the same issue remains, and the filters won't disappear until we click "clear filter" or select a filter.

Best,
Corey

#1895381

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Corey,

I did a check on your site again and saw why this isn't working as intended.

The problem is because the View filters and Results are separated.

I see that you have it in a Woocommerce sidebar. I dont believe the option to vary the output on the initial load unless the view and search bars are connected.

Thanks,
Shane

#1895441
Screen Shot 2021-01-05 at 2.14.52 PM.png
Screen Shot 2021-01-05 at 2.14.56 PM.png
Screen Shot 2021-01-05 at 2.15.01 PM.png
Screen Shot 2021-01-05 at 2.15.06 PM.png
Screen Shot 2021-01-05 at 2.15.14 PM.png

Thanks Shane,

Unfortunately I'm not sure what you mean. We did wrap the filter in our own html (it's not inside the woocommerce plugin), but that was suggested by the wizard for the "Output Editor". We're using one shortcode to show both the view filters and results.

To test this out - I made a new from-scratch view (following the wizard), and it exhibits the same symptoms. Take a look here: hidden link

You'll see all of the color families listed to the left, until you click one - then the color families with no items in them disappear from the filter list. I'm also attaching screenshots of all of the backend settings we're using on this new view.

UPDATE: We're seeing two of our views working correctly now, and the others still aren't... it seems to have to do with pagination settings.

Best,
Corey

#1895561

Followup: We tried changing themes, which seemed to get the "roll paper" view to work, but that could be a coincidence. We have some views have this issue on both our theme and the 2021 theme.

Caching seems to have something to do with this. I had a test view that was working (filters disabled on load), but then I clicked "Clean Cache" on the View backend screen and it stopped working as it should.

As of right now, the following view works:
hidden link

These do not:
hidden link
hidden link
hidden link
hidden link

Let me know if you'd like backend access to see this for yourself.

Thanks again,
Corey

#1895573

Further Update - We just tried the following:
1) Switched theme to 2021 theme
2) Disabled all plugins except for Toolset (Types, Views, WC Blocks) and WooCommerce

The issue of the filters not being disabled on load remains.

#1895619

Apologies for all the replies to this, but I wanted to add that our one working view, Roll Paper, is no longer currently working (in case you check it and find it not working).

We ran a product import (using WP All Import), which I assume tripped the cache since it added more products to the database. These products were not the category of products that are shown in the Roll Paper view, but I guess that doesn't matter.

After running the import, WooCommerce had to run a scheduled action

wc_update_product_lookup_tables_rating_count_batch

(didn't think this mattered, but wanted to include it.)

Thanks again,
Corey

#1896355

This error appears in our logs when we use the Roll Paper view:

[06-Jan-2021 16:27:54 UTC] product_type was called incorrectly. Product properties should not be accessed directly. Backtrace: do_action('wp_ajax_wpv_get_view_query_results'), WP_Hook->do_action, WP_Hook->apply_filters, WPV_View_Post_Query->wpv_get_view_query_results, render_view, OTGS\Toolset\Views\Controller\API\Methods\RenderViewHandler->process_call, WP_Views->render_view_ex, WP_Views->render_view, wpv_do_shortcode, do_shortcode, preg_replace_callback, do_shortcode_tag, Class_WooCommerce_Views->wpv_woo_buy_or_select_func, woocommerce_template_loop_add_to_cart, wc_get_template, include('/plugins/woocommerce/templates/loop/add-to-cart.php'), WC_Product_Simple->add_to_cart_url, apply_filters('woocommerce_product_add_to_cart_url'), WP_Hook->apply_filters, WP_Views->wpv_woocommerce_product_add_to_cart_url, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.
[06-Jan-2021 16:27:54 UTC] product_type was called incorrectly. Product properties should not be accessed directly. Backtrace: do_action('wp_ajax_wpv_get_view_query_results'), WP_Hook->do_action, WP_Hook->apply_filters, WPV_View_Post_Query->wpv_get_view_query_results, render_view, OTGS\Toolset\Views\Controller\API\Methods\RenderViewHandler->process_call, WP_Views->render_view_ex, WP_Views->render_view, wpv_do_shortcode, do_shortcode, preg_replace_callback, do_shortcode_tag, Class_WooCommerce_Views->wpv_woo_buy_or_select_func, woocommerce_template_loop_add_to_cart, wc_get_template, include('/plugins/woocommerce/templates/loop/add-to-cart.php'), WC_Product_Simple->add_to_cart_url, apply_filters('woocommerce_product_add_to_cart_url'), WP_Hook->apply_filters, WP_Views->wpv_woocommerce_product_add_to_cart_url, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.
#1896541

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ken,

Would you mind providing me with admin access to the site so that I can log in and have a look on this from my end ?

I've enabled the private fields for your next response.

Thanks,
Shane

#1897749

Shane,

There's another bug we found that's related to this issue. We can tell it's related because for the short time that the "Roll Paper" view filters worked on load, this bug stopped occurring.

The bug:
Clicking "clear filters" makes the very last product disappear.

To reproduce:
1) Go to either of the following views:
hidden link
hidden link
2) Click "Clear Filter"
3) The very last product disappears

Thanks again,
Corey

#1897941

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ken,

So I managed to do some checks and test on a fresh site and found that the issue is isolated to only your website.

On my test site the items load initially with the items disabled.

Would you mind if I gabbed a copy of the site to test further? Are there any custom code on the site that I should be aware of ?

Thanks,
Shane

#1897999

Shane,

Please feel free to make a copy.

The WST Theme is a custom theme, so it's all custom code to a certain extent.
However -- we tried switching to the 2021 theme (which should remove all of our custom code) and still had the same issue. On the 2021 theme we even disabled all plugins except for Toolset and WooCommerce, with no luck.

Let me know if you need anything else.

Thanks,
Corey

The topic ‘[Closed] View filters aren't disabled on load, only after clicking a filter’ is closed to new replies.