Page 1 of 1

correcting pp_express code in 2.0.3.1

Posted: Wed Feb 08, 2017 3:54 am
by yorkshireboy
I've got pp_express working on my site by deleting out the lines which related to options

Occasionally however I get the below error - anyone know how I fix this, or what it means?

Undefined variable: payment_address in web/catalog/controller/payment/pp_express.php on line 682

Re: correcting pp_express code in 2.0.3.1

Posted: Wed Feb 08, 2017 4:39 am
by thekrotek
It means, that payment_address variable is missing from some array. You can simply try to ignore it, if it doesn't break anything for you.

Re: correcting pp_express code in 2.0.3.1

Posted: Wed Feb 08, 2017 5:30 am
by yorkshireboy
This is the code from the file referenced:

Code: Select all

		foreach ($results as $result) {
			if ($this->config->get($result['code'] . '_status')) {
				$this->load->model('payment/' . $result['code']);

				$method = $this->{'model_payment_' . $result['code']}->getMethod($payment_address, $total);
A couple of lines before is this code - which I believe is where payment_address is defined

Code: Select all

if ($this->customer->isLogged() && isset($this->session->data['payment_address_id'])) {
			$this->load->model('account/address');
			$payment_address = $this->model_account_address->getAddress($this->session->data['payment_address_id']);
		} elseif (isset($this->session->data['guest'])) {
			$payment_address = $this->session->data['guest']['payment'];
I think this would explain why it only happens sometime - as if I'm understanding it correctly then the definition is linked to if the user is logged into their account.

Does this help - any further suggestions to help me follow this error through?

Re: correcting pp_express code in 2.0.3.1

Posted: Sat Feb 18, 2017 4:44 pm
by yorkshireboy
Does anyone have instructions for how to use pp_express in OC2.0.3.1 without filling the error log everytime someone uses it?

Transactions process OK - just with errors being reported.

Errors are all undefined index or variables

All help appreacited