Use ResourceModel\Product\CollectionFactory if you need a collection by product.
Continue reading “Get Product Collection in Magento 2”Author: Serhii Andriienko
Get Category Collection in Magento 2
Use the ResourceModel\Category\CollectionFactory if you need a collection by category. Example:
Continue reading “Get Category Collection in Magento 2”Get Category by Repository Interface
Get category item by ID. Use CategoryRepositoryInterface and NoSuchEntityException.
Continue reading “Get Category by Repository Interface”Sql query in magento – Resource Connection
If you need run sql query without repository or collection use ResourceConnection in your module.
Continue reading “Sql query in magento – Resource Connection”Catalog Category Tree – problem with loading tree nodes in Magento 2
If your store has a lot of categories and trees, you may have trouble loading the categories page. Magento 2 has three tier loading by default.
Continue reading “Catalog Category Tree – problem with loading tree nodes in Magento 2”Connection to Redis redis:6379 failed after 2 failures.Last Magento 2
Redis is installed in docker and after deployment I see a new error. I connected to the Redis container and Redis status is OK. Full error:
Continue reading “Connection to Redis redis:6379 failed after 2 failures.Last Magento 2”Emoji is not saved in mysql (???????) in Magento 2
(MySQL) UTF-8 does not support all emoji. You need to change DB columns to “utf8mb4”.
Continue reading “Emoji is not saved in mysql (???????) in Magento 2”Repository testing in Magento 2
Repository is simple! Create file repository.php in folder /pub.
Continue reading “Repository testing in Magento 2”Model testing in Magento 2
Sometimes you need to quickly test the Model of your module or another vendor. And in order not to create a complete module, we can do it on one file.
Continue reading “Model testing in Magento 2”