put this in functions.php of your theme
function cars_search_detail($item, $cat = null) {
if ($cat != null && osc_is_this_category('cars_plugin', $cat) ) {
$detail = ModelCars::newInstance()->getCarAttr($item) ;
if (count($detail) == 0) { return ; }
$make = ModelCars::newInstance()->getCarMakeById($detail['fk_i_make_id']);
$model = ModelCars::newInstance()->getCarModelById($detail['fk_i_model_id']);
$car_type = ModelCars::newInstance()->getVehicleTypeById($detail['fk_vehicle_type_id']);
$detail['s_make'] = '' ;
if (array_key_exists('s_name', $make)) {
$detail['s_make'] = $make['s_name'];
}
$detail['s_model'] = '' ;
if (array_key_exists('s_name', $model)) {
$detail['s_model'] = $model['s_name'];
}
$detail['locale'] = array() ;
foreach($car_type as $c) {
$detail['locale'][$c['fk_c_locale_code']]['s_car_type'] = $c['s_name'] ;
}
return $detail;
}
}
for example you want to show the details in search results...
put this inside of the loop to load the details
$detail = cars_search_detail($osc_item_id(), osc_item_category_id());
then you can use all details in your preview ad like this
<?php if (!empty($carsDetail['s_make'])) { ?>
<div class="attribute">
<div><?php _e('Make', 'cars_attributes'); ?></div>
<div><?php echo @$carsDetail['s_make']; ?></div>
</div>
<?php } ?>