DAVID3733 Posted October 2, 2011 Posted October 2, 2011 Hi there I have a Multistore set up that has been modified with quite a few add ons over the years, my problem is duplicate content not with products but with the categories. If a product is in store A and not in store B then store B will return a 404, which is obtained in product_info by using $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_STORES . " p2s where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and p.products_id = p2s.products_id and p2s.stores_id = '" . STORES_ID . "' and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <?php if ($product_check['total'] < 1) { // header("HTTP/1.1 404 Not Found"); // header("Status: 404 Not Found"); // header("location: http_error.php"); require('includes/404.php'); exit; }else{ } ?> I have tried using something simular in Index PHP for one of the many category queries but not succeded so far, could somebody let me know if do it like this or is there someting else i should be looking at. Thank you David David
DAVID3733 Posted October 3, 2011 Author Posted October 3, 2011 Hi again just an update , i did find a post which suggests that the 1st Parent id query is the one to be looking at so just above $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_TO_STORES . " c2s where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = c2s.categories_id and c2s.stores_id = '" . STORES_ID . "'"); $category_parent = tep_db_fetch_array($category_parent_query); I have put $category_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_TO_STORES . " c2s where categories_id = '" . (int)$cPath_array[(sizeof($cPath_array)-1)] . "' and c.categories_id = c2s.categories_id and c2s.stores_id = '" . STORES_ID . "'"); if(!tep_db_num_rows($category_query) ) { require('includes/404.php'); exit; } and while this seems to do something it is not diverting it to the 404 I also tried $category_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_TO_STORES . " c2s where categories_id = '" . (int)$cPath_array[(sizeof($cPath_array)-1)] . "' and c.categories_id = c2s.categories_id and c2s.stores_id = '" . STORES_ID . "'"); // $category_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$cPath_array[(sizeof($cPath_array)-1)] . "'"); if(!tep_db_num_rows($category_query) ) { header( "HTTP/1.1 404 Page Not Found" ); header('Location: ' . 'includes/404.php'); tep_exit(); I think i am close just no cocunut yet, Regards David David
Recommended Posts
Archived
This topic is now archived and is closed to further replies.