Is it possible in M2 to change mobile menu item order? enter image description here

I tried looking and couldn't find. I wanna put settings in the back and put menu item in the front using xml. Basically tried this line <move element="store.links" destination="navigation.sections" after="store.settings" /> and it won't work.

  • By default settings are not available in menu theme, and you want to change sort order of menu like, 1.Menu 2. Account 3. Settings Commented Jun 2, 2016 at 9:56

2 Answers 2


You can do it with css. See http://caniuse.com/#feat=flexbox and https://developer.mozilla.org/en-US/docs/Web/CSS/order

Example how to use flexbox order:

<!DOCTYPE html>
<div id='main'>


#main { display: flex;  text-align:center; }
#main > article { flex:1;        order: 2; }
#main > nav     { width: 200px;  order: 1; }
#main > aside   { width: 200px;  order: 3; }

Result will be

Nav | Article | Aside

  • I am searching a way to change order using xml
    – kilis
    Commented Jun 2, 2016 at 8:17
  • This won't change the order for screen readers or search engines. Commented Oct 21, 2016 at 19:11

Add the following code right after <?php if ($detailedInfoGroup = $block->getGroupChildNames($group, 'getChildHtml')):?> in the sections template Magento_Theme::html/sections.phtml

$detailedInfoGroup = array_filter($block->getChildNames(), function($childName) use($detailedInfoGroup) {
    return in_array($childName, $detailedInfoGroup);

After adding this, you can change the order as you normally would with XML using before="" / after=""

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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