I have this code in uc_order-customer.tpl.php

<?php 
$uc_thumbnail_image = $result['node']->field_image_cache[0];
$thumbnail = theme('imagecache', 'cart', $uc_thumbnail_image['filepath'], $uc_thumbnail_image['data']['alt'], $uc_thumbnail_image['data']['title']);
?>
 <?php print $thumbnail; ?>

This does not print thumbnails. In invoice print view. While viewing the invoice broken image link shows http;//www.mysite.com/sites/default/files/imagecache/cart/, full image link to that specific product jpg.

Thanks for your time.

Comments

joshua.stout’s picture

v

jvizcarrondo’s picture

Werushka unfortunately your $result['node']->field_image_cache[0] not returning a valid image, I believe return NULL value. Usually image_cache returns the preset folder when this happens. This may be because $result['node'] is a node without all data or you user can't see this.
you can do this test:

<?php
$uc_thumbnail_image = $result['node']->field_image_cache[0];
if (!is_file($uc_thumbnail_image['filepath'])) {
  print "is not a valid image";
}
else {
  $thumbnail = theme('imagecache', 'cart', $uc_thumbnail_image['filepath'], $uc_thumbnail_image['data']['alt'], $uc_thumbnail_image['data']['title']);
  print $thumbnail;
}
?>

this code work in my standard uc_order-customer.tpl.php

<?php
foreach ($order->products as $product) {
  $context['subject']['node'] = node_load($product->nid);
  print theme(
    'imagecache', 
    'cart', $context['subject']['node']->field_image_cache[0]['filepath'], 
    $context['subject']['node']->field_image_cache[0]['data']['alt'], 
    $context['subject']['node']->field_image_cache[0]['data']['title']
  );
}
?>

you need to be sure $result['node'] is correct
Juan

werushka’s picture

done some editing and it is working thanks. You can send message for the payment info (paypal email)

summit’s picture

Hi,
Could you show your edited code please?
Thanks à lot in advance,
Greetings, Martijn

VikrantR’s picture

Hi jvizcarrondo,

Thank you for this post. It helps me. :)

Vikrant R

chathurank’s picture

Thank you very much jvizcarrondo for your code snippet. It's really help me a lot.
Thanks again...