diff --git a/Plugin/StoreSwitcherBlock.php b/Plugin/StoreSwitcherBlock.php new file mode 100644 index 0000000..395bce1 --- /dev/null +++ b/Plugin/StoreSwitcherBlock.php @@ -0,0 +1,35 @@ +viewModel = $objectManager->create(ViewModel::class); + } + } + + /** + * @param \Magento\Store\Block\Switcher $block + */ + public function beforeToHtml(\Magento\Store\Block\Switcher $block) + { + if ($this->viewModel) { + $block->setViewModel($this->viewModel); + $block->assign('viewModel', $this->viewModel); + } + } +} diff --git a/etc/di.xml b/etc/di.xml index e82f20b..376c04c 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -25,4 +25,9 @@ + + + + +