Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Full Size images when looking at New Products page


Guest

Recommended Posts

Posted

I have a modified version of OSC and I am trying to fix the problem of the large images showing when you click on the New Products button.

 

What I would like them to be are thumbnails - just like they are when you click on the categories. eg. I only have New Baby uploaded at the minute.

 

Link to site:

http://www.sheilascards.net

 

Link to New Products:

http://www.sheilascards.net/products_new.php

 

Code from products_new.php page:

<?php
/*
 $Id: products_new.php,v 1.27 2003/06/09 22:35:33 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="737" cellspacing="0" cellpadding="0" align="center">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php //echo tep_image(DIR_WS_IMAGES . 'table_background_products_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 $products_new_array = array();

 $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";
 $products_new_split = new splitPageResults($products_new_query_raw, 8);

 if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="smallText"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>
           <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
?>
 <tr>
       <td><table border="0" width="100%"  cellspacing="0" cellpadding="0">
<?php
//if ($products_new_split->number_of_rows > 0) {
  // $products_new_query = tep_db_query($products_new_split->sql_query);
  // while ($products_new = tep_db_fetch_array($products_new_query)) {
    // if ($new_price = tep_get_products_special_price($products_new['products_id'])) {
    //   $products_price = '<s>' . $currencies->display_price($products_new['products_price'], //tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . //$currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>';
   //  } //else {
      // $products_price = $currencies->display_price($products_new['products_price'], //tep_get_tax_rate($products_new['products_tax_class_id']));
   //  }
?>
         <!-- <tr>
           <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image_small'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
           <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
           <td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
         </tr>
         <tr>
           <td colspüan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr> -->
<?php
 if ($products_new_split->number_of_rows > 0) {
   $products_new_query = tep_db_query($products_new_split->sql_query);

$row = 0;
 $column = 0;
   while ($listing = tep_db_fetch_array($products_new_query)) {



     if ($new_price = tep_get_products_special_price($listing['products_id'])) {
       $products_price = '<s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
     } else {
       $products_price = $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']));
     }

  $list_box_contents[$row][$column] = array('name' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . ' " class="products">' .$listing['products_name'].'</a>',
'image' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">'.tep_image(DIR_WS_IMAGES .$listing['products_image']).'</a>',
'price' =>'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '"class=productsmall>Price: '.number_format($listing['products_price'],2).'</a>',

'formaction'=> tep_draw_form('cart_quantity',tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'products_id='.$listing['products_id'].'&action=add_product')),
'details' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">'.tep_image(DIR_WS_IMAGES .'details.jpg').'</a>',    
 'addtocart' => tep_draw_hidden_field('products_id', $listing['products_id']).tep_image_submit('addtocart.jpg',IMAGE_BUTTON_IN_CART),
 'text' =>test );

  $column ++;
     if ($column > 1) {
       $row ++;
       $column = 0;
     }

?>

<?php
   }
new productListingBox($list_box_contents);
 } else {
?>
         <tr>
           <td class="main"><?php //echo TEXT_NO_NEW_PRODUCTS; ?></td>
         </tr>
         <tr>
           <td><?php //echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
<?php
 }
?>
       <!-- </table></td>
     </tr> -->
<?php
 if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
     <?php
 }
?>
<!--  <td width="<?php //echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php// echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0">
</tr>          
</table></td>
-->
<!-- right_navigation //-->

<?php //require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->


 </table></td>
 </tr>
</table>


<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Can anyone see what the problem is?

 

Thanks to anyone who can help me fix this.

Posted

Find this line and change as below.

<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>

 

$products_new['products_image_small'] is not called for in the query that establishes this array. If this does not work then you will need to instead change the query.

My Contributions

 

Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly

Password Protect Admin

"No matter where you go....There you are" - Buccaroo Bonsai

Posted

Hello

 

I checked but what is called is $products_new['products_image_small'] .

 

here is the code:

 

<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image_small'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>

 

any more ideas what I would need to do?

 

Thanks for the reply.

Posted

I still cant seem to work this one out - can anyone please help? I have searched the forums etc - but still nothing. Even if someone can tell me the name of the page where it lists the products when you click on the category name - because that page works - but i dont know the name of the page.

 

Any help at all anyone please?

Posted

The code you showed is for displaying what the query called for. Here is the query

  $products_new_array = array();  $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";  $products_new_split = new splitPageResults($products_new_query_raw, 8);  if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {

If you look it says

select p.products_id, pd.products_name, p.products_image

not select p.products_id, pd.products_name, p.products_image_small

My Contributions

 

Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly

Password Protect Admin

"No matter where you go....There you are" - Buccaroo Bonsai

Posted

Hi Bill

 

Thanks for your help with this, however when I done what you said I got the following error - so i had to change it back. This is the error I got:

 

1054 - Unknown column 'p.products_image_small' in 'field list'

 

select p.products_id, pd.products_name, p.products_image_small, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from products p left join manufacturers m on (p.manufacturers_id = m.manufacturers_id), products_description pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' order by p.products_date_added DESC, pd.products_name limit 0, 8

 

[TEP STOP]

 

Any ideas?

Posted

change this line

<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image_small'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>

to this

<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>

and see if that works

My Contributions

 

Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly

Password Protect Admin

"No matter where you go....There you are" - Buccaroo Bonsai

Posted

Hi Bill

 

Still nothing

 

But I think I have found something - there was no change when I done the change you asked, however - i tried to mess around to see if it was making a difference - changing it to products_image then products_image_small - there was no change - so i done products_imppppppp - to see what would happen (thought it would break) but it STILL looked the same! Tried to refresh etc - but no change.

 

Bit strange this one isnt it?

Posted

it was:

 

width: empty

Height: 80

 

but then tried:

 

width: 40

height: 80

 

still nothing

 

If you are willing to help me I would be happy to let you have FTP to the site if you wanted to play about -if you wanted paid I would be able to give you something for your time.

Archived

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

×
×
  • Create New...