Hooks
Does the program continue from the hook after the added code is completed ?
Having watched Zipurman's Hooks video, it's revealed just how much more can be done with Phoenix Cart than is initially obvious.
https://www.youtube.com/watch?v=bLd9m_uABYI&t=5s
Hooks
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
Re: Hooks
Yes, from my amateur point of view, it's a bit like a module.
This might answer - https://github.com/gburton/CE-Phoenix/wiki/Hooks
It is the pre-placed hook calls throughout the core that make Phoenix so flexible.
Of course, with the template system, you could also copy and edit a file to add your own hook calls.
- burt
- Core Team
- Posts: 4546
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Hooks
A good example (that is fairly simplistic to learn from) is the MATC hook that exists in core code.
https://github.com/CE-PhoenixCart/Cart/ ... e/MATC.php
This Hook does two things;
1. It outputs a "Legal Agreements" checkbox
https://github.com/CE-PhoenixCart/Cart/ ... hp#L15-L35
which displays on the create_account (and other) pages:
https://phoenixcart.org/demo/create_account.php
2. It sets up a Modal window which pops up when someone clicks on either of the two links
https://github.com/CE-PhoenixCart/Cart/ ... hp#L37-L54
As you can see, it "injects" the data it makes into the create_account form, the form then continues and displays other hooks (if there are any), and the submit button etc.
https://github.com/CE-PhoenixCart/Cart/ ... e/MATC.php
This Hook does two things;
1. It outputs a "Legal Agreements" checkbox
https://github.com/CE-PhoenixCart/Cart/ ... hp#L15-L35
which displays on the create_account (and other) pages:
https://phoenixcart.org/demo/create_account.php
2. It sets up a Modal window which pops up when someone clicks on either of the two links
https://github.com/CE-PhoenixCart/Cart/ ... hp#L37-L54
As you can see, it "injects" the data it makes into the create_account form, the form then continues and displays other hooks (if there are any), and the submit button etc.
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.