Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

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

Tagged: 

Viewing 10 posts - 1 through 10 (of 45 total)
  • paul leitner
    #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 Moderator
    #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.

    paul leitner
    #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 Moderator
    #220441

    There is not, sorry.

    paul leitner
    #220443

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

    Trevor Moderator
    #220447
    paul leitner
    #220514

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

    Trevor Moderator
    #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

    paul leitner
    #221147
    This reply has been marked as private.
    Trevor Moderator
    #221201
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 45 total)

The topic ‘Custom Sorting is not showing all results’ is closed to new replies.