Proxy Opencart

Opencart error: Notice: Undefined property: Proxy::getLabels in /htdocs/storage/modification/system/engine/action.php on line 79

If you get an error like above then find the “getLabels” in your opencart directory and you can find two places like:

public function getLabels()
{

Or something like below of model reference or controller reference

$this->model_extension_module_outofstock->getLabels();

If it is model then check the class name of the model, for our example it should be like below:

class ModelExtensionModuleOutOfStock extends Model
{

Once you correct the class name then the proxy issue will be removed.

The main method is at system/engine/proxy.php

public function __call($key, $args) {
	$arg_data = array();
	
	$args = func_get_args();
	
	foreach ($args as $arg) {
		if ($arg instanceof Ref) {
			$arg_data[] =& $arg->getRef();
		} else {
			$arg_data[] =& $arg;
		}
	}
	
	if (isset($this->{$key})) {		
		return call_user_func_array($this->{$key}, $arg_data);	
	} else {
		$trace = debug_backtrace();
		
		exit('<b>Notice</b>:  Undefined property: Proxy::' . $key . ' in <b>' . $trace[1]['file'] . '</b> on line <b>' . $trace[1]['line'] . '</b>');
	}
}

Hope this helps someone, let us know if you have any questions or issues so that we try to solve it. We have listed out errors that you may get in Opencart and their solutions at:

LEAVE A REPLY

Please enter your comment!
Please enter your name here