Zen Cart Logo
Forums / Managing Customers and Orders / How can I add the image of an ordered product?

How can I add the image of an ordered product?

Views: 1,551

Results 1 to 7 of 7
7 Sep 2015, 8:27 PM
#1
alex369 avatar

alex369

New Zenner

Join Date:
Sep 2014
Location:
Italy
Posts:
6
Plugin Contributions:
0

How can I add the image of an ordered product?

Hello,
on my Zen Cart, everytime I receive an order, the system shows me the ID of the ordered product but I would see the picture also. Is there a way to solve this?
Thank you and sorry for my bad english :)

7 Sep 2015, 9:07 PM
#3
alex369 avatar

alex369

New Zenner

Join Date:
Sep 2014
Location:
Italy
Posts:
6
Plugin Contributions:
0

Re: How can I add the image of an ordered product?

Thank you for the answer.
Where can I add this function ( zen_get_products_image($product_id, $width = SMALL_IMAGE_WIDTH, $height = SMALL_IMAGE_HEIGHT) ?
I think had to add the code in the page /admin_root/orders.php. If it helps, this is the page:
http://pastebin.com/em46deZr

8 Sep 2015, 12:15 AM
#4
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

Re: How can I add the image of an ordered product?

alex369:

Thank you for the answer.
Where can I add this function ( zen_get_products_image($product_id, $width = SMALL_IMAGE_WIDTH, $height = SMALL_IMAGE_HEIGHT) ?
I think had to add the code in the page /admin_root/orders.php. If it helps, this is the page:
http://pastebin.com/em46deZr

Where exactly do you want it? Do you want it on the EDIT page, so CUSTOMERS->ORDER->EDIT? Or did you want it on the invoice page?

Yes, it is in the orders.php but I'd want to try it on my test site before I tell you exactly where cause it would also screw up the formatting.

8 Sep 2015, 1:48 AM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How can I add the image of an ordered product?

I would say somewhere between lines 588 and 599 would be where to show the picture associated with the product. At least this is the location I would suggest gather which picture should be displayed and then if to be shown elsewhere (bottom of the page or on a separate location), then so be it. But it is here where the product is individually stepped through and the attributes of the product are "collected". If the image is dependent onthe attributes then need to consider determination as a part of stepping through the attributes, otherwise would want to have the image information only as a part of the loop for the products in the cart...

Beyond that, yeah would want to consider if it is something to be included in the packing list or the invoice depending on how you do business.

8 Sep 2015, 4:28 PM
#7
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
969
Plugin Contributions:
0

Re: How can I add the image of an ordered product?

I added this to orders.php

            if (isset($order->products[$i]['id']) ) {
          $products = $db->Execute("SELECT products_image
                                    FROM " . TABLE_PRODUCTS . "
                                    WHERE products_id ='" . $order->products[$i]['id'] . "'");
          echo '        <td class="dataTableContent" valign="middle">' . zen_image(DIR_WS_CATALOG . DIR_WS_IMAGES . $products->fields['products_image'] , $order->products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>';
        }