Add more sorts

  • wpsolr
    Keymaster
    5 years, 7 months ago #7045

    The current sorts are:
    – Relevancy
    – Post date
    – Number of comments
    – Custom fields (with a sortable index type)

    The following sorts will be added soon:

    – author
    – Post ID
    – Post title
    – Post type
    – Random
    – Menu order
    – Last modified

    wpsolr
    Keymaster
    5 years, 6 months ago #7183

    WPSOLR 21.0 was released today. It includes all the new sorts described in the topic header.

    New sorts available in WPSOLR admin

    O-O
    Participant
    4 years, 3 months ago #17481

    Hi There,

    Is it possible to add my own sort? I would like to add an attribute to sort on.

    wpsolr
    Keymaster
    4 years, 3 months ago #17482

    Product attributes are now taxonomies, hence are not sortable in WPSOLR. Custom fields and ACF fields are sortable.

    Can you give me an example of a sortable product attribute?

    O-O
    Participant
    4 years, 3 months ago #17483

    What do you mean with ACF fields?

    for example we have a product attribute where we have numbered our best products. So we would like to use the sort place our best products on top of the page.

    wpsolr
    Keymaster
    4 years, 3 months ago #17485

    You can add fields to post types (including products) with the plugin ACF: https://wordpress.org/plugins/advanced-custom-fields/

    From your example, you can use ACF (or other means) to create a new custom field (type “number”), then select it in screen 2.2 and 2.5

    O-O
    Participant
    4 years, 3 months ago #17490

    I added the attribute as custom field, but do not see it in screen 2.2 en 2.5. I do see the attribute in 2.2. But it is not possible to add it to my sort.

    wpsolr
    Keymaster
    4 years, 3 months ago #17492

    Set your custom field with a value on at least one product. Then in 2.2, select it in the post type “Products” fields section. Use a type “Integer” or “Real number”.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.