+ Reply to Thread
Results 1 to 3 of 3

Thread: Custom fields city on listing.tpl

  1. #1
    Senior Member
    Join Date
    Aug 2014
    Posts
    163

    Custom fields city on listing.tpl

    Hello,

    Despite the help of rudi, I still can't display the city.

    The country yes, but not the city since the new 4.8.1 version.

    Work fine on 4.8 version, don't work 4.8.1 version {phrase db_check=true key='data_formats+name+'|cat:$listing.country_leve l2}

    work fine 4.6 version, don't work {assign var='country_level2' value='data_formats+name+'|cat:$listing.country_le vel2} {$lang.$country_level2}

    Work fine > {assign var='country' value='data_formats+name+'|cat:$listing.country} {$lang.$country}

    I added this code in the controller listing_type.inc.php

    Code:
    Only registered members can view the code.
    Does anyone have an idea, because I'm blocking it a bit :s

    Thank you.

  2. #2
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,162
    Hello,

    Because you set incorrect key for your location item in $rlMultiField -> getNames()

    instead of country_level2 you should use a particular key of the location

    For example, the city San Francisco has the following key countries_united_states_california_san_francisco

    this key should be used in that method to set phrase for $lang array


    in your case, you need to get city keys from $listings array in listing_type.inc.php like that:

    PHP Code:
    Only registered members can view the code
    Last edited by Rudi; September 8, 2020 at 06:59 PM.

  3. #3
    Senior Member
    Join Date
    Aug 2014
    Posts
    163
    Thank you Rudi,

    WORK FINE

+ Reply to Thread