DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

How I can get products using multiple skus?

As I ask upon:
https://magento.stackexchange.com/q/369468/113388

I have a list of skus:

  $skus = ['24-MB01','24-MB04','24-UG01'];
Enter fullscreen mode Exit fullscreen mode

And based on these I want to retrieve the products:

/**
 * @var \Magento\Catalog\Model\ProductRepository
 */
private $productRepository
...
$this->productRepository->addFieldToFilter('sku',$skus);
Enter fullscreen mode Exit fullscreen mode

But I cannot get them. Do you have any idea on how I can do this?

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay