Hi all,

Currently i'm implement a e-commerce website using Drupal 7 + commerce. To customize the teaser, I have install contemplate. But the problem is i don't know the variable for the image..

Previously when using D6, the variable is
$node->field_image_cache[0]['view']

but for D7, seems like I can't find proper variable for it.

$node->content['product:commerce_price']['#object']->field_images['und'][0]['fid']
4
$node->content['product:commerce_price']['#object']->field_images['und'][0]['alt']
red
$node->content['product:commerce_price']['#object']->field_images['und'][0]['title']
sofa
$node->content['product:commerce_price']['#object']->field_images['und'][0]['uid']
1
$node->content['product:commerce_price']['#object']->field_images['und'][0]['filename']
elk 1494 FL-9560.jpg
$node->content['product:commerce_price']['#object']->field_images['und'][0]['uri']
public://elk 1494 FL-9560_0.jpg
$node->content['product:commerce_price']['#object']->field_images['und'][0]['filemime']
image/jpeg
$node->content['product:commerce_price']['#object']->field_images['und'][0]['filesize']
362419
$node->content['product:commerce_price']['#object']->field_images['und'][0]['status']
1
$node->content['product:commerce_price']['#object']->field_images['und'][0]['timestamp']
1306912190

Hope someone can give me a direction. Thanks.

Comments

Did you find the resolution to this?

yes, but i can't reply u now as I forgot the syntax and I can't access the source now...

thanks maxchock.. I found granular control w. the display module.. http://drupal.org/project/ds very useful..

this is the image:

$node->content['product:commerce_price']['#object']->field_images['und'][0]['uri']
public://elk 1494 FL-9560_0.jpg

but you have to format it like this:
$theimage = file_create_url($node->field_images['und'][0]['uri']);

you will get the path to image.