christiansees Posted August 11, 2005 Posted August 11, 2005 Hello All, I am trying to have large image display our product of the day. I would like this to display in two areas. First on the splash page, this part seems pretty simple. Just edit cataloge/index.php and include the code <tr><!--the line below is the one you edit to change the link of the Splash image change \|/ only the id number--> <td><?php echo '<p><a href="' . tep_href_link('product_info.php', 'cPath=1&products_id=1430') . '"><img src="images/splash.jpg" alt="Click to buy" name="../images/splash" width="400" height="200" border="0" id="../images/splash"></a></p>'; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> after the customer greeting. Is that right? The second is escapes me. I would like to have the same link as above display when some one clicks on a category that has subcategories, and instead of the subcategories displaying in the center colum I would like the above link. Can anyone tell which code to change? thanks Christian On your last day only you will have to approve or disaprove of how your life has been.
♥Monika in Germany Posted August 11, 2005 Posted August 11, 2005 index.php, find this and comment it out completely, and where it was put it your new pic if (isset($cPath) && strpos('_', $cPath)) { // check to see if there are deeper categories within the current category $category_links = array_reverse($cPath_array); for($i=0, $n=sizeof($category_links); $i<$n; $i++) { $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'"); $categories = tep_db_fetch_array($categories_query); if ($categories['total'] < 1) { // do nothing, go through the loop } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); break; // we've found the deepest category the customer is in } } } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); } $number_of_categories = tep_db_num_rows($categories_query); $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
christiansees Posted August 11, 2005 Author Posted August 11, 2005 Vielen Dank Monika, Your store looks so good I could just eat it up. Christian On your last day only you will have to approve or disaprove of how your life has been.
christiansees Posted August 11, 2005 Author Posted August 11, 2005 Quick follow up questions, One this will not prevent subcategories from displaying in the categories box. Two do I leave in the line $new_products_category_id = $current_category_id; which was not mentioned in your code block above? As I read the code this line is needed to track the current category. thanks Again Christian On your last day only you will have to approve or disaprove of how your life has been.
♥Monika in Germany Posted August 11, 2005 Posted August 11, 2005 Quick follow up questions, One this will not prevent subcategories from displaying in the categories box. Two do I leave in the line ? ?$new_products_category_id = $current_category_id; which was not mentioned in your code block above? As I read the code this line is needed to track the current category. thanks Again Christian <{POST_SNAPBACK}> that is needed if you want to display the new items/cat on the bottom of your page ... it will not bother anyone if you do not use it, so I left it in. :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.