• Resolved ullemanden95

    (@ullemanden95)


    Hello!

    im currently trying to achive some functionallity through the js editor. i find the behavior of the wpfSelectedParameters abit odd, as when i delete 1 of them, all of them will get removed.. i tried to implement some custom code, but i need the filter to update the products shown aswell.

    // Code to handle removal of wpfSelectedParameters individually //
    
    $(document).ready(function() {
        const container = document.querySelector('.wpfSelectedParameters');
        if (container) {
            container.addEventListener('click', function(event) {
                if (event.target.classList.contains('wpfSelectedDelete')) {
                    if (canRemoveParameter()) {
                        event.target.closest('.wpfSelectedParameter').remove();
                    }
                }
            });
        }
    
        function canRemoveParameter() {
            return true;  // Always allow removal
        }
    });
    
    
    // Need a way to update the filter upon removal of wpfSelectedParameters //

    (note)
    is there a solution to this within the plugin, or is it something i have to figure out myself?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Nick McReynolds

    (@woobewoo)

    Hello @ullemanden95,

    It’s not clear what “when i delete 1 of them, all of them will get removed” means.

    We can delete all selected parameters one by one.

    Perhaps this is some kind of bug. Otherwise, it’s not clear what you want to do with a custom script.

    Thread Starter ullemanden95

    (@ullemanden95)

    what i mean is..

    i activated (inside the plugin) that when i select a parameter for my filter, the wpfSelectedParameters will spawn in, so costumers can see what parameters they searched for.

    when i have choosen some parameters, and want to get rid of only 1 of them, to then show the results of the other parameters (and NOT the removed one). i clicked the “x” on the one i wanted to remove, but all the parameters got removed.

    this is what im trying to bypass with the code i made. i wont borther you more than necessary, so i kind of just need to know what code update the filter. ill just make the filter update as i remove a parameter.

    • This reply was modified 1 year, 2 months ago by ullemanden95.
    • This reply was modified 1 year, 2 months ago by ullemanden95.
    Plugin Author Nick McReynolds

    (@woobewoo)

    Hi,

    The parameters of the selected filters must be deleted one at a time. And I was not able to reproduce a situation in which the behavior you described would be repeated.

    Most likely this is some kind of conflict with the theme or another plugin.

    Please contact our internal support team – https://woobewoo.com/contact-us/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wpfSelectedParameters’ is closed to new replies.