osCommerce 2.3.4 vs Phoenix - admin page mental mindgame

If it doesn't quite fit in the other areas, put it here...
Post Reply
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

osCommerce 2.3.4 vs Phoenix - admin page mental mindgame

Post by burt »

admin/specials.php

In osCommerce 2.3.4 (and in fact ancient versions of Phoenix)

Code: Select all

└───admin
    │   specials.php
    │
    └───includes
        └───languages
            └───english
                    specials.php
It all makes sense right? Super simple...an admin page called specials.php and an accompanying language file of the same name.

Yet in modern Phoenix

Code: Select all

└───admin
    │   specials.php
    │
    └───includes
        ├───actions
        │   └───specials
        │       │   delete_confirm.php
        │       │   insert.php
        │       │   new.php
        │       │   set_flag.php
        │       │   update.php
        │       │
        │       ├───infoboxes
        │       │       default.php
        │       │       delete.php
        │       │
        │       └───views
        │               default.php
        │               edit.php
        │               new.php
        │
        └───languages
            └───english
                    specials.php
On the face of it, Phoenix has made it much more complicated, right?

Yet, the reality is the exact opposite.

Think of the old `specials.php` like a giant junk drawer that holds everything - pens, scissors, batteries, and random receipts all mixed together. To find or fix one thing, you have to dig through the entire mess, and if you accidentally move something, you might break five other things.

The new Phoenix structure is like having labeled drawers: one drawer just for pens, one just for scissors, one just for batteries. Each tiny file does only one specific job (adding, editing, deleting etc), so when you need to change how deletions work, you open just the 10-line delete_confirm.php file and nothing else gets touched.

Yes, there are more files, but each one is short, simple, and obvious-perfect for a beginner because you never have to face a 500-line wall of code; you just open the tiny file that does exactly what you need.

In simple terms

What you see in the Phoenix version is ALL in the osCommerce version as well - it's just that the osCommerce version has it all in ONE massive file. The Phoenix structure isn't adding complexity - it's unpacking existing complexity into organized, manageable pieces. The old way just hides the complexity inside a single 500-line monster file. Phoenix reveals the complexity as separate mini files that are easy to understand and safe to modify.

Bottom line

More files = less confusion. It's the difference between a messy pile of clothes and a well-organized dresser. Same amount of stuff, just actually findable and usable.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: osCommerce 2.3.4 vs Phoenix - admin page mental mindgame

Post by burt »

Because the Phoenix way is so much more flexible...more can be done. For example, let's add a system to set up an existing special as a `bargain` (IE ultra reduced price just to get rid of it) and a way to list bargains;

In osCommerce (admin):
  • Diving into that 500-line specials.php monster
  • Finding the right if/else blocks scattered everywhere
  • Adding SQL queries in 3-4 different places
  • Modifying the HTML forms, the list display, the insert logic, the update logic...
  • Touching at least 6 different sections of the same file
  • Praying you didn't break something unrelated
  • Cross your fingers and test everything manually
Honestly, I'm getting PTSD just thinking about how it used to be.

In Phoenix (admin):
  • Hook -> add in a new tickbox "is this a bargain: yes/no"
  • Hook -> remove bargains from the usual list of specials
  • Hook -> new button "see bargains" links to a new View.
  • View -> bargains
No Core Code touched. And...that list that say Hook, Hook, Hook - that can all be in ONE Hook file.
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: osCommerce 2.3.4 vs Phoenix - admin page mental mindgame

Post by burt »

The reason this "couldn't" have been done in osCommerce comes down to a mix of business history, timing, and the "technical debt" of being a pioneer.

1. The "First-Mover" Trap

osCommerce was the grandfather of open-source PHP ecommerce (launching in the early 2000s). At that time, procedural coding (the "monster file" approach) was the industry standard. It was how everyone wrote PHP.

Because osCommerce was so popular, it became the "standard." By the time the web started shifting toward modular architecture (MVC, Object-Oriented Programming, and modern frameworks) in the late 2000s and 2010s, osCommerce had millions of lines of code and thousands of third-party "contributions" (add-ons) that were all built on that old, procedural model.

2. The Fear of Breaking Millions of Stores

The osCommerce project faced a massive dilemma:

If they refactored to a modern architecture: They would break every single existing store, every custom theme, and every third-party add-on. Millions of store owners would have been forced to manually rebuild their entire business.

If they kept it as-is: They could keep the existing user base happy in the short term, but the software would eventually become unmaintainable and insecure as PHP versions evolved.

They essentially chose "stability" for too long, which led to the code becoming "stagnant." By the time the developers realized the "monster file" approach was a dead end, the project had lost its momentum.

3. Why Phoenix is different

Phoenix Cart was essentially a "rebellion" within the osCommerce community. The developers behind Phoenix decided that the cost of not modernizing was higher than the cost of breaking backward compatibility.

They took the core of osCommerce 2.3.4 - the parts that worked, like the database structure and the basic checkout logic - and they began to perform "heart surgery."
  • They didn't rewrite the logic overnight.
  • They slowly, methodically stripped out the "monster files" and replaced them with the organized, hook-based system you see today.
  • They made the painful decision to break old add-ons so that the platform could actually survive into the 2020s.
The "What If"

If osCommerce had modernized its architecture in 2010 instead of sticking to the "junk drawer" style, it might still be the dominant player in the e-commerce world today. Instead, that reluctance to change allowed other platforms (like WooCommerce, Shopify, and Magento) to grow and eventually capture most of the market.

--

You are now looking at the result of that transition.

Phoenix is effectively what osCommerce could have been if it had been willing to evolve.


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