self::collect($priceCode)); } private static function collect(string $priceCode): string { if (!Loader::includeModule("catalog") || !Loader::includeModule("currency")) { return ""; } $groupId = PricePresets::groupId($priceCode); if ($groupId === 0) { return ""; } $row = PriceTable::getList([ "select" => ["MIN_PRICE", "MAX_PRICE"], "filter" => ["=CATALOG_GROUP_ID" => $groupId, ">PRICE" => 0], "runtime" => [ new ExpressionField("MIN_PRICE", "MIN(%s)", "PRICE"), new ExpressionField("MAX_PRICE", "MAX(%s)", "PRICE"), ], ])->fetch(); if (!$row || $row["MIN_PRICE"] <= 0) { return ""; } return (int)round((float)$row["MIN_PRICE"]) . "-" . (int)round((float)$row["MAX_PRICE"]) . " " . CurrencyManager::getBaseCurrency(); } }