How to add 2 new fields country and states

Hi,

We recommend using this hook hivepress/v1/models/listing/attributes to add fields (see examples here). You can also add filterable => true, which will add the field to the filter form on the right side of the sidebar.

I hope it helps

2 Likes

Dropdown Selector
I created some “cosmetics” to be more universal.
I continued with this selector to see how many lines
it reads in a reasonable time or if it is
an option if we have an attribute with thousands of options.
I wonder which is more efficient, faster, or can be a real solution.

Hi,

Unfortunately this requires debugging third-party code and further customizations, which is beyond our support scope. If you’re familiar with coding, please try using the “source” parameter for the drop-down field, pointed to a REST API endpoint that returns the results based on search (otherwise the drop-down with 10,000+ rows loaded at once would affect performance).

To make the attribute filterable, please check the hivepress/v1/models/listing/attributes hook, it allows adding any listing fields available in edit, search and display context (there are many examples on the forum and some in our code snippet collection on Gist). Another possible workaround is creating these drop-down attributes manually in Listings/Attributes (marking them Filterable and changing other settings) and then populating them (or changing the field parameters) via the mentioned filter hook.

Hope this helps

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.