• Resolved dugost

    (@dugost)


    My client’s site is bilingual (English/French) and a form on their membership page passes users to a checkout page. However, its URL is appended with specific parameters for chosen level and discount code.

    The page has a FR version that the Language Switcher can flip to but the added parameters in URL are not preserved when switching.

    For example:
    …en/member/checkout/?level=1&discount_code=free
    goes to:
    …fr/membre/verification/

    I can have the FR version of the form pass those same parameters into the ‘verification’ page URL, sure, but any user deciding to switch language at checkout will end up signing up for the default level and have no saved discount code.

    So is there any way to have Polylang detect the current URL and automatically tack on any parameters that follow the slug?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chouby

    (@chouby)

    Hello,

    This is the desired behavior because there are situations where keeping these url query params would create undesire effects.
    You can can customize this behavior with this filter https://polylang.pro/doc/filter-reference/#pll_the_language_link

    Thread Starter dugost

    (@dugost)

    Thank you for that! I’ll pass this along to my programmer to possibly customize.

    Edit: With your info about the filter, I was able to search for it and find this post with a function that solves the problem. Passing it along it case it helps others. Thank you again!

    • This reply was modified 1 year, 8 months ago by dugost. Reason: New info, helpful link
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘URL parameters / URL variables aren’t preserved by the Language Switcher’ is closed to new replies.