/** * Параметры: * Item — экземпляр nc_netshop_item * ИЛИ * Component_ID — ID компонента товара * Item_id — ID товара * * Дополнительно * CompareURL — адрес страницы сравнения (без SUB_FOLDER), по умолчанию /compare/ * AddOrderURL — адрес страницы добавления товара (без SUB_FOLDER), по умолчанию /orders/add_order.html * ListName — название списка (для атрибута data-analytics-item) * ListPosition — порядковый номер в списке (для атрибута data-analytics-item) */ /** @var nc_netshop_item $f_Item */ /** @var int $f_Component_ID */ /** @var int $f_Item_ID */ $item = null; if ($f_Item instanceof nc_netshop_item) { $item = $f_Item; } else if ($f_Component_ID && $f_Item_ID) { try { $item = nc_netshop_item::by_id($f_Component_ID, $f_Item_ID); if (!$item['Sub_Class_ID']) { $item = null; } // seems that the item data is missing } catch (Exception $e) {} } $item_parent_id = $item['Parent_Message_ID'] ?: $item['Message_ID']; $item_list_key = $item['Class_ID'] . ':' . $item_parent_id; $template_partial_loading = nc_array_value($GLOBALS['template_settings'], 'enable_partial_loading'); $analytics = ''; if ($item instanceof nc_netshop_item && nc_module_check_by_keyword('stats')) { if (!empty($f_ListName) && $nc_core->input->fetch_get_post('f_ListName') === null) { $f_ListPosition = isset($f_ListPosition) ? (int)$f_ListPosition : null; } else { $f_ListName = null; $f_ListPosition = null; } $analytics = nc_stats_analytics::get_item_attribute($item, $f_ListName, $f_ListPosition); } ?> if ($item): ?> $fullLink = nc_object_path($item['Class_ID'], $item['Message_ID']); $nc_core = nc_core::get_object(); $netshop = nc_netshop::get_instance($item['Catalogue_ID']); $add_order_url = $nc_core->SUB_FOLDER . (isset($f_AddOrderURL) ? $f_AddOrderURL : "/orders/add_order.html"); $compare_url = $nc_core->SUB_FOLDER . (isset($f_AddOrderURL) ? $f_AddOrderURL : "/compare/"); ?>