Zuncan Posted August 16, 2005 Share Posted August 16, 2005 Hi! I have a tricky question. Lets say that a customers comes in to my store thru a link in some kinda forum. The link in that forum points directly to a product in my store. But if that product is removed from my store, the only thing the customer will see is a text saying "No product could be found". Isn't there a way to instantly redirect the customer to the first main page of the store, instead of displaying this dull meassage? Would be more than greatful for a solution to this problem. Be well / Zuncan So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
wheeloftime Posted August 16, 2005 Share Posted August 16, 2005 Hi! I have a tricky question. Lets say that a customers comes in to my store thru a link in some kinda forum. The link in that forum points directly to a product in my store. But if that product is removed from my store, the only thing the customer will see is a text saying "No product could be found". Isn't there a way to instantly redirect the customer to the first main page of the store, instead of displaying this dull meassage? Would be more than greatful for a solution to this problem. Be well / Zuncan <{POST_SNAPBACK}> You can add if ($product_check['total'] < 1) { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } just underneath $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); and the customer will be redirected to your main page without intermediate screen. Link to comment Share on other sites More sharing options...
ukgoods Posted August 16, 2005 Share Posted August 16, 2005 You can add if ($product_check['total'] < 1) { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } just underneath $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); and the customer will be redirected to your main page without intermediate screen. <{POST_SNAPBACK}> What file is this query in? Thanks, Donna Gordon Link to comment Share on other sites More sharing options...
wheeloftime Posted August 16, 2005 Share Posted August 16, 2005 What file is this query in? Thanks, Donna Gordon <{POST_SNAPBACK}> That's in (catalog)/product_info.php. Almost at the beginning. Link to comment Share on other sites More sharing options...
Zuncan Posted August 17, 2005 Author Share Posted August 17, 2005 Thx for your help wheeloftime! So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
Wendy James Posted August 17, 2005 Share Posted August 17, 2005 There is also a nice little contribution that puts Item not found but... Quote from the description if we cannot find the product we check if it is still in the database and what category it belonged to. If it is, we display the other products from that category using the product_listing module. If it is really gone or never existed in the first place we mess a little with the given product_id and display products with a variation on the number, a desperate move but we have little else to go on. http://www.oscommerce.com/community/contributions,2821 Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.