Open jonrobinson opened 6 years ago
ProductService::getByUpc() expects a single entity like the getById() call but it receives a collection.
ProductService::getByUpc()
getById()
This solves the issue:
/** * {@inheritdoc} */ public function getByUpc($upc) { $this->guardString($upc); $collection = $this->getEntityCollection('items', ['upc' => $upc], self::COLLECTION_KEY); return $collection->getFirst(); }
better return collection instead of first
ProductService::getByUpc()
expects a single entity like thegetById()
call but it receives a collection.This solves the issue: