Skip to content

Get All Row ID for Specific Product

In Magento 2.4.4 EE we have staging feature which we can schedule some changes on products

If product is scheduled for change it creates a new row on catalog_product_entity
so for example for product id 100

we have 2 rows
row_id 100
and
row_id 101

how to retrieve the two row_id for product id 100
tried product collection but it retrieve the latest (active) row_id only which is 101

For example

/** @var MagentoCatalogModelResourceModelProductCollection $productCollection */
$productCollection = $productCollectionFactory->create();

$entityId = 100;

$productCollection->addFieldToFilter('entity_id', $entityId);
$productCollection->addAttributeToSelect('row_id');

foreach ($productCollection as $item) {
    echo $item->getRowId;
}