Skip to content

Product Service Get By UPC doesn't work #7

@jonrobinson

Description

@jonrobinson

ProductService::getByUpc() expects a single entity like the getById() call but it receives a collection.

This solves the issue:

/**
 * {@inheritdoc}
 */
public function getByUpc($upc)
{
        $this->guardString($upc);
        
        $collection = $this->getEntityCollection('items', ['upc' => $upc], self::COLLECTION_KEY);
        return $collection->getFirst();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions