How can I reset the search filter when changing languages?

This topic contains 32 replies, has 3 voices, and was last updated by  Alexander Krutov 5 years, 6 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #504850

    Alexander Krutov
    Expired Member
    Post count: 652

    Hello! Can I ask you to tell me how I can reset the search filter when switching to another language? I need to do this so that I don’t get wrong search results for listings that have locations in a different language.

    That is, I need to remove the category, word and location from the filter when switching to another language in the language switch. The recording type must be kept the same. For example, it should work this way: from search in Russian /en/search/?geodir_search=1&stype=gd_loss&spost_category[]=76&s=black&snear=&sgeo_lat=&sgeo_lon=&city=kiev go to Ukrainian /uk/search/?geodir_search=1&stype=gd_loss&spost_category[]=&s=+&snear=&sgeo_lat=&sgeo_lon=

    #504851

    Alexander Krutov
    Expired Member
    Post count: 652
    This reply has been marked as private.
    #504890

    Alex Rollin
    Moderator
    Post count: 27815

    It does not work like that, it would require a customization as far as I know. I have flagged your topic for the developers to consider.

    #504897

    Alexander Krutov
    Expired Member
    Post count: 652

    Thank you. Can I wait for a decision? What will it be?

    #504899

    Alexander Krutov
    Expired Member
    Post count: 652

    I’m also wondering if I can hide the language switch on some pages. In this case – on the search page.

    #504910

    Kiran
    Moderator
    Post count: 7069

    hi,

    I need to remove the category, word and location from the filter when switching to another language in the language switch.

    This is WPML default behaviour that keep some variable with switching page url in different language. This requires some customization to achieve that you are asking.

    I’m also wondering if I can hide the language switch on some pages. In this case – on the search page.

    Language switcher is managed via WPML plugin, so you can ask WPML support team. They might have solution for this.

    Kiran

    #505134

    Alexander Krutov
    Expired Member
    Post count: 652

    Kiran, thank you for the answer! And can I make it possible to control the language switch widget GD in the sidebar? I mean, some GD widgets can be disabled for pages where they shouldn’t be displayed.

    #505136

    Kiran
    Moderator
    Post count: 7069

    WPML also provide to show/hide widget based on language. GD widgets also have show/hide option to restrict on frontend pages.

    Kiran

    #505143

    Alexander Krutov
    Expired Member
    Post count: 652

    The thing is, I need to hide the WPML widget on certain pages, not languages. Do I need to use an additional plugin for this? Would you advise which plugin to use?

    #505144

    Kiran
    Moderator
    Post count: 7069

    You can use https://wordpress.org/plugins/widget-options/ which allows to control each widgets visibility and appearance.

    Kiran

    #505146

    Alexander Krutov
    Expired Member
    Post count: 652

    Thanks for the advice!

    #505154

    Alexander Krutov
    Expired Member
    Post count: 652

    Something’s not working. The plugin only turns off the country’s flag. Could you check what the problem is?

    #505156

    Alexander Krutov
    Expired Member
    Post count: 652
    This reply has been marked as private.
    #505219

    Alexander Krutov
    Expired Member
    Post count: 652

    Thank you, don’t do anything now, I consult WPML.

    #505531

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 33 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