Magento 2 Issue with get current url of store

I have a website with multiple websites and multiple store views. To display store switcher in the header I have added below code. <ul class=”sub-lang”> <?php foreach ($helper->getWebsites() as $website) { foreach ($website->getGroups() as $group) { $stores = $group->getStores(); foreach ($stores as $store) { ?> <li><a class=”<?php echo $store->getName(); ?>” href=”<?php echo $helper->getCurrentUrl(); ?>”><?php echo…