Magento 2.3 PHP 7.1
I trying to get products from customer wishlist in Model but $products array is empty.
$products = [];
$items = $this->wishlist->loadByCustomerId(1, true)->getItemCollection();
foreach ($items as $item) {
$product['name'] = $item->getProduct()->getName();
$product['sku'] = $item->getProduct()->getSku();
array_push($products, $product);
}
var_dump($products);
How to get products from wishlist in Model using customer id?