OS Property support center

Half baths

More
11 years 3 months ago #40835 by Matt
Half baths was created by Matt
Where can values for half baths in the dropdown list of Manage Properties be added? Instead of the current 1, 2, 3, 4, 5 and so on I would like the dropdown to have .5, 1, 1.5, 2, 2.5, 3, 3.5 and so on.

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

More
11 years 3 months ago #40838 by Mr. Dam
Replied by Mr. Dam on topic Re: Half baths
Hi Matt,
Unfortunately, OS Property doesn't support Half baths, beds ...etc. But you can create the extra fields for those purposes.
Thanks
Dam

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

More
11 years 3 months ago #40841 by Matt
Replied by Matt on topic Re: Half baths
I already considered extra fields, but that doesn't make sense to me. I'm comfortable editing php and the SQL db. Could you just let me know where the dropdown is created?

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

More
11 years 2 months ago - 11 years 2 months ago #42159 by Matt
Replied by Matt on topic Half baths [SOLVED]
It took me a bit to find where the dropdown for half baths is created, but I found and edited it to reflect half baths since this (for some odd reason) isn't supported in OSProperty. You'll also have to change one thing in your database.

Fire up your FTP program and open /administrator/components/com_osproperty/classes/property.php. For me it was line 1406 where the For loop is generating the dropdown values for bathrooms. I noticed there is another For loop around line 1133 that is exactly the same, but wouldn't do anything when I changed the loop.

Here's what the code should look like...
Code:
//number bath rooms $bathArr[] = JHTML::_('select.option','',JText::_('OS_SELECT_NUMBER_BATHS')); for($i=1;$i<=20;$i++){ $bathArr[] = JHTML::_('select.option',$i,$i); } $lists['nbath'] = JHTML::_('select.genericlist',$bathArr,'bath_room','class="input-mini"','value','text',$row->bath_room);

Now simply change it to.....
Code:
//number bath rooms $bathArr[] = JHTML::_('select.option','',JText::_('OS_SELECT_NUMBER_BATHS')); for($i=1;$i<=20;$i+=0.5){ $bathArr[] = JHTML::_('select.option',$i,$i); } $lists['nbath'] = JHTML::_('select.genericlist',$bathArr,'bath_room','class="input-mini"','value','text',$row->bath_room);

Instead of the loop incrementing by 1 it will now increment by 0.5 giving you the half bath selection.

Now for the Database. Fire up phpMyAdmin or whatever you use to access your databases and look for the ####_osrs_properties table where #### reflects YOUR table prefix. Click on the table and then click on the Structure tab. Look for bath_room and click Change over to the right (keeping in mind I'm using phpMyAdmin). Now go to Type and select DECIMAL instead of INT and change the Length/Values to 5, 1 instead of 11. Just make sure you backup property.php AND your database before making any changes. Hope this helps someone :)


Attachments:
Last edit: 11 years 2 months ago by Matt.

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

Moderators: Mr. DamNguyen Phu Quan