Option to disable Plans, Donations and multiple inventory locations. #3485
Unanswered
mikesnoeren
asked this question in
Ideas
Replies: 1 comment
-
Hi @mikesnoeren Thank you for your feedback. Adding some form of configuration or settings for these is something we can consider in the future. For the moment, you can achieve this with a small piece of code in a custom module. use craft\base\Event;
use craft\events\RegisterCpNavItemsEvent;
use craft\web\twig\variables\Cp;
// ...
Event::on(Cp::class, Cp::EVENT_REGISTER_CP_NAV_ITEMS, function(RegisterCpNavItemsEvent $event) {
foreach ($event->navItems as &$navItem) {
if ($navItem['url'] !== 'commerce') {
continue;
}
foreach (['donations', 'subscription-plans'] as $key) {
unset($navItem['subnav'][$key]);
}
}
}); Hope this helps, thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For a lot of webshops, the options above are not required. Having them is great, but they clutter up the CMS a bit. It would be nice if we could disable those.
Beta Was this translation helpful? Give feedback.
All reactions