Eigenschaftenfilter Sortierung

Hallo, mir ist aufgefallen, dass die Filter im Listing eine falsche Reihenfolge haben. Leider finde ich hier keine erkennbare Struktur. Wenn ich wiederum die Filter in der Intelligenten Suche habe, werde diese korrekt angezeigt, so wie im Backend definiert. Woran liegt das? Hat mir jmd ein Tipp? Ziel ist es, in dem Listing die Filter auch in der korrekten Reihenfolge angezeigt zu bekommen. Danke

So sieht z.B. das SQL der Filter aus: SELECT fv.optionID AS id, COUNT(\*) AS countOptionValues, fo.name AS optionName, f.name AS groupName, fv.value AS optionValue, fv.id AS uniqueID, st.objectdata AS optionNameTranslation, st2.objectdata AS groupNameTranslation, st3.objectdata AS articleTranslation FROM s\_articles\_categories ac, s\_filter\_values fv LEFT JOIN s\_core\_translations AS st ON st.objecttype='propertyoption' AND st.objectkey=fv.optionID AND st.objectlanguage='de' LEFT JOIN s\_core\_translations AS st2 ON st2.objecttype='propertygroup' AND st2.objectkey=fv.groupID AND st2.objectlanguage='de' LEFT JOIN s\_core\_translations AS st3 ON st3.objecttype='properties' AND st3.objectkey=fv.articleID AND st3.objectlanguage='de' JOIN s\_filter\_options fo, s\_filter f, s\_articles a WHERE ac.categoryID=15 AND a.id = ac.articleID AND a.id = fv.articleID AND a.filtergroupID = f.id AND a.active =1 AND a.changetime \<= NOW() AND fv.optionID = fo.id AND fo.filterable = 1 AND fv.groupID = f.id GROUP BY fv.optionID, fv.value ORDER BY fo.name ASC, IF(f.sortmode=1, TRIM(REPLACE(fv.value,',','.'))+0, 0), IF(f.sortmode=2, COUNT(\*) , 0) DESC, fv.value Interessant ist hier ja nur die letzte Zeile, ORDER BY fo.name ASC, IF(f.sortmode=1, TRIM(REPLACE(fv.value,’,’,’.’))+0, 0), IF(f.sortmode=2, COUNT(*) , 0) DESC, fv.value Jetzt bringt einem die Sortierung relativ wenig, da die Position in einer anderen Tabelle steht, welche nicht verknüpft ist: s_filter_relations Hat mit jemand einen Tipp, wie ich dies mit einbringen kann?

Niemand eine Idee? Shopware?

Hallo ottscho, hast Du inzwischen eine Lösung dafür gefunden? Ich will ungern in den core-Dateien die SQL-Anweisungen verändern… Danke

Hi, die angepasste SQL-Abfrage in der engine/core/class/sArticles.php könnte z.B. so aussehen: $sql = " SELECT fv.optionID AS id, COUNT(\*) AS countOptionValues, fo.name AS optionName, f.name AS groupName, fv.value AS optionValue, fv.id AS uniqueID, st.objectdata AS optionNameTranslation, st2.objectdata AS groupNameTranslation, st3.objectdata AS articleTranslation FROM s\_articles\_categories ac, s\_filter\_values fv LEFT JOIN s\_core\_translations AS st ON st.objecttype='propertyoption' AND st.objectkey=fv.optionID AND st.objectlanguage='$language' LEFT JOIN s\_core\_translations AS st2 ON st2.objecttype='propertygroup' AND st2.objectkey=fv.groupID AND st2.objectlanguage='$language' LEFT JOIN s\_core\_translations AS st3 ON st3.objecttype='properties' AND st3.objectkey=fv.articleID AND st3.objectlanguage='$language' JOIN s\_filter\_options fo, s\_filter\_relations fr, s\_filter f, s\_articles a $addFilterSQL WHERE ac.categoryID=$categoryID AND a.id = ac.articleID AND a.id = fv.articleID AND a.filtergroupID = f.id AND a.active =1 AND a.changetime \<= NOW() AND fv.optionID = fo.id AND fo.filterable = 1 AND fv.groupID = f.id AND fr.optionID=fo.id $addFilterWhere GROUP BY fv.optionID, fv.value ORDER BY fr.position ASC, IF(f.sortmode=1, TRIM(REPLACE(fv.value,',','.'))+0, 0), IF(f.sortmode=2, COUNT(\*) , 0) DESC, fv.value "; Hinzugefügt wurden folgende Teile: --> s_filter_relations fr, (beim JOIN s_filter_options fo) --> AND fr.optionID=fo.id (im WHERE) --> fr.position ASC (in der ORDER BY am Ende)