Tags/topics: 
1
Answers
Vote up!
0
Vote down!

Display Product Creator in node.tpl.php file.

You can use the following in a node.tpl.php file to customise the display of product display pages:

<?php
 
print render($content['product:field_primary_image']);
?>

<?php
 
print render($content['product:commerce_price']);
?>

What code do you need to use display the creator of the product?

(I know how to display the author of product display node, but not the creator of the actual product).

Asked by: big_smile
on June 22, 2012

1 Answer

Vote up!
1
Vote down!

1. Download and install http://drupal.org/project/devel and http://drupal.org/project/commerce_devel

2. Go to a Product Display Node that is in your question

3. Click "Devel" and view the array. Pictured below.

https://www.evernote.com/shard/s218/sh/6295dd49-9a97-4730-b083-65546e6dc...

4. It should be something like this:

<?php
foreach ($node->field_product as $product) {
 
$product_user = user_load($product['uid']['#value']);
  echo
$product_user['name'];
}
?>
Josh Miller
Answer by: Josh Miller
Posted: Jul 6, 2012