How to create a new database table using declarative schema in Magento 2.3?

From Magento 2.3, use  db_schema.xml  to create a new table for the database instead of written InstallSchema PHP class. The new database table creation/updating concept in Magento 2.3 is called declarative schema.

From Magento 2.3 You don’t need to create InstallSchema.php and UpgradeSchema.php Continue reading “How to create a new database table using declarative schema in Magento 2.3?”

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?”