Jump to content

[solved]how to display product image in order history


Recommended Posts

Hi,

 

 

I need ti display product image in order details page when user click order details link.

 

I have edited below code in order-detail.tpl but it not shows product image it shows only some dummy image

 

<td>sfasdfsafsad

<a href="{$link->getProductLink($product.product_id, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'htmlall':'UTF-8'}">

<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')}" alt="{$product.name|escape:'htmlall':'UTF-8'}" {if isset($smallSize)}width="{$smallSize.width}" height="{$smallSize.height}" {/if} /></a>

 

</td>

 

 

i have attached my screenshot .

post-581429-0-20131300-1372765315_thumb.png

Edited by karthick (see edit history)
Link to comment
Share on other sites

You are sure you have uploaded an image for that product? If yes, to solve this problem, you will need to regenerate the images on Prestashop admin area.

 

For all order detail same issue occur. I think my code have error . I am using below code for display image but not showing image any error in below code ?

 

<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')}" >
Edited by karthick (see edit history)
Link to comment
Share on other sites

  • 1 year later...

i know the problem now,

 

public function getImageLink($name, $ids, $type = null)

 

$name can be set to any strings but $product.link_rewrite is NULL,so the image won't display,

 

for example, 

 

/423-small_default/europe-design-restaurants-coffee-bar-waiter-waitress-uniform-shirt-apron.jpg

 

/423-small_default/anysting.jpg

 
will get the same image
Link to comment
Share on other sites

  • 8 months later...
×
×
  • Create New...