Zen Cart Logo
Forums / General Questions / product image on confirmation page

product image on confirmation page

Locked

Views: 4,381

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
23 Aug 2008, 2:59 AM
#1
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

product image on confirmation page

Hello,
Does anyone know how to put the product image on the confirmation page? I tried this:

<td><div id="cartImage" class="back"><?php echo $order->products[$i]['productsImage']; ?></div></td>

but to no avail, I don't know what is the name of the element to show the image. Can someone help? Thanks.

23 Aug 2008, 3:00 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: product image on confirmation page

The products_image is not something that is, by default, available from the order ... you can, however, use one of the functions to obtain the image for the products based on the products_id from the order ...

In the function file functions_lookups.php is the function:

/*
 * look up a products image and send back the image's HTML \<IMG...\> tag
 */
  function zen_get_products_image($product_id, $width = SMALL_IMAGE_WIDTH, $height = SMALL_IMAGE_HEIGHT) {

See if that doesn't help get you pointed in the right direction ...

23 Aug 2008, 8:24 PM
#3
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: product image on confirmation page

Thank You Linda,
This is what I did from your code:

<td><?php echo zen_get_products_image($order->products[$i]['id'], $width = 39, $height = 40) ?></td>

and it works great! I don't even know what the element name is but I just guessed ['id'] and it worked. This just goes to show the good coding of zen cart where I can just guess the label to get it to work. I wish I knew more of the structure and names, but I eventually will :smile:.

24 Aug 2008, 1:22 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: product image on confirmation page

Thanks for the update and posting what worked for you ... :smile:

10 Nov 2008, 3:56 AM
#5
inkuyo avatar

inkuyo

New Zenner

Join Date:
Sep 2007
Posts:
73
Plugin Contributions:
0

Re: product image on confirmation page

Linda Maybe you can help me. I used the following code to add the product image to my invoice, but it is NOT resizing the image.

Maybe you can shed some light on my errors.

echo '        <td class="dataTableContent" align="center" valign="top">' .zen_image(DIR_WS_CATALOG_IMAGES . zen_get_products_image( $order->products[$i]['id'], $width = SMALL_IMAGE_WIDTH, $height = SMALL_IMAGE_HEIGHT)) . '</td>' . "\n";
10 Nov 2008, 7:01 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: product image on confirmation page

Your syntax is off on the call for the image:

echo '        <td class="dataTableContent" align="center" valign="top">' .zen_image(DIR_WS_CATALOG_IMAGES . zen_get_products_image( $order->products[$i]['id'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)) . '</td>' . "\n";
10 Nov 2008, 2:54 PM
#7
inkuyo avatar

inkuyo

New Zenner

Join Date:
Sep 2007
Posts:
73
Plugin Contributions:
0

Re: product image on confirmation page

I made the small change but the image still does not resize.

I was trying your calling from this thread, http://www.zen-cart.com/forum/showthread.php?t=106016&highlight=products_id.

I would like it to be linked to the small image (currently 100 x 80).

Small enough to be on an invoice, big enough to be seen.

Basically I want to call the order product id and show the image associated with the order.

Thanks,

Dale

10 Nov 2008, 4:43 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: product image on confirmation page

It works fine for me ... what do you have now in your code on the invoice.php using the code that I gave you?

10 Nov 2008, 4:57 PM
#9
inkuyo avatar

inkuyo

New Zenner

Join Date:
Sep 2007
Posts:
73
Plugin Contributions:
0

Re: product image on confirmation page

This is what I have:

// bof image added by inkuyo -->
      echo '        <td class="dataTableContent" align="center" valign="top">' .zen_image(DIR_WS_CATALOG_IMAGES . zen_get_products_image( $order->products[$i]['id'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)) . '</td>' . "\n";
// eof image added by inkuyo <--  

Is there w away to call the image w/o having it nested? I think that is sloppy.

I made the mod for the admin catalog images but I used this code for that:

echo '<br>'. zen_image(DIR_WS_CATALOG_IMAGES . $categories->fields['categories_image'] , SMALL_IMAGE_HEIGHT, SMALL_IMAGE_WIDTH)

The 2nd code did not seem to work though for the invoice. Not totally sure what variables use.

10 Nov 2008, 5:28 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: product image on confirmation page

The code I posted will show the Product Image on the invoice.php

The part that gives the image is:

zen_image(DIR_WS_CATALOG_IMAGES . zen_get_products_image( $order->products[$i]['id'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT))

Where ever you are, if you can identify the valid products_id value whether that is:
$order->products[$i]['id']
$products_id
$_GET['products_id']
etc. etc.

That is giving you the value in the specific file where you want to call the image ...

This is a category image:
$categories->fields['categories_image']

I thought you are trying to get the products_image from the products table ... :unsure:

10 Nov 2008, 5:58 PM
#11
inkuyo avatar

inkuyo

New Zenner

Join Date:
Sep 2007
Posts:
73
Plugin Contributions:
0

Re: product image on confirmation page

Linda ~

I am trying to get the ordered product image to show on the invoice. (in my case super_invoice.php). I get it to show, but the image is NOT resizing.

The code in the last post was from the category side, I also have this code for the product images:

zen_image(DIR_WS_CATALOG_IMAGES . $products->fields['products_image'] , $order->products[$i]['name'], SMALL_IMAGE_HEIGHT, SMALL_IMAGE_WIDTH)

Again, I can get the image to show up, but the image does not resize, even the end user code does not have sizing information.

Also, when I entered it on the invoice.php page the image is still large (I used your code above).

10 Nov 2008, 6:21 PM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: product image on confirmation page

$order->products[$i]['name'] is the name of the Product ... you need to send the value of the products_id ...

Try using what I gave you and use: $order->products[$i]['id']

That should work better for you ... :smile:

If for some reason it does not, look around that area of the code and you should see how the products_id is referred to ...

Also in the Developers Tool Kit in the top input box enter:
SMALL_IMAGE_HEIGHT

select NONE from the dropdown and click SEARCH ...

See what settings you have for:
SMALL_IMAGE_HEIGHT
SMALL_IMAGE_WIDTH

10 Nov 2008, 7:11 PM
#13
inkuyo avatar

inkuyo

New Zenner

Join Date:
Sep 2007
Posts:
73
Plugin Contributions:
0

Re: product image on confirmation page

Here is the code in invoice.php

echo '        <td class="dataTableContent" align="center" valign="top">' .zen_image(DIR_WS_CATALOG_IMAGES . zen_get_products_image( $order->products[$i]['id'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)) . '</td>' . "\n";

Height came back as 80 and width as 100.

I am using the 'id'.

This is the generated code:

<td class="dataTableContent" valign="top" align="center"><img src="http://192.168.0.132/teststore/images/blankets/strawberry%20shortcake%20quilt.jpg" alt="80" title=" 80 " border="0"></td>
10 Nov 2008, 8:31 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: product image on confirmation page

That's because I goofed ... :oops:

See if this doesn't work better for you ...

zen_image(DIR_WS_CATALOG_IMAGES . zen_get_products_image($order->products[$i]['id']), ' ', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);

Type what I "mean" ... not what I say ... :lamo:

10 Nov 2008, 10:03 PM
#15
inkuyo avatar

inkuyo

New Zenner

Join Date:
Sep 2007
Posts:
73
Plugin Contributions:
0

Re: product image on confirmation page

I got it.

only misplacement of the paren and the two apstrophes.

Thanks for your help. My mods will probably be posted at some point.

11 Nov 2008, 4:46 PM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: product image on confirmation page

Thanks for the update ... sorry for the error on that code ... :smile:

2 Aug 2009, 5:08 AM
#17
lasignorina avatar

lasignorina

New Zenner

Join Date:
Jul 2009
Location:
Singapore
Posts:
14
Plugin Contributions:
0

Re: product image on confirmation page

Hi, after I have inserted that line into my invoice.php, only the last item of the oder showed. and it is on the top right hand corner of the invoice instead of appearing beside the product name.

may i know what i have to change to rectify this problem please? thanks!

2 Aug 2009, 5:33 AM
#18
lasignorina avatar

lasignorina

New Zenner

Join Date:
Jul 2009
Location:
Singapore
Posts:
14
Plugin Contributions:
0

Re: product image on confirmation page

I have figured it out thanks!

2 Aug 2009, 5:08 PM
#19
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: product image on confirmation page

What was the solution that worked for you? :smile:

3 Aug 2009, 1:51 AM
#20
lasignorina avatar

lasignorina

New Zenner

Join Date:
Jul 2009
Location:
Singapore
Posts:
14
Plugin Contributions:
0

Re: product image on confirmation page

The same code that you posted for Dale :P