0

enter image description here

I want to sort alphabetically this store view change list. Can anyone help with how can I do this in magneto 2.3.4?

0

i got the solution .override Magento\Backend\Block\Store\Switcher

here change function

public function getWebsites()
{
    $websites = $this->_storeManager->getWebsites();
    if ($websiteIds = $this->getWebsiteIds()) {
        $websites = array_intersect_key($websites, array_flip($websiteIds));
    }
    
    
    # get a list of sort columns and their data to pass to array_multisort
    $sort = array();
    foreach($websites as $k=>$v) {
    $sort['name'][$k] = strtoupper($v['name']);
    }
    # sort by event_type desc and then title asc
    array_multisort($sort['name'], SORT_ASC,$websites);

    return $websites;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.