I think there are two things wrong in that particular area of code.
First, the process method doesn't take any parameters - this is clearly a regression from converting all controllers process methods to taking $request.
Secondly, I think the code fails because a few lines above it goes into the if(!isset($order_total_modules)) { code. If you look at that, you'll see that the code is intended to handle the case where the $order_total_modules is not set. A new obect is created, however not assiged to $this->zenTotals_.
SO I think the whole method _getZenModules() should look like this:
- Code: Select all
protected function _getZenTotals() {
global $order_total_modules;
if (null == $this->zenTotals_) {
$this->zenTotals_ = $order_total_modules;
if (!isset($order_total_modules)) {
ZMTools::resolveZCClass('order_total');
$this->zenTotals_ = new order_total();
}
if (!isset($GLOBALS['order']) || !is_object($GLOBALS['order'])) {
ZMTools::resolveZCClass('order');
$GLOBALS['order'] = new order();
}
$this->zenTotals_->process();
}
return $this->zenTotals_;
}
My guess is that you are calling this method at some point during the request processing where not all zencart init has been finished. Let me know if this works any better - I've never had any issues (which might be just that few people have tried a lot of customization yet...)