Discussions

To customize product display teaser for Drupal 7

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.

Below is a portion of variable that I copy from Contemplate.

$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.

Posted: Jun 6, 2011

Comments