Digging into the guts of OSCommerce is hardly what I would recommend for an example. That would put you off for life. OSCommerce is a decent little package, especially for the price, but it is a good example of how not to write PHP.
I suggest you look at Smarty. You build your page blank...