} $rsMasterProperty = CIBlockElement::GetProperty($arItem["IBLOCK_ID"], $arItem["ID"], array(), array("ID" => $arResult["OFFERS_PROPERTY_ID"], "EMPTY" => "N")); if ($arMasterProperty = $rsMasterProperty->Fetch()) { $rsMaster = CIBlockElement::GetList(array(), array("ID" => $arMasterProperty["VALUE"], "IBLOCK_ID" => $arMasterProperty["LINK_IBLOCK_ID"], "ACTIVE" => "Y"), false, false, $arSelect); $rsMaster->SetUrlTemplates($arParams["DETAIL_URL"]); $obElement = $rsMaster->GetNextElement(); if (!is_object($obElement)) { continue; } } else { continue; } $arOffer = $arItem; $arItem = $obElement->GetFields(); } $ipropValues = new ElementValues($arItem["IBLOCK_ID"], $arItem["ID"]); $arItem["IPROPERTY_VALUES"] = $ipropValues->getValues(); $arItem["PREVIEW_PICTURE"] = 0 < $arItem["PREVIEW_PICTURE"] ? CFile::GetFileArray($arItem["PREVIEW_PICTURE"]) : false; if ($arItem["PREVIEW_PICTURE"]) { $arItem["PREVIEW_PICTURE"]["ALT"] = $arItem["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_ALT"]; if ($arItem["PREVIEW_PICTURE"]["ALT"] == "") { $arItem["PREVIEW_PICTURE"]["ALT"] = $arItem["NAME"]; } $arItem["PREVIEW_PICTURE"]["TITLE"] = $arItem["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_TITLE"]; if ($arItem["PREVIEW_PICTURE"]["TITLE"] == "") { $arItem["PREVIEW_PICTURE"]["TITLE"] = $arItem["NAME"]; } } $arItem["DETAIL_PICTURE"] = 0 < $arItem["DETAIL_PICTURE"] ? CFile::GetFileArray($arItem["DETAIL_PICTURE"]) : false; if ($arItem["DETAIL_PICTURE"]) { $arItem["DETAIL_PICTURE"]["ALT"] = $arItem["IPROPERTY_VALUES"]["ELEMENT_DETAIL_PICTURE_FILE_ALT"];
protected function readInheritedProps() { if ($this->arParams['SET_SEO_TAGS'] !== 'Y' || !$this->arParams['IBLOCK_ID']) { if ($this->arParams['OG_TAGS_TITLE'] !== 'SEO_TITLE' && $this->arParams['OG_TAGS_DESCRIPTION'] !== 'SEO_DESCRIPTION') { return false; } } if ($this->arParams['ELEMENT_ID']) { $rsSeoValues = new InheritedProperty\ElementValues($this->arParams['IBLOCK_ID'], $this->arParams['ELEMENT_ID']); $seoValues = $rsSeoValues->getValues(); if (!$this->arResult['SEO_TAGS']['TITLE']) { $this->arResult['SEO_TAGS']['TITLE'] = $seoValues['ELEMENT_META_TITLE']; } if (!$this->arResult['SEO_TAGS']['DESCRIPTION']) { $this->arResult['SEO_TAGS']['DESCRIPTION'] = $seoValues['ELEMENT_META_DESCRIPTION']; } if (!$this->arResult['SEO_TAGS']['KEYWORDS']) { $this->arResult['SEO_TAGS']['KEYWORDS'] = $seoValues['ELEMENT_META_KEYWORDS']; } } elseif ($this->arParams['SECTION_ID']) { $rsSeoValues = new InheritedProperty\SectionValues($this->arParams['IBLOCK_ID'], $this->arParams['SECTION_ID']); $seoValues = $rsSeoValues->getValues(); if (!$this->arResult['SEO_TAGS']['TITLE']) { $this->arResult['SEO_TAGS']['TITLE'] = $seoValues['SECTION_META_TITLE']; } if (!$this->arResult['SEO_TAGS']['DESCRIPTION']) { $this->arResult['SEO_TAGS']['DESCRIPTION'] = $seoValues['SECTION_META_DESCRIPTION']; } if (!$this->arResult['SEO_TAGS']['KEYWORDS']) { $this->arResult['SEO_TAGS']['KEYWORDS'] = $seoValues['SECTION_META_KEYWORDS']; } } if (!empty($this->arResult['SEO_TAGS']) && is_array($this->arResult['SEO_TAGS'])) { foreach ($this->arResult['SEO_TAGS'] as &$field) { $field = strip_tags($field); } unset($field); } if (!empty($this->arResult['SEO_TAGS'])) { $this->setResultCacheKeys(['SEO_TAGS']); } }