For someone who still needs this
Solved the same question with a dirty hack in components/com_finder/models/search.php:
/**
* Add prices to search results - mSnus
* Joomla 3.9.25
* components/com_finder/models/search.php
* around line 118
*/
// Load the results from the database.
$db->setQuery($query);
$rows = $db->loadObjectList('link_id');
// Set up our results container.
$results = $items;
$arrHikaIds = [];
// Convert the rows to result objects.
foreach ($rows as $rk => $row)
{
// Build the result object.
$result = unserialize($row->object);
$result->weight = $results[$rk];
$result->link_id = $rk;
$arrHikaIds[] = $result->__get('id');
// Add the result back to the stack.
$results[$rk] = $result;
}
$query2 = $db->getQuery(true)
->select($db->quoteName('product_id') . ', ' . $db->quoteName('product_sort_price'))
->from($db->quoteName('#__hikashop_product'))
->where($db->quoteName('product_id') . ' IN (' . implode(',', $arrHikaIds) . ')');
$db->setQuery($query2);
$rows2 = $db->loadAssocList();
$idToPrice = [];
foreach ($rows2 as $rk => $row) {
$idToPrice[$row['product_id']] = $row['product_sort_price'];
}
foreach ($results as $rk => &$result) {
$oid = $results[$rk]->__get('id');
$results[$rk]->__set('price', $idToPrice[$oid]);
}
/**
* -- end adding price to search results
*/
After this modification you will be able to use
$this->result->price
in your
templates/<...your template name...>/html/com_finder/search/default_result.php , for example:
<h5>USD <?php echo(intval($this->result->price)); ?> </h5>
Maybe someone could improve the answer with moving my function to some SmartSearch plugin, but my way will do.