title: Why does only the first filter for "show more" work?
body: <p>On the webshop for my internship I'm trying to resolve a filter problem.
  On each page, only the first filter works when you press &quot;show more&quot;. On all other filters nothing happens once you press &quot;show more&quot;.</p>
  <p>This is the code responsible:</p>
  <pre class="lang-js prettyprint-override"><code>function _toConsumableArray(e) {
      if (Array.isArray(e)) {
          for (var o = 0, s = Array(e.length); o &lt; e.length; o++) s[o] = e[o];
          return s;
      }
      return Array.from(e);
  }
  function showLessMore(e) {
      var o = e.target;
      if (qty.hasClass(&quot;js-hook__amshopby-more&quot;)) {
          e.preventDefault();
          var s = o.parentNode.parentNode,
              a = s.querySelectorAll(&quot;.js-hook__amshopby-item&quot;);
          if (a.length) {
              for (var r = [].concat(_toConsumableArray(a)), t = 0; t &lt; r.length; t++) {
                  var l = r[t];
                  &quot;none&quot; == l.style.display &amp;&amp; (l.classList.add(&quot;filter--visible&quot;), (l.style.display = &quot;block&quot;));
              }
              (o.style.display = &quot;none !important&quot;), (s.querySelector(&quot;.js-hook__amshopby-less&quot;).style.display = &quot;block !important&quot;);
          }
      }
      if (qty.hasClass(o, &quot;js-hook__amshopby-less&quot;)) {
          e.preventDefault();
          var n = o.parentNode.parentNode,
              y = n.parentNode.parentNode.querySelectorAll(&quot;.js-hook__amshopby-item.filter--visible&quot;);
          if (y.length) {
              for (var i = [].concat(_toConsumableArray(y)), p = 0; p &lt; i.length; p++) {
                  var c = i[p];
                  c.classList.remove(&quot;filter--visible&quot;), (c.style.display = &quot;none&quot;);
              }
              (o.style.display = &quot;none !important&quot;), (n.querySelector(&quot;.js-hook__amshopby-more&quot;).style.display = &quot;block !important&quot;);
          }
      }
  }
  </code></pre>
  <p>Any help would be greatly appreciated!</p>