fixed adding global $eCart1; inside my function solved the issue
[code]
function i8_findCheapest($subcat,$type) {
global $eCart1;
if (!$eCart1->IsEmpty()) {
$eCart1->MoveFirst();
$price = $eCart1->DisplayInfo("Price");
while (!$eCart1->EOF()) {
if(($eCart1->DisplayInfo("Price") < $price) && (($eCart1->DisplayInfo("SubcatID") == $subcat) && ($eCart1->DisplayInfo("TypeID") == $type))) $price = $eCart1->DisplayInfo("Price");
$eCart1->MoveNext();
}
$eCart1->MoveFirst();
return $price;
}
}
[code]