wishlistProductNotFound example


        $criteria = new Criteria();
        $criteria->setLimit(1);
        $criteria->addFilter(new MultiFilter(MultiFilter::CONNECTION_AND, [
            new EqualsFilter('wishlistId', $wishlistId),
            new EqualsFilter('productId', $productId),
            new EqualsFilter('productVersionId', Defaults::LIVE_VERSION),
        ]));
        $wishlistProductIds = $this->productRepository->searchIds($criteria$context->getContext());

        if ($wishlistProductIds->firstId() === null) {
            throw CustomerException::wishlistProductNotFound($productId);
        }

        return $wishlistProductIds->firstId();
    }
}
'message' => 'Encoder with name "encoder" not found.',
        ];

        yield CustomerException::NO_HASH_PROVIDED => [
            'exception' => CustomerException::noHashProvided(),
            'statusCode' => Response::HTTP_NOT_FOUND,
            'errorCode' => CustomerException::NO_HASH_PROVIDED,
            'message' => 'The given hash is empty.',
        ];

        yield CustomerException::WISHLIST_PRODUCT_NOT_FOUND => [
            'exception' => CustomerException::wishlistProductNotFound('id-1'),
            'statusCode' => Response::HTTP_NOT_FOUND,
            'errorCode' => CustomerException::WISHLIST_PRODUCT_NOT_FOUND,
            'message' => 'Wishlist product with id id-1 not found',
        ];

        if (!Feature::isActive('v6.6.0.0')) {
            yield CustomerException::CUSTOMER_IS_INACTIVE => [
                'exception' => CustomerException::inactiveCustomer('id-1'),
                'statusCode' => Response::HTTP_UNAUTHORIZED,
                'errorCode' => CustomerException::CUSTOMER_IS_INACTIVE,
                'message' => 'The customer with the id "id-1" is inactive.',
            ];
Home | Imprint | This part of the site doesn't use cookies.