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