get list of items from sku magento 2 programatically

19 Views Asked by At

I want to fetch items from skus. Can anyone suggest me how to do.

The code I am following - The sku i am getting in the variable $productSkus.

private function fetchProducts(array $orderItems): array
{
    $productIds = [];

    foreach ($orderItems as $orderItem) {
        $productIds[] = $orderItem->getProductId();
        $productSkus[] = $orderItem->getSku();
    }

} Now, i want to get all items from the skus array

0

There are 0 best solutions below