Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Random Product Images on Main Page


mark27uk3

Recommended Posts

Hi Guys,

 

Can anyone tell me what is wrong with this piece of code, it should show a random product with its image but it dont!

 

Is anyone able to enlighten me?

 

<?php echo '<a href="' . tep_href_link FILENAMEE_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $items[$i]['image'], $items[$i]['name'], THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT) . '</a>';
?>

 

Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

I am getting closer (I hope)

 

Now I get a parse error and I cant see why, I have been trying to do this all afternoon.

 

$new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $product_info_values['products_image'])'">' . tep_image(DIR_WS_IMAGES . $product_info_values['products_image'], $product_info_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)'</a>';

 

Will someone please take a look and let me know whats missing.

 

Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

<?php echo '<a href="' . tep_href_link FILENAMEE_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $items[$i]['image'], $items[$i]['name'], THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT) . '</a>';

 

is this piece of code qualified?

[.:2s1000s12:.]

"Did I had the dream, or did the dream had me?"

Link to comment
Share on other sites

You need to post the query associated with these variables to validate that the names match the database field names.

 

Also, look at your source code to see what it s being printed for your image paths.

 

 

Lastly, this piece of code:

 

SMALL_IMAGE_HEIGHT)'</a>';

 

probably might need to look like this:

 

SMALL_IMAGE_HEIGHT).'</a>';

 

Missing the concatenation operator (period).

 

Joey

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...