Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Image in shopping cart


Guest

Recommended Posts

Is there a way to add a thumb nail image of the product item to the shopping basket. So you basket looks like this:

 

Remove QTY. "Image" Product Name Total

Link to comment
Share on other sites

You could edit /includes/modules/order_details.php and look at the <td> sections for each peice shown.

 

Then do a quick select of the products_image for the product and display it similar to the product_info or product_listing

Link to comment
Share on other sites

echo tep_image(DIR_WS_IMAGES . $product_info_values['products_image'], $product_info_values['products_name'], 50, 50);

 

I inserted this code and the image is missing. It does display the area where the image should go but there is no image.

Link to comment
Share on other sites

echo tep_image(DIR_WS_IMAGES . $product_info_values['products_image'], addslashes($product_info_values['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) ;

 

 

I placed this code around line 60 in the order_details.php file.

 

This code does not work. It doesn't display the image, just an emty image area where the image is suppose to go.

 

So Does anyone know what code to use or what I am missing.

 

Thanks for the help

Link to comment
Share on other sites

I added this to order_details.php

 

for ($i=0; $i<sizeof($products); $i++) {

 echo '  <tr>' . "n";

   $my_products_id= $products[$i]['id'];

   $my_products_image= tep_get_my_products_image($my_products_id);

   echo '    <td align="center" valign="top">';

   echo tep_image(DIR_WS_IMAGES . $my_products_image, '' , SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);

   echo '    </td>' . "n";

 

Then I added the function ... somewhere like general.php or your fav function file:

 

////

// Return a product's image

// TABLES: products

function tep_get_my_products_image($product_id) {

   $product_normal_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . $product_id . "'");

   $product_normal = tep_db_fetch_array($product_normal_query);

   return $product_normal['products_image'];

 

You will have to decide your sizes for these.

Link to comment
Share on other sites

One more try here :D

 

This is a lot cleaner code and you do not have to play with adding new columns in order_details.php

for ($i=0; $i<sizeof($products); $i++) {

 echo '  <tr>' . "n";

// BOF: WebMakers.com Added: Display Product Image at 50%

   $my_products_id= $products[$i]['id'];

   $my_products_image= tep_get_my_products_image($my_products_id);



// Delete box only for shopping cart

 if (strstr($PHP_SELF, FILENAME_SHOPPING_CART))

   echo '    <td align="center" valign="top">' . tep_image(DIR_WS_IMAGES . $my_products_image, '' , SMALL_IMAGE_WIDTH*.50, SMALL_IMAGE_HEIGHT*.50) . '<input type="checkbox" name="cart_delete[]" value="' . $products[$i]['id'] . '"></td>' . "n";

// EOF: WebMakers.com Added: Display Product Image at 50%

Link to comment
Share on other sites

  • 2 years later...
  • 1 month later...
  • 1 year later...

Thanks in advanced for your help

 

could someone please tell how this is done today with the newer versions missing orders_details.php ?

 

Does anyone know how to do this?

Link to comment
Share on other sites

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...