as this code pulls products directly from main categories the products related could be any product from within its main category.
is there a way to change it to tell it to only pull info from sub category rather than the parent category so only products directly related show.
ex: i having baking goods sub cat so flour is a product in there along with other types of flour but this mod sets related products to tuna in a tin as this is in the main general food category but under tinned goods.
any help trying to alter code to only pick within sub category would be appreciated
Code: Select all
//related by category
if(count($results)<3){//change to suit number of products to display
$temp = $this->model_catalog_product->getProductRelatedByCategory($this->request->get['product_id'],count($results));
foreach($temp as $t){
if(!empty($t)){
$results[] = $t;
}
}
}