Hello.
Could someone help me to get result from these condition. The field Categories in Object Relation type.
First I try to get product with category param and than check products with subcategory. I see that setCondition works fine, I’ve got the products, but AddcontionParam doesn’t return any result.
$list = new Product\Listing();
$category = ShopCategory::getIdFromKey($params['category']);
$list->setCondition("categories like '%,".$category->getId().",%'");
$children_category_array = array();
foreach ($category->getChildren() as $children) {
$list->addConditionParam("categories like '%,?,%'", [$children->getId()], "OR");
}
}
$list->load();