Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Sideboxes / Expanded Category List - Products List not showing Linked Products

Expanded Category List - Products List not showing Linked Products

Locked

Started by reden on 17 Jan 2008, 7:43 PM · Views: 3,938

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
17 Jan 2008, 7:43 PM
#1
reden avatar

reden

New Zenner

Join Date:
Dec 2007
Posts:
23
Plugin Contributions:
0

Post #1 by reden

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?main_page=product_contrib_info&products_id=392

17 Jan 2008, 7:52 PM
#2
reden avatar

reden

New Zenner

Join Date:
Dec 2007
Posts:
23
Plugin Contributions:
0

Post #2 by reden

I'm sure it has something to do with the class file "category_ist.php" included with the sidebox mod in this 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);
	}