Skip to content

Commit

Permalink
Do not rewrite existing store switcher viewModel (IMI_StoreSwitch com…
Browse files Browse the repository at this point in the history
…patibility)
  • Loading branch information
roma84 committed Jul 18, 2022
1 parent 94fbe79 commit 412bc62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Plugin/StoreSwitcherBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(ObjectManagerInterface $objectManager)
*/
public function beforeToHtml(\Magento\Store\Block\Switcher $block)
{
if ($this->viewModel) {
if (!$block->getViewModel() && $this->viewModel) {
$block->setViewModel($this->viewModel);
$block->assign('viewModel', $this->viewModel);
}
Expand Down

0 comments on commit 412bc62

Please sign in to comment.