getProductReviewCollection
Method to fetch reviews of a product
This method sends a GET request to the getProductReviewCollection endpoint of the Vue Storefront API Middleware. In turn, it receives data from the getProductReviewCollection endpoint exposed by the BigCommerce API
Signature
declare function getProductReviewCollection(
props: GetProductReviewCollectionProps,
query?: GetProductReviewCollectionQuery,
options?: MethodOptions
): Promise<ProductReviewCollectionResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | GetProductReviewCollectionProps | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
query | Optional | GetProductReviewCollectionQuery | |
options | Optional | MethodOptions |
Returns
Returns a response with the product reviews
Referenced Types
Examples
Fetching reviews for a product and passing an optional exclude_fields property to exclude the review titles from the response. Sending it this way, the response can be cached safely.
import { sdk } from '~/sdk.config.ts';
const getProductReviewCollectionResponse = await sdk.bigcommerce.getProductReviewCollection({
productId: 132,
exclude_fields: 'title'
});