Answer the question
In order to leave comments, you need to log in
Bitrix - how to search by product property?
I'm doing a custom search in the catalog. Using the CIBlockElement class, you can get properties by product ID, but I want to do a search by name. How can this be done?
Well, at the same time, the question is, where in this function is the infoblock from which it will pull data is set?
$ID = 56767;
if(CModule::IncludeModule("iblock")):
$prop=CIBlockElement::GetByID($ID)->GetNextElement()->GetProperties();
endif;
Answer the question
In order to leave comments, you need to log in
if by name, then something like this
$name = 'название';
$arSelect = Array("*");
$arFilter = Array("IBLOCK_ID"=>IntVal($yvalue), "NAME"=>$name);
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array(), $arSelect);
while($ob = $res->GetNextElement()){
$arFields = $ob->GetFields();
print_r($arFields);
$arProps = $ob->GetProperties();
print_r($arProps);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question