Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

whats_new.php


elton123

Recommended Posts

Posted

Hi

 

In column_right, whats_new.php have the following coded:

'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $whats_new_price);

 

How can this be changed to show for example 3 products?

 

Any help will be greatly appreciated.

 

Regards

 

Elroy

Posted

Hmmmm.. well let's see here. Haven't had my coffee yet this morning, but your code seems to display 1 random product with image and price that is clickable to show it in your product_info.php page. Therefore, if I wanted 3 images... I would use this code 2 more times where I wanted the other 2 products to show up. Should work without a hitch. You just have to decide how you want them.

 

Iceman :thumbsup:

 

Hi

 

In column_right, whats_new.php have the following coded:

'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $whats_new_price);

 

How can this be changed to show for example 3 products?

 

Any help will be greatly appreciated.

 

Regards

 

Elroy

Posted
Hmmmm.. well let's see here. Haven't had my coffee yet this morning, but your code seems to display 1 random product with image and price that is clickable to show it in your product_info.php page. Therefore, if I wanted 3 images... I would use this code 2 more times where I wanted the other 2 products to show up. Should work without a hitch. You just have to decide how you want them.

 

Iceman :thumbsup:

Well, let just say I do this, what happens if three images are displayed and all three are the same?

Posted
Well, let just say I do this, what happens if three images are displayed and all three are the same?

 

Well, you could check that the second random product isn't the same as the first and if it is select another random product and repeat that till it's not the same. Similarly with the 3rd.

Posted
Well, you could check that the second random product isn't the same as the first and if it is select another random product and repeat that till it's not the same. Similarly with the 3rd.

Perhaps I should make it a bit more clear as to what I want:

 

I need three "New Products" images to be displayed on my website in column_right.php. Currently the code in whats_new.php generates only 1 random image. By simply copying this statement twice will indeed result in three random images being displayed. However, doing it like this means the exact three images might be displayed and I don't want it. I need three different images to be displayed. I would think this would involved a bit of: if ($expression) { coding

 

Regards

 

Elroy

Archived

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

×
×
  • Create New...