GD SET_LOCATION_VAL

This topic contains 13 replies, has 2 voices, and was last updated by  Alex Rollin 6 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #471487

    Vincenzo Pezzella
    Expired Member
    Post count: 84

    Hello, I need an information: I see that URL Search Results is like https://sitename.ext/?geodir_search=1&stype=gd_place&s=+&snear=&set_location_type=3&set_location_val=20&sgd_placecategory%5B%5D=&sgeo_lat=&sgeo_lon=
    I have to know if is possible to add a SET_LOCATION_VAL in a dynamic way, with a variable for example.
    Thanks to all.

    #471516

    Alex Rollin
    Moderator
    Post count: 27815

    That value is set for location searches where an exact location is known, one that is already in the location manager database.

    So, it IS ALREADY set with a dynamic value by the search Near field.

    Can you explain your case?

    It is possible to intercept the query URL, or simply create your own. You could, for example, get the IDs from the Locations of each city and add a link to each.

    #471524

    Vincenzo Pezzella
    Expired Member
    Post count: 84

    I’m trying to set “Sort By” in Search Results via customizing code, so I try with URL datas because I see that change only one value: SET_LOCATION_VAL.

    #471528

    Alex Rollin
    Moderator
    Post count: 27815

    Changing that value will change which location is searched. If the value is set, then only listings in the corresponding location will be search.

    #471531

    Vincenzo Pezzella
    Expired Member
    Post count: 84
    #471536

    Alex Rollin
    Moderator
    Post count: 27815

    Are you just trying to pass a variable to the search page?

    #471537

    Vincenzo Pezzella
    Expired Member
    Post count: 84

    Yes, and the variable I’d like to pass is the city ID.
    Is possible to do this?

    #471539

    Alex Rollin
    Moderator
    Post count: 27815

    It is already passed in the URL.
    city=maple-shade-township (v2)
    set_location_val=1 (v1)

    #471543

    Vincenzo Pezzella
    Expired Member
    Post count: 84

    Ok but if I want to pass that value dynamically is possible to get the “near by” ID value?

    #471557

    Alex Rollin
    Moderator
    Post count: 27815

    What is the ‘near by’ id value? Do you mean the city?
    It is almost always possible with PHP to get the URL and ‘do something’ with it.

    #471581

    Vincenzo Pezzella
    Expired Member
    Post count: 84

    Exactly, I’d like to pass the city dynamically in URL.
    How can I set this?

    #471597

    Alex Rollin
    Moderator
    Post count: 27815

    You will need to create custom code for that, if you want to do something with the way the current location is passed or add your own information to the query.

    #471603

    Vincenzo Pezzella
    Expired Member
    Post count: 84

    Ok but which is the variable of city ID? Where I find it?

    #471625

    Alex Rollin
    Moderator
    Post count: 27815

    It is already passed in the URL.
    city=maple-shade-township (v2)
    set_location_val=1 (v1)

    You could, for example, get the IDs from the Locations of each city and add a link to each.

    Find the ID by checking the URL when you hover over the edit link in the settings at:

    GeoDIrectory – Settings – Locations (Multilocations) – Manage locations

Viewing 14 posts - 1 through 14 (of 14 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount