Zen Cart Logo
Forums / General Questions / Reference data from one table to include it in the output to Authorize.net

Reference data from one table to include it in the output to Authorize.net

Views: 487

Results 1 to 1 of 1
16 Mar 2015, 2:33 PM
#1
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Reference data from one table to include it in the output to Authorize.net

I use access/sql queries to extract data that I need from our zen tables but have found the need to replicate one within the zen php files.

I have installed snap affiliates which gives me a table called commission. What I need to replicate in the php file is this:

IIf((orders.customers_acct_code = "") And (commission.commission_referrer_key = "CNWR_123") And (orders.delivery_state = "NC"), "TX987", IIf((orders.customers_acct_code = "") And (commission.commission_referrer_key = "CNWR_123") And (orders.delivery_state <> "NC"), "TX123", IIf((orders.customers_acct_code = "") And (orders.delivery_state = "NC"), "NC987", IIf((orders.customers_acct_code = "") And (orders.delivery_state <> "NC"), "NC123", orders.customers_acct_code)))) & "','"

GOAL: I need to append the result of the above to the output of 'x_last_name' => in /includes/modules/payment/authorizenet_aim.php (example: TX987 Johnson)

I keep going around and around on how to achieve this in php so my first question is should everything I need to do be contained within the authorizenet_aim.php file or do I need to add a function to includes/classes/order.php joining my commission table to the orders table as well as a php version of my above statement to authorizenet_aim.php

Thanks