Guest Posted July 15, 2008 Posted July 15, 2008 Hey, I've got one product that I want to sell on my site but do NOT want showing in the catalog on my index page. IE... I'll give some people a direct link to purchase it but don't want the general public to see it for sale. I've seen the separate pricing contrib which looks great however the people who I will be giving hte link to don't have accounts with me yet so they won't be logging in when they look at it so that doesn't work. Basically when my site is pulling the list of products to display in a particular category on index.php, I just want it to exclude one product id from that. That solves it for me cause the general public won't even know the product is there unless I've given them the direct link. My php isn't great and I've had a play around with the statement at the top of index.php to see if I could add in 'and products_id !=44' somewhere but its taking me forever cause I'm not entirely sure on my syntax etc. Does anyone have any ideas what little statement I need to pop in where? I'd be incredibly grateful! Thanks for any suggestions, Rebecca
Guest Posted July 16, 2008 Posted July 16, 2008 Hey, Just in case anyone else ever has this prob... I found a soln that works pretty well for me... Instead of using the regular category listing on the home page, I'm using the main_categories.php contribution by EM-STUDIO.info. I've put the one product I don't want showing into a category with the id 25 and then changed the code to: <!-- main_categories - EM-STUDIO.info//--> <?php $mc_counter = 0; $mc_col = 3; $result = tep_db_query("SELECT * FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.parent_id = '0' AND c.categories_id = cd.categories_id AND cd.categories_id != '25' AND cd.language_id = '" . (int)$languages_id . "' ORDER BY sort_order "); echo '<table cellspacing="5" cellpadding="5" width="100%" bgcolor="#eeeeee">'."\n"; while($data = tep_db_fetch_array($result)){ if($mc_counter == 0){ echo '<tr>'."\n"; } $width = 100/$mc_col; echo '<td width="'.$width.'%" align="center" class="smallText" ><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_path($data[categories_id])) . '">' . tep_image(DIR_WS_IMAGES . $data['categories_image'], $data['categories_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>'.$data['categories_name'].'</td>'."\n"; $mc_counter = $mc_counter+1; if($mc_counter == $mc_col){ echo '</tr>'."\n"; $mc_counter = 0; } } echo '</table>'."\n"; ?> <!-- main_categories_eof //--> It hides the category with the product I want out of sight but shows the others. And the product remains active so I can still give out the diirect link if I want. Obviously people could still find it if they really wanted but that's fine for the purposes I'm using this for. Rebecca
Recommended Posts
Archived
This topic is now archived and is closed to further replies.