My primary issue is that when I set the sorting option and click submit, it reloads the page without doing any sorting, and the sort dropdowns revert back to the default Ordering setting for the page (currently Field - Price, Ascending).
It doesn't seem to matter whether I select any other filters (but I need it to work either way).
It seems to work if I change it to AJAX (results update when visitors change any filter values). However, this brings me to my secondary issue - the Loop Content Template shows the Visual Composer shortcodes. They only seem to be rendering properly when the page fully refreshes.
I'd love to find a solution to fix both of these issues!
I'm also wondering if there's some way to include ascending and descending versions of the same field in the sorting controls dropdown. For example, there would only be one dropdown that includes:
- Price (lowest first)
- Price (highest first)
- Mileage (lowest first)
- Mileage (highest first)
Instead of two dropdowns:
- Price
- Mileage
- Ascending
- Descending
When I try to configure this, it won't allow me to use a single field twice. I tried putting Price - Ascending and Price - Descending in the same sorting shortcode, and it stripped the second one. Any way around this?
Thanks as always! Let me know if you have any questions!
PS, I have a staging copy of the site here: hidden link Please give me a private reply box and I will pass along login info!
Also, I have already tried disabling all other plugins, and using twenty fifteen.
Dear Nick,
Thanks for the details.
Q1) It doesn't seem to matter whether I select any other filters
It is abnormal, it should be able to works with please check these:
1) Make sure you are following our document to setup the sorting controls:
https://toolset.com/documentation/user-guides/allowing-visitors-to-sort-the-front-end-results/
2) in case there is any compatibility problem in your website, please deactivate other plugins and switch to wordpress default theme, and test again
Q2) I'm also wondering if there's some way to include ascending and descending versions of the same field in the sorting controls dropdown.
There isn't such a built-in feature within Views plugin, if you agree, we can take it as a feature request, our developers will evaluate it.
Hi Luo,
Thanks for your reply, but I feel like maybe you didn't read my full post...
Also, I have already tried disabling all other plugins, and using twenty fifteen.
Here's my staging site with all plugins disabled (except types and views): hidden link
You'll notice it still doesn't work.
I have definitely set up the controls in accordance with your documentation.
I'm also still wondering why it might work with AJAX updating enabled, but not with page refresh/search button. And why, with AJAX, it doesn't render the visual composer shortcodes.
As I mentioned, if you give me a private reply box, I will send over login credentials for my site/staging site.
Thanks!
Please provide a database dump file(ZIP file) of your website in below private detail box, I need to test and debug it in my localhost, thanks
Thanks for the details, I am checking it in your website, will feedback if there is anything found
Here is what I found, in the problem page:
hidden link
you are using below settings:
1) Display the custom search form with a widget
[wpv-form-view name="inventory" target_id="self"]
2) Display the search result with shortcode:
[wpv-view name="inventory" view_display="layout"]
There is a missing URL parameter when user submit the search form:
wpv_view_count=53-TCPID9
So I edited the view "Inventory":
hidden link
in section "Filter Editor", line 4, add a hidden field:
<input type="hidden" name="wpv_view_count" value="53-TCPID9">
It is a limitation of Views plugin, when you display the custom search form and search result, it does not pass parameter "wpv_view_count", which conducts the problem.
Thanks for figuring this out!
Can you tell me why this line isn't added automatically using the Sorting Controls script generator? How would I reproduce this if I needed to use a similar setup on another site (what is this code doing, and how is it determined)?
Also, do you have any insight into my other question - why the visual composer shortcodes fail to render if I use AJAX instead of a submit button?
You can see this issue in action now here: hidden link (just change a filter or sort option).
Q1) Can you tell me why this line isn't added automatically using the Sorting Controls script generator?
https://toolset.com/forums/topic/sorting-controls-not-working-and-other-related-questions/#post-580464
As I mentioned above, It is a limitation of Views plugin, when you display the custom search form and search result, it does not pass parameter "wpv_view_count", which conducts the problem.
If you agree, we can take it as a feature request, our developers will evaluate it
Q2) How would I reproduce this if I needed to use a similar setup on another site (what is this code doing, and how is it determined)?
You will need to display both the search form and search result with the same Views shortcode, for example:
[wpv-view name="inventory"], test it in the front-end, submit the form, then you will be able to get the URL parameter "wpv_view_count" value.
Q3) Also, do you have any insight into my other question - why the visual composer shortcodes fail to render if I use AJAX instead of a submit button?
It is a new question, please create new thread for the new question, that will help other users to find the answers. Thanks