OS Property support center

Extra field groups as amenities

  • Davor
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 9 months ago #54035 by Davor
Extra field groups as amenities was created by Davor
Hello I would like to create an extra field group that would be identical to the amenities. So that I add a feature and have a checkmark there. How can I do this?
Thank you,.

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #54058 by Dang Thuc Dam
Replied by Dang Thuc Dam on topic Extra field groups as amenities
Hi Davor,
Even you use the extra field groups and extra fields, you still don't have feature to add icons beside the value as you want.
I think the solution for you is
1. Modify the db table #__osrs_amenities and add column "icons", and then, you can add the class icon name into that field. Because number of amenities are limited, so you can add the value through PHPMyAdmin easily.
2. Modify the property details layout. And add the <icon> tags beside the amenities.
file is in
components > com_osproperty > classes > listing.php
find this code

$query = "Select a.* from #__osrs_amenities as a"
." inner join #__osrs_property_amenities as b on b.amen_id = a.id"
." where a.published = '1' and b.pro_id = '$property->id' order by a.ordering";
$db->setQuery($query);
$amens = $db->loadObjectList();
$amens_str1 = "";
if(count($amens) > 0){

$amens_str = "";
$j = 0;
$k = 0;
for($i=0;$i<count($amens);$i++){
$j++;
$amen = $amens[$i];
$amens_str .= OSPHelper::getLanguageFieldValue($amen,'amenities').", ";
}
$amens_str = substr($amens_str,0,strlen($amens_str)-2);
$k = 0;
for($i=0;$i<count($amens);$i++){
$k++;
$amen = $amens[$i];
$amens_str1 .= "<div class='span4' style='margin-left:0px;'><i class='osicon-ok'></i> ".OSPHelper::getLanguageFieldValue($amen,'amenities')."</div>";
if($k == 3){
$k = 0;
$amens_str1.= "<div class='clearfix'></div>";
}
}

}else{
$amens_str = JText::_('OS_NO_AMENITIES');
$amens_str1 = JText::_('OS_NO_AMENITIES');
}


You can find <i class='osicon-ok'> and replace by the code to show the icons of amenities

Thanks
Dam

Please Log in or Create an account to join the conversation.

Moderators: Dang Thuc DamNguyen Phu Quan