-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hook actionMainMenuModifier #70
base: dev
Are you sure you want to change the base?
Conversation
8d39ed6
to
e2c52e5
Compare
Wouldn't it be better if you could change the $menu variable instead? With this solution, you can display things only after the list, but cannot modify the items. |
I like this Idea |
e2c52e5
to
b0601c8
Compare
Sorry, I lost the thread! Yes it's ok for me :) You will need to add the new hook on the core side (in hook.xml file) |
@M0rgan01 I think we shouldn't, the core should include no data or references to any modules I think. |
I thought that was the case :) Everything is good |
Hi @bibips Thank you for your PR, I tested it and unfortunately this one doesn't works as expected as you can see : Indeed, the "use Hook;" doesn't seems to works and, because of that, the hook isn't accessible Thank you |
Thanks this hook it's possible to alter main menu. For instance you can display menu items per customer or per group of customer
b0601c8
to
f775adb
Compare
@AureRita Excuse me for the delay, I've removed |
This would be a great addition for external modules to be able to add links to the main menu. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see much value in this… isn't the sole purpose of menu that it's purely configurable by people?
Do you have any real use case for this hook?
Hi @Hlavtox, I've created this hook to add or remove menu items according some criterias. By instance in my shop I have a menu item only available for a group of customer. Thanks to this hook, we can check if the customer is logged in or if the customer matches certain criteria (such as country, device type, customer configuration, etc...) before making a menu item available. Without this hook, we can't. |
Hi @Hlavtox, Does this use case convince you of the hook's usefulness ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bibips
The explained use case makes sense to me and there are probably many others. The implementation is also ok so I dismiss your blocker for now @Hlavtox.
If you are other worries don't hesitate to re-review
actionMainMenuModifier
.Thanks this hook it's possible to have menu items specific per customer by example.
actionMainMenuModifier
and add or edit something into main menuHook usage :