php - Display product list from same selected subcategory for this product on product detail page -


i struggling last 2 days display product list (only product name link) @ product detail page have same subcategory detailed product has. in detail, have 2 level category:please take @ image:

enter image description here

now suppose when user goes prodcut "zest" item detail page can see "zest" , "exotic" items list. not other items subcategory (e.g. indonesian... blue border color). here aam able category id of "pods" (its main category) cannot id of "house blend(2)" subcategory.

can please these product list? in advance.

to subcategories of category:

$children = mage::getmodel('catalog/category')->getcategories(50); $searchincategories = ''; foreach ($children $category) {      //add , after every id     if (strlen($searchincategories) > 0)         $searchincategories .= ',';      $searchincategories .= $category->getid(); } 

where 50 category id, in case pods id.

now need alter search query products:

->addattributetofilter('category_id', array('in' => array('finset' => $searchincategories))) 

Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -