Page 1 of 1
Fatal error
Posted: Tue Jan 01, 2013 1:37 am
by mekga
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?.
Re: Fatal error
Posted: Tue Jan 01, 2013 3:00 am
by leo
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;
}
Re: Fatal error
Posted: Tue Jan 01, 2013 3:14 am
by mekga
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.
Re: Fatal error
Posted: Tue Jan 01, 2013 3:33 am
by leo
Simple copy it after the last function.
Re: Fatal error
Posted: Tue Jan 01, 2013 12:23 pm
by mekga
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;
}
Re: Fatal error
Posted: Tue Jan 01, 2013 12:45 pm
by leo
Re: Fatal error
Posted: Wed Jan 02, 2013 1:24 am
by leo
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;
}
}
?>