Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Image not displaying


Guest

Recommended Posts

Hi,

 

I've got an image not loading on my website and i can't find out why or where the image code is to change it or check that it is correct.

 

Please have a look here to see my site so far. The new products for November box heading is not displaying 2 images for some reason. (please view using IE as this will show the error on loading images icon).

 

I have configured the stylesheet.css for the box and the background image which is blue is loading so i can only think that the 2 images not loading are the old left and right corner boxes on the default design. I can't find where i would have to change this so if soeone could point me in the right direction i would be so happy as i have spent the last few days searching and getting frustrated not being able to fix this problem.

 

Also I have been looking for the old oscommerce.pdf documentation file, if someone knows how to get hold of this again please let me know. When i go to documentation on oscoommerce site i get the html version now and would prefer the pdf version.

 

Anyway, thanx in advance

Link to comment
Share on other sites

the url of these images is a bit strange too:

/images/images/product_listing_header.gif

 

I would look for these image referrers in the file includes/modules/new_products.php

 

it is called after:

  $info_box_contents = array();
 $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

 new contentBoxHeading($info_box_contents);

but perhaps that is the rude way of changing that code.

Link to comment
Share on other sites

Hi,

 

Thanks for the replies.

 

First thing is the URL for the image is strange as /images/images/product_listing_header.gif does not exist, it should be images/product_listing_header.gif

 

I have pasted the code below if it is of any help. If you cant see anything wrong could it have something to do with my set up in dreamweaver? Reason i ask is becuase i uploaed the site made relevent changes then lost all data on my local machine so had to get all of the information from the hosting server and work on the remote copy as the local copy was lost. Don't know if this would have affected it at any point.

 

This is the detail in my style sheet.

 

TD.newproductscontentheader {
background-image: url('images/product_listing_header.gif');
background-repeat:repeat-x;
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
font-weight:bolder;
color:#FFFFFF;
padding: 0 0 0 5px;
}

 

and this, but i don't know if this style effects this box anyway???

 

.productListing-heading {
 font-family: Verdana, Arial, sans-serif;
 font-size: 10px;
 background-image:url('images/product_listing_header.gif');
 color: #FFFFFF;
 font-weight: bold;
}

 

This is my code for the includes/modules/new_products.php

 

<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

 new contentBoxHeading($info_box_contents);

 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }

 $row = 0;
 $col = 0;
 $info_box_contents = array();
 while ($new_products = tep_db_fetch_array($new_products_query)) {
$new_products['products_name'] = tep_get_products_name($new_products['products_id']);
$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

$col ++;
if ($col > 2) {
  $col = 0;
  $row ++;
}
 }

 new contentBox($info_box_contents);
?>

Link to comment
Share on other sites

you could try and remove one instance of images/ and see if that works.

Even though I think it should be correct as is in the style sheet.

 

You could also edit the products_new.php file and hardcode the layout there.

That last is most simple (since the layout of that particalar part could no longer be defined elsewhere)

but less neat.

It is a solution I took in some instances to not have to alter a non osc stylesheet, or to have to inlude a second stylesheet

Link to comment
Share on other sites

PROBLEM SOLVED

 

This is how i fixed it incase anyone else has the same problem.

 

The stylesheet.css and new_products.php files were correct. It was anotehr file which was wrong.

 

This was the file with the wrong URL

 

INCLUDES/CLASSES/BOXES.PHP

 

old code:

$info_box_contents = array();
  $info_box_contents[] = array(array('params' => 'height="14" class="newproductscontentheader"',
									 'text' => tep_image(DIR_WS_IMAGES . 'images/product_listing_header.gif')),
							   array('params' => 'height="14" class="newproductscontentheader" width="100%"',
									 'text' => $contents[0]['text']),
							   array('params' => 'height="14" class="newproductscontentheader"',
									 'text' => tep_image(DIR_WS_IMAGES . 'images/product_listing_header.gif')));

  $this->tableBox($info_box_contents, true);
}
 }

 

I did not notice that the the direcetory was already set to look in the images folder so i just had to change the image URL form this ---- 'text' => tep_image(DIR_WS_IMAGES . 'images/product_listing_header.gif')

 

to this ---- 'text' => tep_image(DIR_WS_IMAGES . 'product_listing_header.gif')

 

Thanks to jdvb and the_bear for the help as without there comments i wouldnt have even looked at this file to see it something was wrong here.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...