I am using a .phtml file which I pull into the order email I need to use the customer ID inside this .phtml file inside a function to pass back a value to my email, how can I get this information inside this .phtml file? My code is below:
$customerData = Mage::getSingleton('customer/session')->getCustomer();
$customerId = $customerData->getId();
Do I need to be looking at an order collection rather than the customer? If so what is the best way to go about this?
Best Answer
I'm pretty sure you can do the following directly in your email template:
However, it seems like this is not totally what you.
What I suggest you to do is create a custom handle under your module XML file or under your
local.xml
file:Then in your email template you can add the following :
Finally in your
path/to/your/template.phtml
file you can do: