Quantcast
Channel: product – Mukesh Chapagain Blog
Viewing all articles
Browse latest Browse all 40

Magento 2: Assign/Remove Products from Categories

0
0
This article shows how you can programmatically assign a product to multiple categories and how you can remove a product from a category in Magento 2. I am using a standalone script for this purpose using Object Manager. You can use this code in your custom module as well by using Dependency Injection (DI) instead of Object Manager. Initialize Object Manager and Set the Area code The following things are done in the below code: – Initialize the object manager. – Set the area code as adminhtml as we are editing the product. – Define ...

Viewing all articles
Browse latest Browse all 40

Latest Images

Trending Articles





Latest Images