Adding Customer email address to order listing page
HI,
I am trying to code in an additional link on the orders listing page to email a customer.
Everything so far is working fine, I have produced the mailto coding which includes a set subject and signature for the message and have included the order ID and various other things in.
Unfortunately I am struggling to draw the customers email address from the database in order to send the email (obviously a major flaw!)
I have attempted the following so far with no luck:
$customers->fields['customers_email_address']
$orders->fields['customers_email_address']
$orders->fields['orders_id']
$order->customer['email_address']
I feel it should be obvious but I'm not managing it.
Any help would be much appreciated!
Thanks
Sam
Re: Adding Customer email address to order listing page
Um ... if you click on a given order, then there will be an "Email" button in the sidebox ... making it easy to send an email to them.
Re: Adding Customer email address to order listing page
Thanks,
Unfortunately I don't have this option in the sidebox for some reason. I have Details, Invoice, Shipping Label, Packing Slip and delete, even so it would still be an extra click for every message which I am trying to avoid.
I can go through to the order details page and click email from there but it would be a million times easier if i could do it off the orders listing page. Just need to know what part of the database its in so I can use that little bit of code to pull up the customers address.
Sam
Re: Adding Customer email address to order listing page
Oh, my bad. The email button does only appear when viewing the order.
As to your custom coding, the information is in the customers_email_address field of the orders table. You'll have to retrieve that field data in your query and then use it for preparing your link.
Re: Adding Customer email address to order listing page
So $orders->fields['customers_email_address'] should work? or am I missing something equally as obvious?
Re: Adding Customer email address to order listing page
I would expect that to work, provided you're dealing with the code in the listing, and not sideboxes or the currently-clicked-on order.
Re: Adding Customer email address to order listing page
Unfortunately thats not working. Not producing and error but not bringing up the email address either!