Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Thumbnails and enlarged graphics


Master_Roshi

Recommended Posts

Posted

Rather than having a large graphic scaled down (which cause long load times) I decided I wanted to have separate thumnail images. Here's what I hacked/did (in case anyone would like to know).

 

Using MyPHP admin, I added a new column to the table 'products' and named it products_image_lrg

 

I therefore put my thumbnail image in the products_image column, and my full sized graphics in the products_image_lrg column.

 

Warning - for those who only want to work in the oscommerce admin utility, You won't see the added column in the gui. You'll only see the form window for adding the single graphic (I used that for the thumbnail). Like I said, it's a hack and I haven't tried to figure out how to add the new column in the "new products" form.

 

If you decide to continue on... then go on to edit the 'popup_image.php' file

 

within the <body></body> tags (at the base of the page), replace the <?php> code there with this:

 

<?php

 

if (empty ($products['products_image_lrg'])) {

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

} else {

echo tep_image(DIR_WS_IMAGES . $products['products_image_lrg'], $products['products_name']);

}

?>

 

also,

 

 

At, the top of the page, you'll need to add 'p.products_image_lrg' into the $products_query so it looks as follows:

 

$products_query = tep_db_query("select pd.products_name, p.products_image, p.products_image_lrg from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");

 

 

 

Your pop up will display whatever graphic is listed in the 'products_image_lrg' field. And if it is empty, will display whatever is in the standard 'products_image' field.

Posted
Rather than having a large graphic scaled down (which cause long load times) I decided I wanted to have separate thumnail images. Here's what I hacked/did (in case anyone would like to know).

 

Using MyPHP admin, I added a new column to the table 'products' and named it products_image_lrg

 

I therefore put my thumbnail image in the products_image column, and my full sized graphics in the products_image_lrg column.

 

Warning - for those who only want to work in the oscommerce admin utility, You won't see the added column in the gui. You'll only see the form window for adding the single graphic (I used that for the thumbnail). Like I said, it's a hack and I haven't tried to figure out how to add the new column in the "new products" form.

 

If you decide to continue on... then go on to edit the 'popup_image.php' file

 

within the <body></body> tags (at the base of the page), replace the <?php> code there with this:

 

<?php

 

if (empty ($products['products_image_lrg'])) {

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

} else {

echo tep_image(DIR_WS_IMAGES . $products['products_image_lrg'], $products['products_name']);

}

?>

 

also,

At, the top of the page, you'll need to add 'p.products_image_lrg' into the $products_query so it looks as follows:

 

  $products_query = tep_db_query("select pd.products_name, p.products_image, p.products_image_lrg from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");

Your pop up will display whatever graphic is listed in the 'products_image_lrg' field. And if it is empty, will display whatever is in the standard 'products_image' field.

 

there is a multiple images contribution already which does exactly this and more.

Treasurer MFC

Posted
there is a multiple images contribution already which does exactly this and more.

 

"?" Where can I find the multiple images contribution so I can implement it to mine?

  • 2 weeks later...

Archived

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

×
×
  • Create New...