Search parameter passed by url Get

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search parameter passed by url Get

This topic contains 7 replies, has 2 voices, and was last updated by

 
Keymaster
5 years, 2 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #10693

    Participant

    I need to be able to make a search passing the location in the url,

    so if I go to
    http://www.kohsamuiholidays.com/search?location=Maenam (for instance)
    it’ll show the same as if I go to
    http://www.kohsamuiholidays.com/search
    and choose “Maenam” as location

    #10695

    Hi,

    While it is not possible to trigger via URL, there might be a solution. Try putting this custom code to the functions.php file in your active theme directory:

    This will detect the “location” parameter and change the location value of the search select on load.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10700

    Participant

    OK, thanks a lot

    It does load in a weird way though, please have a look and the search does not work anymore, any easy way to fix this, please?

    http://www.kohsamuiholidays.com/search?location=Maenam

    #10701

    Hi,

    I don’t know, I will have to be able to make changes to the code directly to see if it is possible.

    If you have a temporary FTP details to your test environment, feel free to update your ticket, and I will take a look.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10719

    Participant
    You cannot access this content.
    #10721

    Hi!

    Thank you for the details, I was able to find a solution. I’ve changed the function.php file on your server accordingly.

    For future reference, this is the working code:

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10752

    Participant

    That is amazing!
    Thank you so much for all your help, your time and effort!
    Have an awesome week!
    Alberto

    #10763
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

The topic ‘Search parameter passed by url Get’ is closed to new replies.