<div style="text-align: center;">
<script>var amo_forms_params = {"id":615862,"hash":"e6b1e9a283dd798f05bcfe13b66cb6c6","locale":"ru"};</script>
<script id="amoforms_script" async="async" charset="utf-8" src="https://forms.amocrm.ru/forms/assets/js/amoforms.js"></script>
</div>
<div style="text-align: center;">
<script>var amo_forms_params = {"id":00000,"hash":"000000000000000000000000","locale":"ru"};</script>
<button style="box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 0px; display: inline-block; font-family: Tahoma, Arial, sans-serif; padding: 0px 33px; border-radius: 3px; height: 52px; border: none; outline: none; cursor: pointer; text-transform: none; font-weight: 400; margin: 0px 0px 15px; font-size: 15px; color: rgb(255, 255, 255); background-color: rgb(39, 60, 113);" id="amoforms_action_btn">Задать вопрос по продукции</button><script id="amoforms_script" async="async" charset="utf-8" src="https://forms.amocrm.ru/forms/assets/js/amoforms.js"></script>
</div>
<div id="amoforms_overlay" style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; background: rgba(0, 0, 0, 0.7); overflow: auto; opacity: 1; display: block; z-index: 99999;"><iframe id="amoforms_iframe_00000000" class="amoforms_iframe" name="amoforms_iframe_00000000" allowtransparency="" scrolling="no" frameborder="0" style="width: 540px; position: inherit; top: 50%; left: 50%; transform: translateX(-50%); overflow: visible; margin-top: -462.5px; padding: 0px; border: none; height: 875px; opacity: 1;" src="https://forms.amocrm.ru/forms/html/form_00000000.html?date=00000000#{"user_origin":{"datetime":"Wed Jul 22 2020 13:26:46 GMT+0300 (Москва, стандартное время)","referer":""},"is_modal":true,"success_message":"00000000.","is_dark_bg":false,"utm":{"source":"","medium":"","content":"","campaign":"","term":""},"ga":{},"location":"https://site.com/","dp":{}}"></iframe></div>
<div style="text-align: center;">
<script>var amo_forms_params = {"id":615862,"hash":"e6b1e9a283dd798f05bcfe13b66cb6c6","locale":"ru"};</script>
<script id="amoforms_script" async="async" charset="utf-8" src="https://forms.amocrm.ru/forms/assets/js/amoforms.js"></script>
</div>
<tr>
<td>Текст</td>
<td>Текст</td>
<td class="weight">1.35</td>
<td class="price"></td>
</tr>
<table>
<thead>
<tr>
<td> Заголовок </td>
<td> Заголовок </td>
<td> Вес, кг </td>
<td> Цена, руб. с НДС </td>
</tr>
</thead>
<tbody>
<tr>
<td>Текст</td>
<td>Текст</td>
<td>1.35</td>
<td></td>
</tr>
<tr>
<td>Текст</td>
<td>Текст</td>
<td>1.35</td>
<td></td>
</tr>
</tbody>
</table>
$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->addEventHandler('search', 'BeforeIndex', array('MySearch2', 'BeforeIndex'));
class MySearch2 {
private static $catalogIblockId = 34;
private static $docsIblockId = 46;
const PROPERTY_DOCUMENTS = 'PROPERTY_LINK_MAP_ORDER';
public static function BeforeIndex($arFields) {
if(intval($arFields['PARAM2']) == self::$catalogIblockId && intval($arFields['ITEM_ID']) > 0 && isset($arFields['BODY'])) {
\Bitrix\Main\Loader::includeModule('iblock');
$arDocsId = array();
$dbRes = CIBlockElement::GetList(array(), array('IBLOCK_ID' => $arFields['PARAM2'], 'ID' => $arFields['ITEM_ID']), false, false, array(self::PROPERTY_DOCUMENTS));
while($arRes = $dbRes->Fetch()) {
if($arRes[self::PROPERTY_DOCUMENTS.'_VALUE']) {
$arDocsId[] = $arRes[self::PROPERTY_DOCUMENTS.'_VALUE'];
}
}
if($arDocsId) {
$dbRes = CIBlockElement::GetList(array(), array('IBLOCK_ID' => self::$docsIblockId, 'ID' => $arDocsId), false, false, array('NAME'));
while($arRes = $dbRes->Fetch()) {
$arFields['BODY'] .= PHP_EOL.$arRes['NAME'];
}
}
return $arFields;
}
}
}