Page 1 of 1
Hook for both shop and admin
Posted: Sat May 15, 2021 7:39 pm
by Piernas
Is there a way to set up a global site hook rather than copying it under hooks/admin and hooks/shop?
Re: Hook for both shop and admin
Posted: Sat May 15, 2021 7:45 pm
by ecartz
No.
Re: Hook for both shop and admin
Posted: Sat May 15, 2021 7:48 pm
by ecartz
You might be able to simplify it a bit by having one file alias the other. E.g.
Code: Select all
class hook_admin_siteWide_whatever extends hook_shop_siteWide_whatever {
}
would duplicate all the listeners in the shop class into the admin class. But it would still take two files.
Re: Hook for both shop and admin
Posted: Sat May 15, 2021 8:45 pm
by Piernas
Thank you. It's not a real problem to have two files - I was wondering if I could use just one for both.