I have been running this module for about a year and actually using it to charge a surcharge for credit cards. I have only just discovered that it has a problem.
I get a similar error, it seems that this is old code adapted from OS Commerce.
I have only just got around to setting up Gift certificates and that's the only time I have found a problem with this order payment module. Here's my error:
Fatal error: Call to a member function on a non-object in /hsphere/local/home/waycool/waycool.com.au/includes/modules/order_total/ot_payment.php on line 92
I hope somebody can help with a fix because I can't get the gift certificates up and running until this is sorted.
Here is what I think is the offending code.
// Check if gift voucher is in cart and adjust total
$products = $_SESSION['cart']->get_products();
for ($i=0; $i<sizeof($products); $i++) {
$t_prid = zen_get_prid($products[$i]['id']);
$gv_result = $db->Execute("select products_price, products_tax_class_id, products_model from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'");
//$gv_result = zen_db_fetch_array($gv_query);
if (ereg("^GIFT", addslashes($gv_result->fields['products_model']))) {
$qty = $cart->get_quantity($t_prid);
$products_tax = zen_get_tax_rate($gv_result->fields['products_tax_class_id']);
if ($this->include_tax =='false') {
$gv_amount = $gv_result->fields['products_price'] * $qty;
} else {
$gv_amount = ($gv_result->fields['products_price'] + zen_calculate_tax($gv_result->fields['products_price'],$products_tax)) * $qty;
}
$order_total=$order_total - $gv_amount;
}
}
Cheers all,
Gruntre69
WayCool
Zen is Way Cool too!