Page 1 of 1

Multiple Specifications as Filters

Posted: 12 May 2025, 11:00
by itn-ms
Hey all,

I have multiple Specification Groups which are used for filtering. However I have some problems with this at the moment:
When I set the Filter Method for Specifications to "All", the SQL query doesn't seem to get built correctly. Only the last filter in the URL is used the rest ignored.
In my case I have activated the filters "glass and metal" for Specification Group material and "gold" for Specification Group color. However in the query the second material isn't shown at all - while the first is inside the INNER JOIN instead of the WHERE clause. The only specification in the WHERE is "gold" which is also the only thing that gets filtered.
So for example my filter-URL looks like this: exampleshop.com/index.php/phoca/items?s[material]=metall,glas&s[farbe]=gold
And the resulting SQL looks like this:

Code: Select all

 ...) 
  AND a.id IN (
    SELECT 
      s2x0.product_id 
    FROM 
      hhp59_phocacart_specifications AS s2x0 
      INNER JOIN hhp59_phocacart_specifications AS s2x1 ON s2x1.product_id = s2x1.product_id 
      AND s2x1.alias = 'material' 
      AND s2x1.alias_value = "glas" 
    WHERE 
      s2x0.alias = 'farbe' 
      AND s2x0.alias_value = "gold"
  ) 
GROUP BY 
...
Also I would need the following filtering behaviour: It should be like ANY inside each Specification Group, and like AND between each Group. So if I filter for material glass and metal and color gold, I want everything which is made out of metal OR glass AND has the color gold. Is that possible at the moment with multiple Specification Groups and if so what do I need to config?

Thanks in advance for your input!

Marco