0

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?

1 Answer 1

Your Answer

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

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