in hPremium.php :
define the function like this :
function osc_get_premiums($max = 2, $shuffle = false) {
if (View::newInstance()->_exists('search')) {
$mSearch = View::newInstance()->_get('search');
} else {
$mSearch = Search::newInstance();
View::newInstance()->_exportVariableToView('search', $mSearch);
}
// juanramon: it should be fixed, little hack to get alerts work in search layout
$mSearch->reconnect();
$premiums = $mSearch->getPremiums($max);
if($shuffle){
shuffle($premiums);
}
View::newInstance()->_exportVariableToView('premiums', $premiums);
return $premiums;
}
in main.php
you need this :
<?php osc_get_premiums($max=20,true); ?>
I hope this will help you guys.
CHECK RESULT HERE :
http://pa.strategies.chRegards
A+lessandro