Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
jackhutton CreditAttribution: jackhutton commentedDid you find the resolution to this?
Comment #2
maxchock CreditAttribution: maxchock commentedyes, but i can't reply u now as I forgot the syntax and I can't access the source now...
Comment #3
jackhutton CreditAttribution: jackhutton commentedthanks maxchock.. I found granular control w. the display module.. http://drupal.org/project/ds very useful..
Comment #4
marvzz CreditAttribution: marvzz commentedthis is the image:
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.