You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a problem in which I have two channels:
Polish
English
Polish channel contains only polish lang, english has english only.
In the services.yaml file the default language is defined as pl_EN.
When I go to the english channel and try to go to payment, I am redirected to the home page.
final class NonChannelLocaleListener
{
...
/**
* @throws NotFoundHttpException
*/
public function restrictRequestLocale(RequestEvent $event): void
{
...
$requestLocale = $request->getLocale();
if (!in_array($requestLocale, $this->channelBasedLocaleProvider->getAvailableLocalesCodes(), true)) {
$event->setResponse(
new RedirectResponse(
$this->router->generate(
'sylius_shop_homepage',
['_locale' => $this->channelBasedLocaleProvider->getDefaultLocaleCode()],
),
),
);
}
}
}
everytime we are redirecting to payum routes, $request->getLocale() provides invalid locale, which causes redirect to homepage instead of payment proceeding.
Quick solution for this is to add /{_locale} in paths (system will automatically provide this locale from previous actions):
I encountered a problem in which I have two channels:
Polish channel contains only polish lang, english has english only.
In the services.yaml file the default language is defined as pl_EN.
When I go to the english channel and try to go to payment, I am redirected to the home page.
The reason is routing configuration:
etc. for any other route in bundle.
Since in Sylius ShopBundle we have a method:
everytime we are redirecting to payum routes, $request->getLocale() provides invalid locale, which causes redirect to homepage instead of payment proceeding.
Quick solution for this is to add
/{_locale}
in paths (system will automatically provide this locale from previous actions):for all routes included.
The text was updated successfully, but these errors were encountered: