I tried to create a flexible search for depending on a specific category.
What I am trying to do, attract products of supercategory code '3741' but products must only belong to this category and no subcategories or supercategories.
There is my flexible query :
select {prod.pk}, {prod.code}, {cat.code},{cat.name} from
{Product as prod
join CategoryProductRelation as level3 on {level3.target} = {prod.pk}
join CategoryCategoryRelation as level2 on {level2.target} = {level3.source}
join CategoryCategoryRelation as level1 on {level1.target} = {level2.source}
join Category as cat on {cat.pk} = {level1.source}
}
where {cat.pk} = '8796117467278'
This query brings to all products, if product has my category.
Already thanks for your answers.