Hi there,
I've spent hours trying to figure out how to echo custom cck fields (content type->product) into the customer invoice.
These fields are e-mail (field_contact_email) and phone number (field_contact_phone) for partner activity providers i sell services from. They are hidden fields (the user should not see them before he purchases a product) and i would like to display this info on the invoice, so the user can arrange bookings with the provider.
I was able to do this in drupal 6 with the following code in the invoice template:
foreach ($order->products as $product) {
$nid = ($product->nid);
$noderef = node_load($nid);
echo $product->title .' : '.$noderef->field_contact_email[0]['value'];
echo ' // ' .$noderef->field_contact_phone[0]['value'];
echo "<br />";
The same code doesn't work ini drupal 7. No error message, but no filed output either :(
I know d7 has another way of printing fields and i tried something like print render ($content['field_contact_mail']); but nothing comes up either.
If someone could explain me how i can get custom cck fields rendered in the order invoice, i'd really appreciate.
Have a nice day!
Simon
Comments
Comment #1
tr commentedNothing to do with Ubercart ... but you can print it like this:
echo $noderef->field_contact_email[$noderef->language][0]['value'];