New to Magento. I am trying to merge the content of the two default tabs on mobile view into one tab. Is it possible to add store.links (Account) as a link in the store.menu (Menu) much like the Industries link?
1 Answer
You can do this with simple JS and css code. In Magento Account links are added to Account tab using this piece of code in vendor/magento/theme-frontend-blank/Magento_Theme/web/js/theme.js
$('.panel.header > .header.links').clone().appendTo('#store\\.links');
You can override theme.js file in your custom theme and change the code to
$('.panel.header > .header.links').clone().appendTo('#store\\.menu');
So the account links are now available in Menu Tab. To remove the tab like structure you can add this css code
@media only screen and (max-width: 767px) {
.nav-sections .nav-sections-item-title {
display: none;
}
.nav-sections-item-content {
margin-top: 0;
padding-top: 0;
}
}
Menu tab is by default active.