Skip to content
Magento 2 Blog

Magento 2

blog

Author: Serhii Andriienko

Team Lead Magento Developer.

Get Product Collection in Magento 2

Use ResourceModel\Product\CollectionFactory if you need a collection by product.

Continue reading “Get Product Collection in Magento 2”
Author: Serhii AndriienkoCategories: Backend Development

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”
Author: Serhii AndriienkoCategories: Backend Development

Get Category by Repository Interface

Get category item by ID. Use CategoryRepositoryInterface and NoSuchEntityException.

Continue reading “Get Category by Repository Interface”
Author: Serhii AndriienkoCategories: Backend Development

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”
Author: Serhii AndriienkoCategories: Backend Development

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”
Author: Serhii AndriienkoCategories: Module

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”
Author: Serhii AndriienkoCategories: Redis, Server/Cloud

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”
Author: Serhii AndriienkoCategories: Mysql, Server/Cloud

Repository testing in Magento 2

Repository is simple! Create file repository.php in folder /pub.

Continue reading “Repository testing in Magento 2”
Author: Serhii AndriienkoCategories: Backend Development

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”
Author: Serhii AndriienkoCategories: Backend Development
  • Backend Development (6)
  • Module (1)
  • Server/Cloud (2)
    • Mysql (1)
    • Redis (1)
  • Get Product Collection in Magento 2
  • Get Category Collection in Magento 2
  • Get Category by Repository Interface
  • Sql query in magento – Resource Connection
  • Catalog Category Tree – problem with loading tree nodes in Magento 2

Magento 2 | copyright 2022