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);

How to get products from wishlist in Model using customer id?

1 Answer 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.