Hook for both shop and admin

Open to all! Ask other shopowners for help.
Post Reply
Piernas
Member
Posts: 98
Joined: Thu Mar 11, 2021 2:16 am
Phoenix Version:
Has thanked: 2 times
Been thanked: 5 times

Hook for both shop and admin

Post by Piernas »

Is there a way to set up a global site hook rather than copying it under hooks/admin and hooks/shop?


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Hook for both shop and admin

Post by ecartz »

No.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Hook for both shop and admin

Post 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.
Piernas
Member
Posts: 98
Joined: Thu Mar 11, 2021 2:16 am
Phoenix Version:
Has thanked: 2 times
Been thanked: 5 times

Re: Hook for both shop and admin

Post 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.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply