Unexpected behaviour when filtering

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Unexpected behaviour when filtering

This topic contains 11 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 1 year, 2 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #36153
    Preet
    Preet
    Participant

    Hi there and happy new year!

    I am really struggling to implement settings.

    For a custom taxonomy, “Restrictions” made by Toolset, a product has a restriction such as “vegan” or “gluten-free” only if it is certified as such. I want only certified products to be returned if these filters are used. So I have set:
    Frontend Search Settings > Advanced > Show posts/CPM with empty (missing) taxonomy terms? To Off
    I have set all terms to unchecked by default. And set Ignore checkbox filters that have nothing selected? To On.

    My understanding of this is that the checkboxes will be ignored until at least one is checked, and then only those results will be returned.

    However, with Show posts/CPM with empty (missing) taxonomy terms? Off, no products are returned at all. This is the setup of the search demo here https://xyz.shop/search-demo/

    You can use probiotics as a search term and gluten-free as a restriction. Here is an example of a product that should be returned https://xyz.shop/product/proven-probiotics-fit-for-school/

    Here is a Loom describin it [xyz]

    I am using the Index table, and have products-Restrictions selected for indexing.

    Can you think what could be my problem?

    Many thanks,

    • This topic was modified 1 year, 2 months ago by Preet Preet. Reason: privacy
    #36157
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Christopher,

    We wish you a happy new year too!

    You are probably looking to change this option: https://i.imgur.com/yHbWd4H.png
    With the default setup, the unchecked checkboxes are treated as “exclude” – so if the item is within more than one category, and only one of them is checked, it will be excluded.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #36158
    Preet
    Preet
    Participant

    Hi Ernest,

    Thank you for that. Unfortunately for these restrictions it does need to be an AND filter.

    If the searcher needs to be both Gluten-free AND Dairy-free, we don’t want to return results that may only be one of them. That is what I thought I had allowed for.

    Best wishes

    #36160
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    In that case use the third logic: https://i.imgur.com/Udguphf.png
    That is basically an “AND” logic, but a bit more strict as only the exact combinations are allowed.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #36162
    Preet
    Preet
    Participant

    Aha! Brilliant! Thank you. That is much better. A game changer!

    The next issue is that I am having trouble searching for strings with one letter words. eg. Vitamin A. I have set primary keyword logic to AND with exact matches, and min word length to 1, but a product with “Vitamin A” in the title, content and category is subordinate to other products that don’t have it in the title or category, and lots of other categories are returned above it.

    Another niggle is that products with none of the restrictions checked (eg books) are still returned. Is it possible to stop that?

    Thank you.

    #36166
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You are welcome!

    The results returned when searching “vitamin a” match, because both the “vitamin” and the “a” keyword matches within the contents of those results.
    If you want to be more strict, then you can either turn off the matches from within the contents, or use exact matching.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #36169
    Preet
    Preet
    Participant

    Hi there,

    Thank you, OK, there seem to be quite a lot of trade-offs, like intense strictness and losing the index table which may not be worth it for this which is probably the hardest search string. The worst edge case.

    Switching to some issues I’m having with the Frontend Search Settings…
    Multiselect with search does not seem to respect the Filter boxes max height. Is that right?

    Thanks.

    #36171
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Yes, that is intentional for better layout.

    You can however easily force it via some custom CSS:

    fieldset[class^=asp_filter]>div {
        max-height: 200px;
        overflow: auto;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #36173
    Preet
    Preet
    Participant

    Odd, this doesn’t seem to work. Other minor issues with the settings dropdown formatting include:
    1. the placeholder text for the multi box is lighter than the others
    2. When displayed in columns on mobile, it spills off the left hand side of the screen. Can it be made to drop down from the far right edge of the magnifying glass icon, instead of the settings dropdown?

    Thanks

    #36182
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Make sure to clear the complete site cache for the custom CSS to take effect.

    1. It follows the default browser colors. Try:

    input[class*=select2]::placeholder {
      color: #1f1f1f;
      font-family: Roboto,Helvetica;
      font-size: 14px;
    }

    2. I’m afraid no, but you can rather choose a block layout instead of the hover, so the items follow the document flow, instead of hovering over the contents.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #36223
    Preet
    Preet
    Participant

    Hi there,

    Thank you. I don’t think it is caching, as I am generally able to get CSS to update immediately, and have tried clearing all the caches.

    It’s also quite odd that when I choose Block, the Settings drop-down background color changes to transparent, adopting the colour of the background of the Elementor block that it is in.

    input[class*=select2]::placeholder worked well, and I specified my custom font (Myriad-pro), as I have specified it everywhere. But still the other drop downs in there are showing Helvetica. I have no idea where they are getting that from. Do you have any idea about that? It’s pretty much there now, but it would be good to iron out that niggle.

    #36239
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    It looks like the inherent font is overrriding some of the items from Elementor, at least that is what I am seeing in the console.
    Maybe try forcing all of the fonts within the search to myriad pro:

    .asp_w, .asp_w *,
    span.asp_select2-container ul li {
        font-family: 'Myriad-Pro', myriad-pro, sans-serif !important;
    }

    That should take care of everything.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

You must be logged in to reply to this topic.