Hi Sam, let me share a couple of thoughts with you.
1. PHP versions change continually, when they reach a EOL (end of life). You need to be using the support versions to keep things more secure and working.
You can check EOL for php here:
https://www.php.net/supported-versions.phpYou can see even 7.4 if out of active updates and moved into security only.
2. You are now understanding how customizing your cart has a downside are not keeping up with changes to various systems. Perhaps your customization is able to work with no or little changes. Perhaps you should look into make your coding changed into an extension?? You need to rethink how your custom coding is being applied to the core, and make some adjustments to your process - as upgrades to php, OS, etc is ongoing.
3. If you have access to cPanel and softaculous, you could clone your existing site, upgrade your php etc and see if it works with your custom coding etc.
We have posted Softaculous how-tos on our info hub:
https://why2central.net/kb/using-softaculous/