Originally Posted by
HammurIT
Issue resolved. Many thanks for your help.
When I looked at the database directly the table was names zen_utp. The code used to create was CREATE TABLE IF NOT EXISTS `utp` and the creation was run via the install sql patch option in zen cart. So this must have named the table "zen_utp". I dropped this table, and then created the table directly in the database and it all worked.
Glad to see that it has been resolved!
That's an indication that the program (installation?) does not support DB_PREFIX which technically could be easily fixed, but unfortunately the plugin needs revision...
Two ways it looks to resolve in includes/modules/payment/utp.php:
Consideration 1) the preferred way is to have a define for TABLE_UTP such that it is defined as DB_PREFIX . 'utp'
Code:
define('TABLE_UTP', DB_PREFIX . 'utp');
and that would basically be substituted as follows:
would replace would replace the define might work in the __contstruct() function possibly as:
Code:
if (!defined('TABLE_UTP')) {
define('TABLE_UTP', DB_PREFIX . 'utp');
}
but it is more consistent to place a file in each of the includes/extra_datafiles and admin/includes/extra_datafiles to provide the definition without the if statement...
Consideration 2) modify the following line:
Code:
zen_db_perform('utp', $form_response_array);
to be:
Code:
zen_db_perform(DB_PREFIX . 'utp', $form_response_array);
and in the function admin_notification:
Code:
$sql = "SELECT * FROM utp WHERE zen_order_id = '$zf_order_id'";
Change to:
Code:
$sql = "SELECT * FROM " . DB_PREFIX . "utp WHERE zen_order_id = '$zf_order_id'";
in functions _doCapt and _doRefund:
Code:
$transaction_info = $db->Execute("SELECT * FROM utp WHERE zen_order_id = '$oID'");
to:
Code:
$transaction_info = $db->Execute("SELECT * FROM " . DB_PREFIX . "utp WHERE zen_order_id = '$oID'");
Bookmarks