If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / add customers email address to variables in account history

add customers email address to variables in account history

Started by delia on 8 Aug 2013, 4:41 PM · Views: 692

Results 1 to 3 of 3
8 Aug 2013, 4:41 PM
#1
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Post #1 by delia

I need to have the customer's email address as a variable in account history when displaying the order info.

I have added this to the header

$history_query_raw = $db->bindVars($history_query_raw, ':customers_email_address', $customers_email_address, 'string');

and added in the customers email address in the query:

SELECT o.orders_id, o.date_purchased, o.delivery_name, o.customers_email_address,

                               o.billing_name, ot.text as order_total, s.orders_status_name

                        FROM   " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s

                        WHERE      o.customers_id = :customersID     
AND		   o.customers_email_address= :customers_email_address    etc

However, I cannot not get that variable to display on the page to prove it's working

echo 'this is the email address' .$customers_email_address;

after the order info and before the order history as show here: http://awesomescreenshot.com/0b21l665db

Is the way I'm doing this the right path? Have I missed a step or do I have to do this another way?

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

8 Aug 2013, 5:18 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

delia:

I have added this to the header

$history_query_raw = $db->bindVars($history_query_raw, ':customers_email_address', $customers_email_address, 'string');

> **delia:**
>
> and added in the customers email address in the query:
> ```
SELECT o.orders_id, o.date_purchased, o.delivery_name, [B]o.customers_email_address,[/B]

That's the only change you need.

delia:

echo 'this is the email address' .$customers_email_address;

(obviously substituting $result for whatever var was actually used for the db->Execute)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Aug 2013, 6:36 PM
#3
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Post #3 by delia

So I was over thinking it! Thanks! It's now working.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo