I want to create custom list (category) page in magento2.
If current category has sub category then it's show sub category.
If current category have sub category and products then it's show both.
If current category has only products then it's show products only.
which file I need to do changes?
Can anyone give me a suggestion?
Best Answer
You can get sub-category by below code at list.phtml
Edit:
add this code:
just after
<?php if (!$_productCollection->count()): ?>
and
add below code:
just after
<?php $pos = $block->getPositioned(); ?>
Get source code at http://codepad.org/VwvnFZge