Skip to content
Magento 2 Blog

Magento 2

blog

Category: Backend Development

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

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