In this tutorial we learn how to load product by category id.
For that we use \Magento\Catalog\Model\CategoryFactory.

Below is block file where we put our code.

Now add below code to related .phtml file.




Leave a Reply

Your email address will not be published. Required fields are marked *