So I found the solution. Not too complicated but it is a lot of files that need to be edited.
hopefully it will help someone out.
OSClass version 3.7.4.
I suggest backing up your files and database before you get started, in case something goes wrong.
All the files I edited are in oc-content/plugins/realestate_attributes.
I also updated the database using PHPMyAdmin.
-----------------------------------------------------
Other Characteristics (the ones with ticks)
I will use the attribute 'Pool' as an example.
in
index.php:
Around line 79 add
case 'pool':
Search::newInstance()->addConditions(sprintf("%st_item_house_attr.b_pool = %d ", DB_TABLE_PREFIX, $value));
$has_conditions = true;
break;
Around line 216 add
$pool = Params::getParam('pool')!='' ? 1 : 0;
Around line 240 add
'pool' => $pool,
Around line 375 add
$pool = (Params::getParam('pool')!='') ? 1 : 0;
Around line 400 add
Session::newInstance()->_setForm('pre_pool' , $pool );
Around line 440 add
Session::newInstance()->_keepForm('pre_pool');
In
struct.sql:
Around line 17 add
b_pool BOOLEAN,
In
ModelRealEstate.php:
Around line 139 add
'b_pool' => $array['pool'],
Around line 177 add
'b_pool' => $array['pool'],
In
item_edit.php:
Around line 240 add
<?php
if( Session::newInstance()->_getForm('pre_pool') != '' ) {
$detail['b_pool'] = Session::newInstance()->_getForm('pre_pool');
}
?>
<li>
<input style="width: 20px;" type="checkbox" name="pool" id="pool" value="1" <?php if(@$detail['b_pool'] == 1) { echo 'checked="yes"'; } ?>/> <label style="float:none;" for="pool"><?php _e('Pool', 'realestate_attributes'); ?></label>
</li>
In
helper.php:
Around line 159 add
if(@$detail['b_pool']) {
$return['other_attributes']['b_pool'] = array(
'label' =>__('Pool', 'realestate_attributes')
,'value' => true
);
}
in
search_form.php (If you want the attribute to be searchable):
Around line 208 add
<li>
<input <?php if(Params::getParam('pool') == 1 ) { echo 'checked="yes"'; } ?> style="width:20px;" type="checkbox" name="pool" id="pool" value="1" /> <label for="pool"><strong><?php _e('Pool', 'realestate_attributes'); ?></strong></label>
</li>
Using PHPMyAdmin (or database management tool of your choice) add the following column to
osc_t_item_house_attrName: b_pool
Type: TINYINT:
Default: NULL
Here's a video to help you with this
https://www.youtube.com/watch?v=jZ72GCGWPQgDetails (The attributes that display data like garages, rooms, Floor size etc)
I will use the attribute 'Levies' as an example.
It displays a price so it's declared as an integer. you will decide whether or not you use a string, Boolean or whatever based on your requirements (I used 'sqm' attribute as a reference)
in
index.php:
Around lin 53 add
case 'levies':
if (preg_match('|([0-9]+) - ([0-9]+)|', $value, $match)) {
Search::newInstance()->addConditions(sprintf("%st_item_house_attr.i_levies >= %d AND %st_item_house_attr.i_levies <= %d", DB_TABLE_PREFIX, $match[1], DB_TABLE_PREFIX, $match[2]));
$has_conditions = true;
}
Around line 235 add
'levies' => Params::getParam('levies'),
Around line 397 add
Session::newInstance()->_setForm('pre_levies' , Params::getParam('levies') );
Around line 437 add
Session::newInstance()->_keepForm('pre_levies');
In
struct.sql:
Around line 31 add
i_levies INT(6) UNSIGNED,
In
ModelRealEstate.php:
Around line 132 add
'i_levies' => $array['i_levies'],
Around line 170 add
'i_levies' => $array['levies'],
In
item_edit.php:
Around line 107 add
<div class="row">
<?php
if( Session::newInstance()->_getForm('pre_levies') != '' ) {
$detail['i_levies'] = Session::newInstance()->_getForm('pre_levies');
}
?>
<label for="levies"><?php _e('Levies', 'realestate_attributes'); ?></label>
<input type="text" name="levies" id="levies" value="<?php echo @$detail['i_levies']; ?>" size="4" maxlength="6" />
</div>
In
helper.php:
Around line 76 add
if(@$detail['i_levies'] != "") {
$return['attributes']['levies'] = array(
'label' =>__('Levies ', 'realestate_attributes')
,'value' => @$detail['i_levies']
);
}
In
view.php:
Around line 81 add
<li><input type="checkbox" name="custom-filter[levies]" <?php if(isset($custom['levies'])){ echo 'checked="checked"'; }?>><?php _e('Levies Range', 'realestate_attributes'); ?></li>
Add the following column to
osc_t_item_house_attrName: i_levies
Type: INT
Length: 6
Default: NULL
-----------------------------------------------------
This worked for me. Hopefully it will work for you