
Originally Posted by
DrByte
Second, every function starts clean, and knows nothing about any other variables outside itself. That's just how PHP has always worked. Each function is its own scope. The only way to get around that is to pass parameters to it or to global certain variables, and using global is an older convention only applicable to procedural code, whereas PHP is headed towards object-oriented code instead.Yes, as I said, unless you're ON the shopping cart page when the payment module is instantiated and called, none of the shopping cart data is available to you anyway.
If you want to mimic similar behavior you'll have to copy and duplicate the code to do that.