Expanded Category List - Products List not showing Linked Products
Hello,
This mod is great, but I have one problem. I have linked products all over my store. Linked products won't show under the other categories they are assigned to. They will only show under the category that they are originally assigned to. Can anyone please help me with this? :smile:
http://www.zen-cart.com/index.php?ma...roducts_id=392
Re: Expanded Category List - Products List not showing Linked Products
I'm sure it has something to do with the class file "category_ist.php" included with the sidebox mod in this code:
PHP Code:
function build_products($category_id, $category_link, $level){
global $languages_id, $db;
$box_categories_array = & $this->box_category_array;
$icount = & $this->icount;
$products_query = "SELECT ". TABLE_PRODUCTS .".products_id, products_name
FROM ". TABLE_PRODUCTS."
INNER JOIN ". TABLE_PRODUCTS_DESCRIPTION ."
ON ". TABLE_PRODUCTS .".products_id = ". TABLE_PRODUCTS_DESCRIPTION .".products_id
WHERE (((". TABLE_PRODUCTS_DESCRIPTION .".language_id)=". (int)$_SESSION['languages_id'] .")
AND ((". TABLE_PRODUCTS .".master_categories_id)=". $category_id ."))
ORDER BY ". TABLE_PRODUCTS .".products_sort_order, ". TABLE_PRODUCTS_DESCRIPTION .".products_name";
$products = $db->Execute($products_query);
if (!$products->EOF){
while (!$products->EOF){
$box_categories_array[$icount]['count'] = 0 ;
$box_categories_array[$icount]['level']=$level;
$box_categories_array[$icount]['top']='false';
$box_categories_array[$icount]['is_product']=true;
$box_categories_array[$icount]['has_sub_cat'] = false;
$box_categories_array[$icount]['name']=$products->fields['products_name'];
$box_categories_array[$icount]['path']= 'cPath=' . $category_link ."&products_id=".$products->fields['products_id'] ;
$box_categories_array[$icount]['products_id']=$products->fields['products_id'] ;
//this doesn't work :(
if ($products->fields['products_id'] == $products_id){
$box_categories_array[$icount]['current']=true;
}else{
$box_categories_array[$icount]['current']=false;
}
$products->MoveNext();
$icount++;
}
}
return $result;
}
function build_list() {
return $this->build_branch($this->root_category_id);
}