BUG Easystore: Cannot Deselect Item When Using Filter Add-on - Question | JoomShaper

is live, now with multi-currency selling.

BUG Easystore: Cannot Deselect Item When Using Filter Add-on

Stephane Hanrez

Stephane Hanrez

EasyStore 3 weeks ago

There is a but in current version of Easystore that prevents from deselecting a filter in the filter add-on.

The bug is located in /media/com_easystore/js/products.site.js

The issue is that the current logic is getting all instances of the same filter. As far as in my SPPageBuilder page, the same filter is present twice on the same page (Once for my normal website, one for my mobile website), it gets all checked cases. This means even if I uncheck on the dektop page, it still gets the checked value from the hidden mobile page:

const elementsOfSameFilter = document.querySelectorAll(
    `[data-easystore-filter-by="${filterBy}"]`
);

This can be seen on console. e.g. after unchecking "Gants" and typing the following in console:

elementsOfSameFilter.forEach((element) => {
    const matched = element.querySelectorAll(
        'input[type="checkbox"]:checked, input[type="radio"]:checked'
    );

    if (matched.length) {
        checkedItems.push(...matched);
    }
});

I get:

[
  { filter: 0, visible: true,  checked: ["gants"] },
  { filter: 1, visible: false, checked: ["gants"] }
]

which proves I have 2 filters, one true, one false.

Could you please solve this as this is very annoying (even if I currenly managed to work around it with a custom JSS in my template).

Thanks a lot

PS: Btw, I cannot chose my domain in your select box on this forum. I have 2 different subscription, one "All-Access Personal" with 1 site (the one I have EasyStore on) and one "Business" with my other sites that don't need Easystore. Looks like only the sites I created under Business appear in your dropdown.

0
1 Answers
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 3 weeks ago #232782

Hi Stephane,

Thanks for the detailed report and analysis.

We've been able to confirm the issue and have passed it on to our development team for further review.

In the meantime, you can keep the template-level JS workaround in place. Since products.site.js is located in the media/ directory, it may be overwritten when the component is updated.

Regarding the dropdown domain, it is being retrieved from the domain you added to your JoomShaper Dashboard.

Thanks again for your patience and for helping us identify the issue.

Best regards,

0