I am customizing Zen Cart 1.3.8a in the admin area. My goal is to display the customers_referral field into the invoice page in the admin area. I wanted this in the super_invoice.php page but even tried it in the regular invoice.php page without success.
I need an extra set of eyes to see what I did wrong. I created a call (between the lines below) which I assume would return the customer's customers_referral field for a particular order.
If I echo the $customers_ref, I get "Object" rather than the customer's referral string. If there is a simple way to insert the referral code on each invoice, I'd be glad to scrap this and try something different. Any help appreciated!
################################################################################
// Find Referrer
$customers_ref = $db->Execute("SELECT customers.customers_id, customers.customers_referral, orders.customers_id, orders.orders_id
FROM " . TABLE_CUSTOMERS . "
LEFT JOIN " . TABLE_ORDERS . "
ON customers.customers_id = orders.customers_id
WHERE orders.orders_id = '" . $oID . "'
");
if ($customers_ref->fields['customers_referral'] = '') {
$customers_referral = 'empty';
}
else {
$customers_referral = $customers_ref;
}
- - - snipped to body - - -
<?php echo $customers_referral; ?>
################################################################################
Regards,
Jim Smith
Bookmarks