Add more sorts

  • wpsolr
    Keymaster
    # 3 years, 9 months ago

    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
    # 3 years, 7 months ago

    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
    # 2 years, 4 months ago

    Hi There,

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

    wpsolr
    Keymaster
    # 2 years, 4 months ago

    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
    # 2 years, 4 months ago

    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
    # 2 years, 4 months ago

    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
    # 2 years, 4 months ago

    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
    # 2 years, 4 months ago

    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.