How to get Grouped Product id from child product id in Magento 2?

Using Magento 2, You can fetch Parent product Ids as an array from the child id of the product.

To Retrieve the Parent product id, You need Child Item Id associated with Grouped Product. Using Magento\GroupedProduct\Model\Product\Type\Grouped Magento Core class you can fetch the parent product Id.

For More Knowledge check the article, You can fetch All the children’s items by Grouped Product SKU.

Used function getParentIdsByChild($childProductId)
Continue reading “How to get Grouped Product id from child product id in Magento 2?”

How to Update product using REST API /V1/products/:sku in Magento 2?

In Magento 2, You can update already existing products using REST API. You need to call the updated product request URL to perform the update action.

For Update Product, you need to call the PUT method as action Type.

Action: PUT

Request URL: <YOUR_SITE_URL>/rest/V1/products/<SKU>

Replace YOUR_SITE_URwith the actual site URL and SKU with your product SKU which you want to update data.

Continue reading “How to Update product using REST API /V1/products/:sku in Magento 2?”

Create a product by REST API /V1/products programmatically in Magento 2.

Create a New product by Magento REST API, you need first to generate an access token. The access token is used to create a product in the admin panel. Check the link for Generate Access Token Magento 2

Once you got the Access Token for Magento, You can call REST API for creating a product from a third-party system.

Continue reading “Create a product by REST API /V1/products programmatically in Magento 2.”