HowTo: Configure product reviews
Edit on GitHubConfigure the maximum rating
To change the maximum allowed rating, alter the Client configuration by extending the \Spryker\Client\ProductReview\ProductReviewConfig class in your project directory.
Override the getMaximumRating method to return the desired selectable maximum rating value.
Example of client config extension:
<?php
namespace Pyz\Client\ProductReview;
use Spryker\Client\ProductReview\ProductReviewConfig as ProductReviewProductReviewConfig;
class ProductReviewConfig extends ProductReviewProductReviewConfig
{
/**
* @return int
*/
public function getMaximumRating()
{
return 10;
}
}
Configure the number of reviews displayed per page
-
To change the maximum number of reviews displayed per page, alter the
Clientconfiguration by extending the\Spryker\Client\ProductReview\ProductReviewConfigclass in your project directory. -
Override the
PAGINATION_DEFAULT_ITEMS_PER_PAGEandPAGINATION_VALID_ITEMS_PER_PAGEconstants to the desired number of reviews to be displayed per page.
An example of the client config extension:
<?php
namespace Pyz\Client\ProductReview;
use Spryker\Client\ProductReview\ProductReviewConfig as ProductReviewProductReviewConfig;
class ProductReviewConfig extends ProductReviewProductReviewConfig
{
const PAGINATION_DEFAULT_ITEMS_PER_PAGE = 5;
const PAGINATION_VALID_ITEMS_PER_PAGE = [
5,
];
}
Thank you!
For submitting the form