You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For anyone else who finds this: watch out! This method also returns matching assets, categories, etc to elementQuery. Listing entries and products with the for/if statements was fine but it really messed up my pagination.
I ended up doing a search query for elements, a search query for products, merging them to 1 collection, and then my for loop includes a twig sort with spaceship operator (https://twig.symfony.com/doc/3.x/filters/sort.html). I'm open to modifying my code if anyone has thoughts/suggestions for improvement.
Description
Client wants products to be included in site search.
Steps to reproduce
{% set entries = craft.entries().search(query).orderBy('score').limit(4) %}
Additional info
The text was updated successfully, but these errors were encountered: