Page 1 of 1

Apartment "type" option

PostPosted: 11 Jun 2013, 07:59
by darren
Hi ,

I would like to remove two of the the "type" selection ?

as the option rent to smb, rent from smb ...is not applicable for my use. thank you

Re: Apartment "type" option

PostPosted: 11 Jun 2013, 08:25
by Xpycm
Hello.

protected/modules/apartments/models/Apartment.php file

function getTypesArray
comment/delete the line:
Code: Select all
$types[self::TYPE_RENT] = tt('Rent''apartments'); 

and
Code: Select all
$types[self::TYPE_RENTING] = tt('Rent a''apartments'); 


function fillI18nArray
comment/delete the line:
Code: Select all
$vs[self::TYPE_RENT] = 'Want rent property to smb'

and
Code: Select all
$vs[self::TYPE_RENTING] = 'Want rent property form smb'


function getTypesWantArray
comment/delete the line:
Code: Select all
$types[self::TYPE_RENT] = tt('Want rent property to smb''apartments'); 

and
Code: Select all
$types[self::TYPE_RENTING] = tt('Want rent property form smb''apartments'); 


Code: Select all
protected/components/SearchForm.php file

function apTypes
comment/delete the line:
Code: Select all
if(in_array(Apartment::PRICE_RENTING$result)){
    
$types[Apartment::PRICE_RENTING] = tt('Rent a''apartments');

and
Code: Select all
if(in_array(Apartment::PRICE_PER_DAY$result)){
    
$types[Apartment::PRICE_PER_DAY] = tc('rent by the day');
}

if(
in_array(Apartment::PRICE_PER_HOUR$result)){
    
$types[Apartment::PRICE_PER_HOUR] = tc('rent by the hour');
}

if(
in_array(Apartment::PRICE_PER_MONTH$result)){
    
$types[Apartment::PRICE_PER_MONTH] = tc('rent by the month');
}

if(
in_array(Apartment::PRICE_PER_WEEK$result)){
    
$types[Apartment::PRICE_PER_WEEK] = tc('rent by the week');

Re: Apartment "type" option

PostPosted: 11 Jun 2013, 10:59
by darren
Thank you Xpycm *BRAVO* *BRAVO* , I manage to remove the rental component successfully.

With the rental remove, the sections search field become redundant....I wonder you could guide me again to remove this, thank you

Re: Apartment "type" option

PostPosted: 11 Jun 2013, 11:31
by Xpycm
protected/views/site/field-type-search.php file
Replace the content of all the file for:
Code: Select all
<?php
    
echo CHtml::hiddenField('apType'0);

    if(
isFree()){
        
$currency param('siteCurrency''$');
    } else {
        
$currency Currency::getCurrentCurrencyName();
    }

    
Yii::app()->clientScript->registerScript('set-currency-name''
        function setCurrencyName(id){
            var currencyName = "'
.$currency.'";

            if (propertyType) {
                /* hide all */
                $.each(propertyType, function(key, value) {
                    $("#price-search-"+key).hide();
                    $("#price-currency-"+key).html("");
                    $("#price-currency-"+key).hide();
                });

                /* show selected */
                $("#price-search-"+id).show();
                $("#price-currency-"+id).html(currencyName);
                $("#price-currency-"+id).show();
            }
        }
    '
CClientScript::POS_END);

    
Yii::app()->clientScript->registerScript('currency-name-init''
        setCurrencyName(0);
    '
CClientScript::POS_READY);
?>

Re: Apartment "type" option

PostPosted: 11 Jun 2013, 12:19
by darren
Thank you again, great support. *THUMBS UP*