How to Get Category count in Magento 2?

Retrieve the category count total for the store in Magento 2 using the getCount() method.

If you require the number of category count for the Magento store, You can easily fetch that info by the Magento\Catalog\Api\CategoryManagementInterface. Continue reading “How to Get Category count in Magento 2?”

How to Get all Category list in Magento 2?

You can retrieve all the category lists available in the Magento store starting with category id(1) Root Catalog, Default Category to all the custom created categories.

Retrieve a list of information for the category like category id, attribute set id, parent id, path, position, title, is anchor, is active, include in the menu.

You can achieve functionality using the Catalog module interface Magento\Catalog\Api\CategoryListInterface with getList() method to get a category list. Continue reading “How to Get all Category list in Magento 2?”

How to Remove the product assignment from the category Magento 2?

Remove the product assignment from the category by category id and SKU in Magento 2 useful for removing unnecessary products from the Category by Programmatic approach.

Let’s We want to delete the product has SKU “24-MB04” from the Watches Category in Native Magento with Sample data. Continue reading “How to Remove the product assignment from the category Magento 2?”