Custom Sorting is not showing all results

Forums › Forums › Search & Filter Pro › Custom Sorting is not showing all results

Tagged: 

Viewing 10 posts – 1 through 10 (of 45 total)
  • Anonymous
    #220426

    Hi there –

    I want to use custom sorting of my query results in order to get my bundle products displayed on top of the page.
    I therefore added a custom field with “bundle-types” so bundles have e.g. “1” and no bundles “undefined”.
    If I sort by bundle-types only bundles are shown – nothing else. I don’t want to add bundly-types to all products subsequently.
    I did not find a metadata filed indicating the product type (bundle or simple-product) that I could use for sorting instead.
    What would be an easy way to achieve that?

    Thanks,

    Paul

    Trevor
    #220435

    If the custom field for a given post has no value, with the way WordPress works, there is no entry at all for that custom field for that post. It isn’t empty as such, it doesn’t exist. So, if you sort by that, all the posts without a value will disappear. Every post MUST have a value, as this is the only way to fix this.

    Anonymous
    #220437

    Hi Trevor,

    thx for the info!
    One more question: it seems that if I use more than 1 sorting criteria, those are combined via AND. Is there a way to combine them via OR?

    Paul

    Trevor
    #220441

    There is not, sorry.

    Anonymous
    #220443

    Is tere a way to add my own Query sorting into the functions or results.php?

    Trevor
    #220447
    Anonymous
    #220514

    Hi Trevor – could you pls explain this in more detail? How would I pass the sorting parameters with this?

    Trevor
    #220534

    The code goes in to the child theme functions.php file. You will need to code it yourself, but it might look like the example this user made:

    https://support.searchandfilter.com/forums/topic/changing-the-deafult-order/#post-207512

    Anonymous
    #221147
    This reply has been marked as private.
    Trevor
    #221201
    This reply has been marked as private.
Viewing 10 posts – 1 through 10 (of 45 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.