\Bitrix\Main\Loader::includeModule("iblock");
\Bitrix\Main\Loader::includeModule("catalog");
\Bitrix\Main\Loader::includeModule("sale");
$ordersIds = array_column(\Bitrix\Sale\Internals\BasketTable::getList([
"select" => [
"ORDER_ID"
],
"filter" => [
"!ORDER_ID" => false,
"PRODUCT.IBLOCK.IBLOCK_ID" => $IBLOCK_ID//Тут надо задать ID вашего каталога
],
"group" => [
"ORDER_ID"
]
])->fetchAll(), "ORDER_ID");