Little Filter Question

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #42300
    Ivo
    Ivo
    Participant

    Hello,
    I have a question about the filters
    First of all, thank you for this fantastic addon!
    I have created a search and use in it a filter with a dropdown menu with ZIP codes.
    Is there a way to read the ZIP code (text) clicked by the user via javascript ? I would like to use this value in the search bar before the settings icon. The CSS is not the problem. Unfortunately I didn’t find anything in the javascript documentation that works.

    Basically I would like to build the searchbar from https://pixabay.com/.

    Thanks a lot and best regards, Ivo

    Attachments:
    You must be logged in to view attached files.
    #42307
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Do you have any specific setup I can take a look? This might be possible somehow via a script, by fetching the value from the filter and probably adding an element hovering or something like that. However I will have to take a look at the setup to be able to suggest from there.

    Best,
    Ernest Marcinko

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


    #42310
    Ivo
    Ivo
    Participant
    You cannot access this content.
    #42325
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you Ivo.

    I may have found a possible solution, I changed the custom CSS a bit so that the “::after” tag has a content fetched from a data attribute. Then I added this custom script:

    jQuery(function ($) {
        $('.asp_m .prosettings .innericon').attr('data-text', 'Alle');
        $('.asp_m .prosettings').one('click', function () {
            setTimeout(function () {
                $('.asp_select_label select').on('change.asp_select2', function () {
                    let id = $(this).closest('.asp_w').data('id'),
                        inst = $(this).closest('.asp_w').data('instance'),
                        val = $(this).val() == '__any__' ? 'Alle' : $(this).val();
                    $('.asp_m_' + id + '_' + inst + ' .prosettings .innericon').attr('data-text', val);
                });
            }, 500);
        });
    });

    It should hopefully work. I can’t guarantee anything for 100% since this is a customization, but it should be okay for most cases.

    Best,
    Ernest Marcinko

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


    #42333
    Ivo
    Ivo
    Participant

    Hi Ernest,
    absolute GREAT – thx for this support – works as I wished 😉
    Thx & Best,
    Ivo

    #42334
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.