Close

ACL to custom menu

Juson
8 years ago
#12474 Quote
Avatar
  • 25
Hello.


I want to use ACL to custom menus.


For example, I added 2 of customer roles, A and B.

For A, I want to show only A category, not B.

For B, I want to show only B category, not A.

Below is the code I have.

//For A
        <li>
            <span title="A">A</span>
            <div class="plus-button"></div>
            <div class="sublist-wrap">
                <ul class="sublist">
                    <li class="back-button">
                        <span>@T("SevenSpikes.MegaMenu.ResponsiveBackButton")</span>
                    </li>
                    <li>
                        <a href="a" title="a">a</a>
                    </li>
                    <li>
                        <a href="b" title="b">b</a>
                    </li>
                    <li>
                        <a href="c" title="c">c</a>
                    </li>
                </ul>
            </div>
        </li>


//For B
        <li>
            <span title="B">B</span>
            <div class="plus-button"></div>
            <div class="sublist-wrap">
                <ul class="sublist">
                    <li class="back-button">
                        <span>@T("SevenSpikes.MegaMenu.ResponsiveBackButton")</span>
                    </li>
                    <li>
                        <a href="1" title="1">1</a>
                    </li>
                    <li>
                        <a href="2" title="2">2</a>
                    </li>
                    <li>
                        <a href="3" title="3">3</a>
                    </li>
                </ul>
            </div>
        </li>



What kind of line should I add?


Thanks.
Boyko
8 years ago
#12476 Quote
Avatar
  • 1570
Juson wrote:
Hello.


I want to use ACL to custom menus.
...


What kind of line should I add?


Thanks.


Hi Juson,

I don't think you need to do anything extra as we check the ACL of each category so if the customer that is in Role A is browsing the site then it will not see the categories that are not visible for Role A.

I hope this makes sense!
Regards,
Nop-Templates.com Team
Juson
8 years ago
#12484 Quote
Avatar
  • 25
Boyko wrote:
Hello.


I want to use ACL to custom menus.
...


What kind of line should I add?


Thanks.

Hi Juson,

I don't think you need to do anything extra as we check the ACL of each category so if the customer that is in Role A is browsing the site then it will not see the categories that are not visible for Role A.

I hope this makes sense!



Thanks for the response Boyko.

Actually those subs are not categories, but http links. I think I cannot set ACL for links in admin menu.

Could you give me any advice?
Juson
8 years ago
#12485 Quote
Avatar
  • 25
Boyko wrote:
Hello.


I want to use ACL to custom menus.
...


What kind of line should I add?


Thanks.

Hi Juson,

I don't think you need to do anything extra as we check the ACL of each category so if the customer that is in Role A is browsing the site then it will not see the categories that are not visible for Role A.

I hope this makes sense!



And there's another problem.

I'm using 3.8 version, new UI of megamenu.

I added a category, ACL only for premium member on mega menu.

But guests can see the category on mega menu.

I know guests click it, redirect to error page, but I want guests not to even see the category name, perfectly hide.

Any advice?

Thanks.
Boyko
8 years ago
#12490 Quote
Avatar
  • 1570
Juson wrote:


And there's another problem.

I'm using 3.8 version, new UI of megamenu.

I added a category, ACL only for premium member on mega menu.

But guests can see the category on mega menu.

I know guests click it, redirect to error page, but I want guests not to even see the category name, perfectly hide.

Any advice?

Thanks.


Hi Juson,

So you are using the new Mega Menu in 3.8. How do you find it? Any feedback is welcome.

If a category is under ACL and the current customer should not see it then this category menu item should not appear in the Mega Menu.
We will correct this.

Regarding the ACL of the Custom Links we will think about it and how this could be done.
Regards,
Nop-Templates.com Team