Skip to main content
added 15 characters in body
Source Link
KaMZaTa
  • 255
  • 1
  • 15
  • 40

It's a Magento 2.3.1 to 2.3.4 bug. The problem is in the view... and exactly in module-store/view/frontend/templates/switch/languages.phtml at the line 28.

WRONG

<li class="view-<?= $block->escapeHtml($_lang->getCode()) ?> switcher-option"> <a href="<?= $block->escapeUrl($block->getViewModel()->getTargetStoreRedirectUrl($_lang)) ?>"> <?= $block->escapeHtml($_lang->getName()) ?> </a> </li> 

CORRECT

<li class="view-<?= $block->escapeHtml($_lang->getCode()) ?> switcher-option"> <a href="#" data-post='<?= /* @noEscape */ $block->getTargetStorePostData($_lang) ?>'> <?= $block->escapeHtml($_lang->getName()) ?> </a> </li> 

...and now it works like a charm!

It's a Magento bug. The problem is in the view... and exactly in module-store/view/frontend/templates/switch/languages.phtml at the line 28.

WRONG

<li class="view-<?= $block->escapeHtml($_lang->getCode()) ?> switcher-option"> <a href="<?= $block->escapeUrl($block->getViewModel()->getTargetStoreRedirectUrl($_lang)) ?>"> <?= $block->escapeHtml($_lang->getName()) ?> </a> </li> 

CORRECT

<li class="view-<?= $block->escapeHtml($_lang->getCode()) ?> switcher-option"> <a href="#" data-post='<?= /* @noEscape */ $block->getTargetStorePostData($_lang) ?>'> <?= $block->escapeHtml($_lang->getName()) ?> </a> </li> 

...and now it works like a charm!

It's a Magento 2.3.1 to 2.3.4 bug. The problem is in the view... and exactly in module-store/view/frontend/templates/switch/languages.phtml at the line 28.

WRONG

<li class="view-<?= $block->escapeHtml($_lang->getCode()) ?> switcher-option"> <a href="<?= $block->escapeUrl($block->getViewModel()->getTargetStoreRedirectUrl($_lang)) ?>"> <?= $block->escapeHtml($_lang->getName()) ?> </a> </li> 

CORRECT

<li class="view-<?= $block->escapeHtml($_lang->getCode()) ?> switcher-option"> <a href="#" data-post='<?= /* @noEscape */ $block->getTargetStorePostData($_lang) ?>'> <?= $block->escapeHtml($_lang->getName()) ?> </a> </li> 

...and now it works like a charm!

Source Link
KaMZaTa
  • 255
  • 1
  • 15
  • 40

It's a Magento bug. The problem is in the view... and exactly in module-store/view/frontend/templates/switch/languages.phtml at the line 28.

WRONG

<li class="view-<?= $block->escapeHtml($_lang->getCode()) ?> switcher-option"> <a href="<?= $block->escapeUrl($block->getViewModel()->getTargetStoreRedirectUrl($_lang)) ?>"> <?= $block->escapeHtml($_lang->getName()) ?> </a> </li> 

CORRECT

<li class="view-<?= $block->escapeHtml($_lang->getCode()) ?> switcher-option"> <a href="#" data-post='<?= /* @noEscape */ $block->getTargetStorePostData($_lang) ?>'> <?= $block->escapeHtml($_lang->getName()) ?> </a> </li> 

...and now it works like a charm!