OS Property support center

Adding additional options to Market Status

  • MelanieB
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 years 2 weeks ago #150892 by MelanieB
Hi,

I am trying to add additional options to market Status so they appear in the search and in the market status area. 

The 2 files I have changed are:

administrator/components/com_osproperty/classes/configuration/properties/sold.php 
Code:
        <div class="controls">             <?php             $market_status = array();             $tmp           = new \stdClass();             $tmp->value = 1;             $tmp->text = JText::_('OS_SOLD');             $market_status[0] = $tmp;             $tmp           = new \stdClass();             $tmp->value = 2;             $tmp->text = JText::_('OS_CURRENT');             $market_status[1] = $tmp;             $tmp           = new \stdClass();             $tmp->value = 3;             $tmp->text = JText::_('OS_RENTED');             $market_status[2] = $tmp;             $tmp           = new \stdClass();             $tmp->value = 4;             $tmp->text = JText::_('OS_RESERVED');             $market_status[3] = $tmp;            $tmp           = new \stdClass();             $tmp->value = 5;             $tmp->text = JText::_('OS_UNDEROFFER');             $market_status[4] = $tmp;                                     $checkbox_market_status = array();             if (isset($configs['market_status'])){                 $checkbox_market_status = explode(',',$configs['market_status']);             }             if($configs['use_sold'] == "1"){                 $checkbox_market_status = 1;             }             echo JHTML::_('select.genericlist',$market_status,'configuration[market_status]','multiple class="chosen form-select"','value','text',$checkbox_market_status);             ?>         </div>

And also 
Code:
static function buildDropdownMarketStatus($mstatus){         $configClass = self::loadConfig();         $market_status         = $configClass['active_market_status'];         if($market_status == 1){             $marketArr            = array();             $marketArr[]        = JHtml::_('select.option',0,JText::_('OS_MARKET_STATUS'));             $market_status         = $configClass['market_status'];             if($market_status != ""){                 $market_status_array = explode(",",$market_status);                              if(in_array('1',$market_status_array)){                     $marketArr[] = JHtml::_('select.option',1,JText::_('OS_SOLD'));                 }                 if(in_array('2',$market_status_array)){                     $marketArr[] = JHtml::_('select.option',2,JText::_('OS_CURRENT'));                 }                 if(in_array('3',$market_status_array)){                     $marketArr[] = JHtml::_('select.option',3,JText::_('OS_RENTED'));                 }                 if(in_array('4',$market_status_array)){                     $marketArr[] = JHtml::_('select.option',4,JText::_('OS_RESERVED'));                 }                 if(in_array('5',$market_status_array)){                     $marketArr[] = JHtml::_('select.option',5,JText::_('OS_UNDEROFFER'));                   }             }             return JHtml::_('select.genericlist',$marketArr,'isSold','class="input-medium chosen"','value','text',$mstatus);         }     }     static function returnMarketStatus($marketStatus){         switch ($marketStatus){                         case "1":                 return JText::_('OS_SOLD');             break;             case "2":              return JText::_('OS_CURRENT');             break;             case "3":                 return JText::_('OS_RENTED');             break;             case "4":                 return JText::_('OS_RESERVED');             break;             case "5":               return JText::_('OS_UNDEROFFER');             break;                 }     }

When a property is changed to Reserved or Under Offer in the administrator property details area they default to Current. I am obviously missing another setting somewhere to get it to recognise the 2 new options of Reserved and Under offer. 

Can you tell me where else i would need to change?

Kind regards

Mel

    

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

More
2 years 2 weeks ago #150897 by Mr. Dam
Replied by Mr. Dam on topic Adding additional options to Market Status
Hi Mel,
You can use your own customization code and let me know if you have any further issue, i will figure and let you know where you can change it
Thanks
Dam

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

  • MelanieB
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 years 2 weeks ago #150907 by MelanieB
Replied by MelanieB on topic Adding additional options to Market Status
Hi Dam,

I am using the code similar to above. I have added it to my old demo site you did some custom work on, I have sent the login and FTP details via the support if that helps?

If you select different options in the search filters it displays mixed results and not for example all Reserved.

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

More
2 years 2 weeks ago #150975 by Mr. Dam
Replied by Mr. Dam on topic Adding additional options to Market Status
Answered through Ticket system

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

Moderators: Mr. DamNguyen Phu Quan