How to Retrieve list of Product attribute groups Magento 2?

Product attribute groups used to manage multiple Product attributes to specific Groups in creating or update Products in the Magento admin panel.

Get a list of Product attribute groups programmatically in Magento 2 using Magento\Catalog\Api\ProductAttributeGroupRepositoryInterface. Continue reading “How to Retrieve list of Product attribute groups 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?”

How to Assign product to specific category Magento 2?

You can add the product to the given categories in Magento 2. You can add a single product to multiple categories with product SKU.

Let’s Product SKU is “24-MB05” and you want to add this product to multiple categories, You need category id to an assigned product. We have to pass the category id as an array in the method defined below.

Using interface, Magento\Catalog\Api\CategoryLinkManagementInterface with assignProductToCategories($productSku, array $categoryIds) method used to add to specific category programmatically. Continue reading “How to Assign product to specific category Magento 2?”