Hi, I have a Custom search which uses AJAX for refreshing search results. If I load the page for first time the View (displays the lowest price from child posts of the parent CPT) will display correctly, but if I click on search button or change anything from filtering, it will not show the View output.
View contains only this code:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[types field='cena-varianty' output='raw'][/types]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]
This displays the View:
[wpv-view name='nejnizsi-cena-varianty-zazitku']
Hi, can you share some screenshots showing the View settings in wp-admin, including the Content Selection, Query Filter, Query Options?
Then, in your loop output area try the following code as a test:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
Inside the loop<br />
[types field='cena-varianty' output='raw'][/types]<br />
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
No items found
[/wpv-no-items-found]
[wpv-layout-end]
What are the results before and after filtering?
Hi, the result before filtering: "Inside the loop" and after filtering "No items found".
There are no Query Filters applied to this View except the post relationship filter. So I'm not sure what you mean by "if I click on search button or change anything from filtering, it will not show the View output." How are you changing anything from filtering? What filter controls do you have in this View? Please take a screenshot showing your Filter Editor area, or copy + paste the code here, or let me take a look at your wp-admin area so I can make some recommendations. If that's okay with you, please provide login credentials in the private reply fields here. Let me know where I can see the search form on your site, and I will take a look at how everything is set up.
Sorry, I don't see any prices here:
lien caché
The screenshot you posted is not the View shown at /zazitky. This is the View shown at /zazitky:
lien caché
It has quite a few query filters and filter controls, and in the loop template it has several conditionals. I believe the conditionals are hiding the prices. When I load the page for the first time, I do not see any prices in the results, so I'm not sure what the problem is, but this looks suspicious:
[wpv-conditional if="( '[wpv-view name='nejnizsi-cena-varianty-zazitku']' ne '' )"]
I know we worked on another ticket about removing spaces from View output, and I believe you may need to apply the same filters to this View if you want to use it in a conditional.
Hi,
you can see the prices on the site lien caché (see printscreen lien caché) and this is after hiting the search button or changing anything on search parameters in frontend: lien caché
The conditionals work fine (its used for defining 0 as a free product,...)
Please edit the Post Relationship filter here:
wp-admin/admin.php?page=views-editor&view_id=972
You should select "The current post in the Loop" instead of "Post where this View is shown".
Thank you, Christian, it helped.