Fatal error

General Support for technical Issues relating to AlegroCart
Post Reply
mekga
Posts: 10
Joined: Sun Dec 09, 2012 5:35 am

Fatal error

Post by mekga » Tue Jan 01, 2013 1:37 am

Good day

I am getting this error:

“Fatal error: Call to undefined method Model_Payment::get_banktrstatus()”

When I enable the Offline Bank Transfer.

Can this be fixed?.

User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: Fatal error

Post by leo » Tue Jan 01, 2013 3:00 am

Open catalog/model/payment/model_payment.php and add

Code: Select all

function get_banktrstatus(){
$result = $this->database->getRows("select * from zone_to_geo_zone where geo_zone_id = '" . (int)$this->config->get('banktr_geo_zone_id') . "' and country_id = '" . (int)$this->address->getCountryId($this->session->get('payment_address_id')) . "' and (zone_id = '" . (int)$this->address->getZoneId($this->session->get('payment_address_id')) . "' or zone_id = '0')");
return $result;
}

mekga
Posts: 10
Joined: Sun Dec 09, 2012 5:35 am

Re: Fatal error

Post by mekga » Tue Jan 01, 2013 3:14 am

leo wrote:Open catalog/model/payment/model_payment.php and add

Code: Select all

function get_banktrstatus(){
$result = $this->database->getRows("select * from zone_to_geo_zone where geo_zone_id = '" . (int)$this->config->get('banktr_geo_zone_id') . "' and country_id = '" . (int)$this->address->getCountryId($this->session->get('payment_address_id')) . "' and (zone_id = '" . (int)$this->address->getZoneId($this->session->get('payment_address_id')) . "' or zone_id = '0')");
return $result;
}




Hi
Thanks for the code.

Can I just copy and past it at the bottom in. Or is there a specific place it must go in.

User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: Fatal error

Post by leo » Tue Jan 01, 2013 3:33 am

Simple copy it after the last function.

mekga
Posts: 10
Joined: Sun Dec 09, 2012 5:35 am

Re: Fatal error

Post by mekga » Tue Jan 01, 2013 12:23 pm

Hi
I am struggling with this now I am getting this error
Fatal error: Call to undefined method Model_Payment::get_banktrstatus()
…………………………………. catalog/extension/payment/banktr.php on line 24


If I understand correctly the problem is in here..

function getMethod() {
if ($this->config->get('banktr_status')) {
if (!$this->config->get('banktr_geo_zone_id')) {
$status = true;
} elseif ($this->modelPayment->get_banktrstatus()) {
$status = true;
} else {
$status = false;
}
} else {
$status = false;
}

$method_data = array();

if ($status) {
$method_data = array(
'id' => 'banktr',
'title' => $this->language->get('text_banktr_title'),
'message' => $this->language->get('text_banktr_message'),
'sort_order' => $this->config->get('banktr_sort_order')
);
}

return $method_data;
}

User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: Fatal error

Post by leo » Tue Jan 01, 2013 12:45 pm


User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: Fatal error

Post by leo » Wed Jan 02, 2013 1:24 am

Just to help you. The end of your /catalog/model/payment/model_payment.php is:

Code: Select all

function get_google_order($orderNumber){
$result = $this->database->getRow("select order_reference, total from order_google where order_number = '" . $orderNumber . "'");
return $result;
	}
}
?>
Change it to

Code: Select all

function get_google_order($orderNumber){
$result = $this->database->getRow("select order_reference, total from order_google where order_number = '" . $orderNumber . "'");
return $result;
}
function get_banktrstatus(){
$result = $this->database->getRows("select * from zone_to_geo_zone where geo_zone_id = '" . (int)$this->config->get('banktr_geo_zone_id') . "' and country_id = '" . (int)$this->address->getCountryId($this->session->get('payment_address_id')) . "' and (zone_id = '" . (int)$this->address->getZoneId($this->session->get('payment_address_id')) . "' or zone_id = '0')");
return $result;
}
}
?>

Post Reply