Developer forum

Forum » Development » Assortment navigation includes inactive products

Assortment navigation includes inactive products

Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

Can you please add to only look at active products when calculating the group hierarchy?

This is the query today:

                 WITH Hierarchy AS
                (
                    SELECT DISTINCT GroupProductRelationGroupId AS GroupID
                    FROM EcomGroupProductRelation INNER JOIN
                    (
                        SELECT ProductId
                        FROM EcomProducts INNER JOIN
                        (
                            SELECT AssortmentItemProductID, AssortmentItemLanguageID
                            FROM EcomAssortmentItems INNER JOIN EcomAssortments ON AssortmentItemAssortmentID = AssortmentID AND AssortmentItemLanguageID = AssortmentLanguageID
                            WHERE AssortmentActive = 1 AND AssortmentID = {0} AND AssortmentLanguageID = {1}
                        ) t1 ON ProductId = AssortmentItemProductID AND ProductLanguageId = AssortmentItemLanguageID
                    ) t2 ON GroupProductRelationProductId = ProductID
                    UNION ALL
                    SELECT GroupRelationsParentID
                    FROM EcomGroupRelations
                    INNER JOIN Hierarchy ON GroupRelationsGroupID = GroupID
                )

                SELECT * FROM Hierarchy

 

Best regards,

Anders


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
This post has been marked as an answer

Hi Anders,

I've created a bug report (#1007) to get this fixed.

- Jeppe

Votes for this answer: 1

 

You must be logged in to post in the forum