How to create schema file to create new database table Magento 2.3?

From Magento 2.3, You want to create a new database table or upgrade an existing table, you can create it with the db_schema.xml file. New database table creation/updating concept in Magento 2.3 is called as declarative schema.

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

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

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

For Fetch 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 parent product Id.

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