diff --git a/_includes/pbc/all/install-features/latest/install-the-product-group-product-rating-and-reviews-feature.md b/_includes/pbc/all/install-features/latest/install-the-product-group-product-rating-and-reviews-feature.md index 2d232eb4458..a46125d1745 100644 --- a/_includes/pbc/all/install-features/latest/install-the-product-group-product-rating-and-reviews-feature.md +++ b/_includes/pbc/all/install-features/latest/install-the-product-group-product-rating-and-reviews-feature.md @@ -22,7 +22,7 @@ Register the following plugin: | PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | | --- | --- | --- | --- | -| ProductReviewSummaryProductViewExpanderPlugin | Expands `ProductViewTransfer` with the product review summary data (average rating). | None | SprykerShop\Yves\ProductReviewWidget\Plugin\ProductGroupWidget | +| ProductReviewStorageProductViewExpanderPlugin | Expands `ProductViewTransfer` with the product review summary data (average rating). | None | SprykerShop\Yves\ProductReviewWidget\Plugin\ProductGroupWidget | ```php @@ -31,7 +31,7 @@ Register the following plugin: namespace Pyz\Yves\ProductGroupWidget; use SprykerShop\Yves\ProductGroupWidget\ProductGroupWidgetDependencyProvider as SprykerShopProductGroupWidgetDependencyProvider; -use SprykerShop\Yves\ProductReviewWidget\Plugin\ProductGroupWidget\ProductReviewSummaryProductViewExpanderPlugin; +use SprykerShop\Yves\ProductReviewWidget\Plugin\ProductGroupWidget\ProductReviewStorageProductViewExpanderPlugin; class ProductGroupWidgetDependencyProvider extends SprykerShopProductGroupWidgetDependencyProvider { @@ -41,7 +41,7 @@ class ProductGroupWidgetDependencyProvider extends SprykerShopProductGroupWidget protected function getProductViewExpanderPlugins(): array { return [ - new ProductReviewSummaryProductViewExpanderPlugin(), + new ProductReviewStorageProductViewExpanderPlugin(), ]; } } diff --git a/_includes/pbc/all/install-features/latest/install-the-product-rating-and-reviews-feature.md b/_includes/pbc/all/install-features/latest/install-the-product-rating-and-reviews-feature.md index ab418d99db0..f8fdbeec273 100644 --- a/_includes/pbc/all/install-features/latest/install-the-product-rating-and-reviews-feature.md +++ b/_includes/pbc/all/install-features/latest/install-the-product-rating-and-reviews-feature.md @@ -18,7 +18,7 @@ Install the required features: ### 1) Install the required modules ```bash -composer require spryker-feature/product-rating-reviews:"202507.0" --update-with-dependencies +composer require spryker-feature/product-rating-reviews:"202507.0" spryker-shop/product-review-widget:"^1.17.0" --update-with-dependencies ``` {% info_block warningBox "Verification" %} @@ -652,7 +652,7 @@ class RouterDependencyProvider extends SprykerRouterDependencyProvider | PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | |---------------------------------------------------|-----------------------------------------------------------------------------------------------------------|---------------|----------------------------------------------------------------| -| ProductReviewSummaryProductViewBulkExpanderPlugin | Expands `ProductViewTransfer` objects with product review rating data. | None | SprykerShop\Yves\ProductReviewWidget\Plugin\ProductGroupWidget | +| ProductReviewStorageProductViewExpanderPlugin | Expands `ProductViewTransfer` objects with product review rating data. | None | SprykerShop\Yves\ProductReviewWidget\Plugin\ProductGroupWidget | **src/Pyz/Yves/ProductGroupWidget/ProductGroupWidgetDependencyProvider.php** @@ -662,7 +662,7 @@ class RouterDependencyProvider extends SprykerRouterDependencyProvider namespace Pyz\Yves\ProductGroupWidget; use SprykerShop\Yves\ProductGroupWidget\ProductGroupWidgetDependencyProvider as SprykerShopProductGroupWidgetDependencyProvider; -use SprykerShop\Yves\ProductReviewWidget\Plugin\ProductGroupWidget\ProductReviewSummaryProductViewBulkExpanderPlugin; +use SprykerShop\Yves\ProductReviewWidget\Plugin\ProductGroupWidget\ProductReviewStorageProductViewExpanderPlugin; class ProductGroupWidgetDependencyProvider extends SprykerShopProductGroupWidgetDependencyProvider { @@ -672,7 +672,7 @@ class ProductGroupWidgetDependencyProvider extends SprykerShopProductGroupWidget protected function getProductViewBulkExpanderPlugins(): array { return [ - new ProductReviewSummaryProductViewBulkExpanderPlugin(), + new ProductReviewStorageProductViewExpanderPlugin(), ]; } } diff --git a/docs/dg/dev/guidelines/performance-guidelines/general-performance-guidelines.md b/docs/dg/dev/guidelines/performance-guidelines/general-performance-guidelines.md index 7c4a303e3d0..c8ea49edfaf 100644 --- a/docs/dg/dev/guidelines/performance-guidelines/general-performance-guidelines.md +++ b/docs/dg/dev/guidelines/performance-guidelines/general-performance-guidelines.md @@ -491,6 +491,48 @@ protected function getOrderItemExpanderPreSavePlugins(): array After enabling the plugin and configuring the unique column, Spryker saves order items in batches, which reduces database overhead and improves checkout performance. +## Product review performance + +Product reviews are displayed on the catalog page, search page, and product detail page. To optimize performance when displaying product ratings, use the `ProductReviewStorageProductViewExpanderPlugin` instead of `ProductReviewSummaryProductViewBulkExpanderPlugin`. + +The new plugin retrieves product ratings from storage in bulk, which is more efficient than fetching reviews from a search source and calculating ratings based on reviews. + +### Prerequisites + +Update `spryker-shop/product-review-widget` to version `^1.17.0` or higher: + +```bash +composer require spryker-shop/product-review-widget:"^1.17.0" --update-with-dependencies +``` + +### Set up the plugin + +Replace `ProductReviewSummaryProductViewBulkExpanderPlugin` with `ProductReviewStorageProductViewExpanderPlugin` in your dependency provider: + +**src/Pyz/Yves/ProductGroupWidget/ProductGroupWidgetDependencyProvider.php** + +```php + + */ + protected function getProductViewBulkExpanderPlugins(): array + { + return [ + new ProductReviewStorageProductViewExpanderPlugin(), + ]; + } +} +``` + ## Reduce functionality Check if you require all features you currently use and check all applied plugins if you need them. Some plugins can probably be removed. Specifically, check the following ones: