Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I'm stil pretty new to Drupal Commerce and I've run into a small issue with something that has worked for me in the past. I'm working on a custom Product Display node template and I'm wanting to get just the URL of the image in the image field. Right now I'm rendering the image with:

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

In the past I have generated just the image field URL with the following code:

<?php echo file_create_url($node->field_image['und'][0]['uri']); ?>

However, modifying that to call product:field_image results in a total page error. Does anyone know the proper syntax to generate just the URL of the product image field?

share|improve this question
Brad, did you find an answer to your question? I would love to know how you modified your code to make it work as I have the same issue. Thanks!! – Daniel Barber May 30 at 15:42
Have you checked Image URL Formatter module? [drupal.org/project/image_url_formatter] Perhaps it's easiest that way. – Federico Arena May 30 at 20:29

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.