I want to display subcategory in category page with the image.
I've to put below code get only subcategory name not getting the image.
How to get subcategory image in category page?
if($this->getLayer()->getCurrentCategory())
$subcategories=$this->getLayer()->getCurrentCategory()->getCategories($this->getLayer()->getCurrentCategory()->getId());
if($subcategories->count()>0){
foreach($subcategories as $subcategory){
<li>
<a href="<?php echo $subcategory->getRequest_path(); ?>"><?php echo $subcategory->getName() ?></a>
</li>
}
}else{}
endif;
Best Answer
i used this block to have the same functionality and called the block in xml ( don't forget to create a template for the block with the desired functionality and html mockup