elton123 Posted April 4, 2008 Posted April 4, 2008 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
ohioman Posted April 4, 2008 Posted April 4, 2008 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
elton123 Posted April 5, 2008 Author Posted April 5, 2008 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?
gandalf458 Posted April 5, 2008 Posted April 5, 2008 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.
elton123 Posted April 6, 2008 Author Posted April 6, 2008 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.