The power of Hooks!

Talk about Hooks. Share Hooks you have made.
Post Reply
User avatar
tessthepup
Certified Developer
Posts: 381
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

The power of Hooks!

Post by tessthepup »

Ask ChatGPT and it never fails to deliver
Phoenix Cart Hooks are one of the platform's most powerful development features, allowing store owners and developers to add new functionality, alter existing behaviour, and enhance the customer experience without modifying the Phoenix Cart core files. By placing small, self-contained hook files into designated hook locations, new features can be injected into almost any part of the storefront or administration area. This approach makes upgrades significantly easier because customisations remain separate from the core software, reducing the risk of conflicts when updating to newer Phoenix Cart versions.

The flexibility of the hook system makes it possible to create everything from simple design enhancements to complex business features. Hooks can be used to add promotional banners, checkout improvements, product widgets, SEO tools, customer notifications, payment enhancements, shipping integrations, security features, and much more. Because hooks can inject HTML, CSS, JavaScript, and PHP logic directly into predefined locations, developers can rapidly extend store functionality while maintaining a clean and maintainable codebase. Whether you're building a small visual enhancement or a full commercial addon, Phoenix Cart Hooks provide a robust, upgrade-friendly framework that encourages innovation without compromising the stability of the store.
For me I have hooked into the checkout process and added a hook to skip checkout_shipping and go straight to the payment page. I have also used a hook (a rather substanial one at 176 lines of code) to modify the payment page but it has drastically changed the look and feel of the checkout process.

Has anyone else taken this approach to modify layouts? (discuss ;))
You do not have the required permissions to view the files attached to this post.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
bonbec
Contributor
Posts: 190
Joined: Mon Oct 26, 2020 12:23 pm
Phoenix Version: V1.1.0.7
Has thanked: 54 times
Been thanked: 40 times

Re: The power of Hooks!

Post by bonbec »

Interesting topic for discussion, and great work redesigning the page.
I’m not knowledgeable enough to create hooks. I’m a bit too "old school"—I tend to just duplicate a file and modify it within a template.
I have to admit, the result in your screenshot looks amazing... it's like a dream.
User avatar
tessthepup
Certified Developer
Posts: 381
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

Re: The power of Hooks!

Post by tessthepup »

Another example of how a hook can make your store look more modern and less out of the box
You do not have the required permissions to view the files attached to this post.
Omar_one
Senior Contributor
Posts: 676
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: The power of Hooks!

Post by Omar_one »

@tessthepup Looks interesting! Will this become a module?
User avatar
tessthepup
Certified Developer
Posts: 381
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

Re: The power of Hooks!

Post by tessthepup »

Omar_one wrote: Sun Jun 28, 2026 2:46 pm @tessthepup Looks interesting! Will this become a module?
@Omar_one it may end up as a code co-op download ;)


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