• Resolved fixpaana

    (@fixpaana)


    Hey, I am testing out my website and it seems the search filters are not working. I am referring to the filters that appear on the left side of the screen when the user is browsing though the listings. Whenever I select to filter by a certain attribute, it says “nothing found”.

    Also, I currently have 3 listing Categories created. In the search box, when I select to display listings from each category individually, the filters appear but when I select to display listings from all categories, the filters disappear.

    What am I doing wrong? How to fix this issue?

Viewing 15 replies - 1 through 15 (of 20 total)
  • Theme Author HivePress

    (@hivepress)

    Hi,
    Please make sure that there’s no filter that may cause this issue, e.g. if there’s a number range filter (e.g. Price) but no listings with the filtered value, there will be no results.
    Filters may disappear if they are category-specific, please edit these attributes in Listings/Attributes and check if they are assigned to some categories, if so then these filters will not appear for all categories.

    Thread Starter fixpaana

    (@fixpaana)

    Thank you for the reply.

    Okay, what you are saying is correct. I now have narrowed it down to one particular attribute (Year of manufacture) that’s giving me a problem. I am making a listings site for used cars and I have currently two options for the year of manufacture for the user to select from when submitting the listing: 1900 and 1990. For the filters I have set it as a range between min and max value of 1890 and 2000 respectively. All my test listings currently have the year as 1900 and so I was expecting them to be displayed when the the entire range was selected as a filter. But it still gives me “nothing found” when i hit the filter button with the range 1890-2000 selected.

    The filters work fine if I remove the Year Of manufacture attribute from the filter option. Anything else I am missing?

    link to the site: https://fixpaana.in/

    edit: is it because i have set the date as a selectable/drop down menu attribute and not an attribute that the user inputs by typing?

    • This reply was modified 2 years, 10 months ago by fixpaana.
    Theme Author HivePress

    (@hivepress)

    Sorry if it’s confusing, there may be incompatible edit/search types. If it’s a selectable attribute, then its search type can’t be set to the Number Range, because selectable attributes are registered as custom taxonomies, not numeric values. I recommend switching the edit type to Number and limiting values (e.g. from 1990 to 2022). Then users will be able to set a valid year and it’ll be searchable via the number range filter.

    Thread Starter fixpaana

    (@fixpaana)

    I tried doing what you suggested (now Year of Manufacture is a number field type) and then added a new listing with a year of manufacture of 2000 and set the filter to 1890 to 2000 the result is still “nothing found”, I even moved the higher limit of filter to 2001 as well as change the year on the listing to 1999 and the result is still the same.

    You can perhaps check this link to my website: https://fixpaana.in/index.php/listing-category/bikes-for-sale/

    edit: could it be because the Year of Manuf is a shared attribute among two of my categories? I personally don’t think it should affect it.

    • This reply was modified 2 years, 10 months ago by fixpaana.
    Theme Author HivePress

    (@hivepress)

    Please try setting up this attribute in the same way as in this screencast https://help.hivepress.io/article/75-how-to-add-listing-attributes It shows how to add the Price attribute but it works in the same way and it seems to be ok on the demo site. If the listing is still not found please try re-saving it and unpublish other attributes one by one to check which attribute causes the search issue. For example, if there are number range filters in the search form then all of the number range attributes should be set for a listing, otherwise it will not be returned.

    Thread Starter fixpaana

    (@fixpaana)

    Here’s what I did, I deleted the attribute and added a new Year of Manufacture attribute. Now the filter seems to work fine. The only difference I see is that earlier it used to be a slider to select the range, now its asks the user to input max and min values for the range. Why did that change?

    Theme Author HivePress

    (@hivepress)

    Please set this attribute for at least 2 listings, the slider should appear (it requires at least 2 values to detect the slider range).

    Thread Starter fixpaana

    (@fixpaana)

    That worked. Thanks! It was also a silly mistake on my part, I forgot to set the upper and lower limits in the filter. Added more listings and the limits and it worked.

    Speaking of the filters, I have another question. I want to display the price in the following format: 1,00,000 as opposed to the default 100,000 format. How do I do that? Just want the commas to appear after every 2 digits going right to left after the hundredths place.

    Theme Author HivePress

    (@hivepress)

    This depends on the WordPress-level settings, we use this function to format numbers and it follows the settings and locale of WordPress https://developer.www.ads-software.com/reference/functions/number_format_i18n/

    Thread Starter fixpaana

    (@fixpaana)

    Okay, honestly speaking, web development is alien to me. Could you please explain that is more layman terms?

    I had another similar problem where the Year Of Manufacture attribute i mentioned, shows up with commas instead of displaying the year in YYYY format. The attribute is currently set with field type as Number and displays the input 1997 as 1,997. How can I change this too?

    Thread Starter fixpaana

    (@fixpaana)

    One more thing. You had said this a few replies ago:

    Filters may disappear if they are category-specific, please edit these attributes in Listings/Attributes and check if they are assigned to some categories, if so then these filters will not appear for all categories.

    To test this out, I set all categories to the same attributes (now each category has all the attributes I have created). But still when I select “All categories” in the search, the filters disappear. Whats the problem now?

    Theme Author HivePress

    (@hivepress)

    Hi,
    I meant that the number format in HivePress follows the WordPress settings in Settings/General, as far as I know this depends on the locale (language).
    If you want some attributes to appear for All Categories please don’t select any categories for these attributes, select them only if there are specific categories where you want these attributes to appear.

    Thread Starter fixpaana

    (@fixpaana)

    That was an interesting suggestion. I did try it out (set language to Hindi, India) but it didn’t work for the commas in the price I was referring to.

    The commas in the price is not such a big problem the bigger problem is the commas that appear in the YEAR attribute. The year MUST look like 1997 and not 1,997.

    Any fix for that?

    Theme Author HivePress

    (@hivepress)

    Please use the Text number instead (if you don’t want to format the value as a number), with a custom Regex pattern https://hivepress.io/support/topic/remove-comma-from-number-attribute/#post-18415

    Thread Starter fixpaana

    (@fixpaana)

    That worked! But now I am not able to set upper and lower limits for the year in Editing section. How can I also have that?

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Listing filter not working’ is closed to new replies.