Skip Navigation

[Resolved] Problem with view – only functions if I clear the Views cache

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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 5 replies, has 2 voices.

Last updated by patrickM-3 2 years ago.

Assisted by: Waqar.

Author
Posts
#2503431

Tell us what you are trying to do? Trying to use Toolset filters in a view, but having a problem with caching

Is there any documentation that you are following? Views docs.

Is there a similar example that we can see? hidden link and hidden link

What is the link to your site? hidden link and hidden link

Each of those pages displays channels available to customers in packages, Basic, Expanded, Expanded Plus, Premium and Music. The business/video page does not display premium channels.

Users must choose a ZIP CODE because channels are different in different locations.

The View for each page gets all of the channels available based on taxonomy Market Segment, which is either 'business' or 'residential', The View populates a table where each row includes classes of pln_bas, pln_exp, pln_pls, pln_mus and/or pln_prm, depending on whether the individual channel is a member of plans Basic, Expanded, Expanded Plus, Premium or Music.

A separate View called Zip Picker is loaded in the head of the site. The Zip picker view includes the JavaScript that sets a zip code and a region. There are 30 zip codes and they are grouped into East or West. Channel rows also include a class of 'east', 'west', or both, if that channel is available to both regions.

Both pages include a Toolset filter at the top of the table that allows users to choose which package they wish to see - Basic, Expanded, Expanded Plus, Premium (only on the Residential page, hidden link) or Music.

The view filter should display the "updating..." spinner and toggle rows based on east/west, and the package selected.

When the page initially loads, I trigger a click on the Basic plan in order to establish that as the starting point for users. Whenever a user navigates to either page, it should always start with the Basic plan pre-selected.

This entire thing works, but, if I reload the page, or navigate between those 2 pages, it stops functioning and just displays all of the available channels for all the plans. If I flush the View from the cache, the page functions until it gets cached again.

I don't know what is causing this. Maybe I don't need to use Toolset filters at all. Because the view returns all channels for all plans and for both east and west regions, all of the results are loaded to the page. JavaScript then looks at the zip code, figures out if it's east or west, then shows or hides channels based on east or west and the plan selected. Can Toolset filters act on page contents without the need for an AJAX call at all? Is that the problem?

#2503807

Hi,

Thank you for contacting us and I'd be happy to assist.

It is possible to force a view to not use its built-in cache feature, as explained in this forum reply:
https://toolset.com/forums/topic/enable-caching-for-views/#post-1672119

In case the issue still persists, you're welcome to share temporary admin login details so that I can see exactly how these views are set up in the admin area.
( please don't forget to include specific details about each view's function/role and where the custom script can be seen )

This way, I'll be in a better position to suggest some alternate or more efficient approach for the same.

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2504035

I think I figured it out. I have a filter for wpv-location, which is 2 radio buttons; East or West. That input is hidden.

I needed to add a JavaScript function to determine the correct location from the data already present in the page and click on the appropriate radio button option, which will then trigger the Toolset filtering functions.

I added this single line function to the Zip Picker View JavaScript and now the page is working as expected.

#2504039

Most of the time, I can figure things out if I force myself to describe the problem to anyone else. It also never hurts to have the brilliant minds at Toolset - like yours, Waqar, to look at what I'm doing with Toolset and offer any suggestions.

Thanks!

#2506027

Thanks for sharing this update and glad that you were able to sort it out.

I totally agree and writing or describing a problem to someone (or even to one's self) helps in simplifying and narrowing it down, immensely.

Please let me know if you have any follow-up questions and for a new question or concern, you're welcome to start a new ticket.

#2506297

My issue is resolved now. Thank you! The Toolset team is at least as valuable as the product they support.