Page 1 of 2
How to do this in Phoenix?
Posted: Fri Jun 12, 2026 12:49 pm
by Mort_Lemur
Finding my way round Phoenix on an XAMMP set up running php 8.2.
Currently I am modifying the way the invoice looks - as I don't like the stock version (sorry!)
I have produced a new admin/invoice.php file which gives the look i need however, this strays from the way I understand Phoenix works ie it bypasses the Bootstrap system, it injects in-line CSS and is not modular.
Now I know that this probably breaks everything that Phoenix is about (ie no core code changes) but is there another way to achieve this? I guess the invoice.php file will be overwritten with future Phoenix updates?
Maybe call it something like legacy_invoice.php and adjust the calls to this new file?
Let me know if you would like to see the file
Many Thanks

Re: How to do this in Phoenix?
Posted: Fri Jun 12, 2026 12:57 pm
by burt
Here's what I'd do;
your_admin/invoice.php <--- leave it be
all buttons that lead to this file, leave them be
your_admin/invoiceNEW.php <--- obv name it as you like
Make a new Hook, which listens at the top of admin/invoice.php
This Hook simply performs a redirect to invoiceNEW.php
So, you click a button to your_admin/invoice.php?orders_id=1234
Hook grabs that, and insta redirects you to invoiceNEW.php?orders_id=1234
--
Hooks were explored hardly at all in osCommerce, but they are that old.They do exist in 2.3.4
Phoenix supercharged Hooks as they are a way to extend/change Core Code...without touching Core Code.
You can do all sorts of interesting and cool things with them.
--
In other words...all the Core Stuff is as-is
You have a new Invoice.
Your new hook redirects.
Your new invoice page and your new Hook are highly unlikely to get overwritten by Core Code.
Re: How to do this in Phoenix?
Posted: Fri Jun 12, 2026 1:03 pm
by bonbec
Hello,
I don't like the stock version too (sorry too!) :-)
For my website, for the admin side, I rename the file with the name of my company? In that case, it's become invoice_ara.php. Like this, I know that this file is optimized for my use and it can't be overwritten.
I'd like to see a screenshot of your changes.
Re: How to do this in Phoenix?
Posted: Fri Jun 12, 2026 1:05 pm
by burt
And..no need to say sorry guys
I also don't like the Invoice, but yeah, it's functional for the most part.
Re: How to do this in Phoenix?
Posted: Fri Jun 12, 2026 1:06 pm
by raiwa
Example of a sitewide hook for your case:
placed and named:
includes/hooks/admin/siteWide/redirectInvoice.php
Code: Select all
class hook_admin_siteWide_redirectInvoice {
function listen_siteWideStart() {
if (Request::get_page() == 'invoice.php') {
Href::redirect(Guarantor::ensure_global('Admin')->link('invoice_ara.php')->retain_query_except());
}
}
}
Re: How to do this in Phoenix?
Posted: Fri Jun 12, 2026 3:59 pm
by Mort_Lemur
bonbec wrote: ↑Fri Jun 12, 2026 1:03 pm
Hello,
I don't like the stock version too (sorry too!) :-)
For my website, for the admin side, I rename the file with the name of my company? In that case, it's become invoice_ara.php. Like this, I know that this file is optimized for my use and it can't be overwritten.
I'd like to see a screenshot of your changes.
Screenshots below. Screenshot 1 is the default, however if you then click on the store name on the invoice it adds the order comments at the bottom, as per screenshot 2.
Re: How to do this in Phoenix?
Posted: Fri Jun 12, 2026 4:00 pm
by Mort_Lemur
Sorry for some reason the screenshot has also copied the admin header - the invoice isnt like that
Re: How to do this in Phoenix?
Posted: Fri Jun 12, 2026 4:09 pm
by bonbec
Thank you very much @Mort_Lemur
I will post too a screenshot of my redesigned invoice as soon as it is finalized.
Re: How to do this in Phoenix?
Posted: Fri Jun 12, 2026 4:21 pm
by Mort_Lemur
raiwa wrote: ↑Fri Jun 12, 2026 1:06 pm
Example of a sitewide hook for your case:
placed and named:
includes/hooks/admin/siteWide/redirectInvoice.php
Code: Select all
class hook_admin_siteWide_redirectInvoice {
function listen_siteWideStart() {
if (Request::get_page() == 'invoice.php') {
Href::redirect(Guarantor::ensure_global('Admin')->link('invoice_ara.php')->retain_query_except());
}
}
}
Thanks for that hook code, however when i rename my invoice invoice_fancy.php and edit the hook code to match it seems to only render the top half of the invoice to just below the address boxes?
Yet when the file is named invoice.php and the hook is deleted, the whole invoice shows.
Re: How to do this in Phoenix?
Posted: Fri Jun 12, 2026 4:54 pm
by bonbec
@Mort_Lemur you have to duplicate admin/includes/languages/YOUR_LANGUAGE/invoice.php
and change the name of invoice.php to invoice_fancy.php