Applied Posted February 5, 2005 Posted February 5, 2005 This code retrieves a product from the same category and I'd like it to instead show a product from the same manufacturer. Can someone tell me what I need to change in the code below? // Find the id # of the category that the current product is in $category_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$_GET['products_id'] . "'" ); $category = tep_db_fetch_array($category_query); $category_id = $category['categories_id']; // Select the other products in the same category $products_query = tep_db_query("select p.products_id, p.products_image, p.products_price, p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pc.products_id and p.products_id = pd.products_id and p.products_id != '" . (int)$_GET['products_id'] . "' and p.products_status = '1' and pc.categories_id = '" . (int)$category_id . "' and pd.language_id = '" . (int)$languages_id . "' order by " . $sort_order . " limit " . MAX_SIMILAR_PRODUCTS );
Applied Posted February 6, 2005 Author Posted February 6, 2005 anyone? I can't figure it out, but I don't think it'd be difficult for someone experienced in this.
Applied Posted April 25, 2005 Author Posted April 25, 2005 I don't know why when I remove category with manufacturer id's it doesn't work. can anyone help me here?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.