Important
- For the pre-sale question, please feel free to contact us via live chat on Landofcoder.com ( From Monday to Friday 8:30 am - 5:30 pm GMT+7 ) or leave an offline message, we will give you a response asap.
- For technical questions, please submit a ticket below (recommended option) or send us an email via [email protected]. Our dev will support you within 24 hours since the submitted time (DO NOT support free extensions)
What we are trying to accomplish is having 2 Megamenu's, one that is visible to non-logged in users /general public, and the other visible only to dealers. In the admin, we have both set to "enabled", and both restricted by "customer groups". This in theory should accomplish what we need, but is not.
I found this link to a support page covering how to add a menu to the frontend. Is what I am describing as simple as adding the dealer menu to the xml file show in the link above? If so, what is the edit?
Hello Mate,
Have a nice day!
For now you can add the file "/app/code/Ves/Megamenu/view/frontend/layout/default.xml" into your custom template of your site to load more menu profiles on a block position. The code to call menu profile as this:
<referenceBlock name="store.menu">
<block class="Ves\Megamenu\Block\Menu" name="catalog.topnav" template="Ves_Megamenu::topmenu.phtml">
<arguments>
<argument name="alias" xsi:type="string">top-menu</argument>
</arguments>
</block>
</referenceBlock>
Did your site enabled full page cache option and you get the problem can not use restrict customer group for menu profile? I checked it on my local site without problem.
Hello, what is the correct code to add another menu? I tried this:
<referenceBlock name="store.menu">
<block class="Ves\Megamenu\Block\Menu" name="catalog.topnav" template="Ves_Megamenu::topmenu.phtml">
<arguments>
<argument name="alias" xsi:type="string">test-menu</argument>
<argument name="alias" xsi:type="string">b2b-menu</argument>
</arguments> </block>
</referenceBlock>
(Notice the second argument) But this code broke the site and produced the attached errors.
What we need is for customers to see only "test-menu" and for logged in dealers to see "b2b-menu". Does this make sense? In the admin, I have both menus created, enabled, but limited by user groups. So things are set up as would be expected in the admin.
Thanks,
Hello TG Dev,
Have a nice day!
The code is wrong. Please try to use the code:
<referenceBlock name="store.menu">
<block class="Ves\Megamenu\Block\Menu" name="catalog.topnav" template="Ves_Megamenu::topmenu.phtml">
<arguments>
<argument name="alias" xsi:type="string">test-menu</argument>
</arguments>
</block>
<block class="Ves\Megamenu\Block\Menu" name="catalog.topnav.b2b" template="Ves_Megamenu::topmenu.phtml">
<arguments>
<argument name="alias" xsi:type="string">b2b-menu</argument>
</arguments>
</block>
</referenceBlock>
Thank you very much!
That worked perfectly... We appreciate your excellent service so far.
You can close this ticket.
You are welcome!
Please submit new ticket if you need any other assistant!