Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
{
Expand All @@ -41,7 +41,7 @@ class ProductGroupWidgetDependencyProvider extends SprykerShopProductGroupWidget
protected function getProductViewExpanderPlugins(): array
{
return [
new ProductReviewSummaryProductViewExpanderPlugin(),
new ProductReviewStorageProductViewExpanderPlugin(),
];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down Expand Up @@ -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**

Expand All @@ -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
{
Expand All @@ -672,7 +672,7 @@ class ProductGroupWidgetDependencyProvider extends SprykerShopProductGroupWidget
protected function getProductViewBulkExpanderPlugins(): array
{
return [
new ProductReviewSummaryProductViewBulkExpanderPlugin(),
new ProductReviewStorageProductViewExpanderPlugin(),
];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Comment on lines +496 to +498
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, suggest which package versions we need to update to have this


### 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, never suggest --update-with-dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

```

### Set up the plugin

Replace `ProductReviewSummaryProductViewBulkExpanderPlugin` with `ProductReviewStorageProductViewExpanderPlugin` in your dependency provider:

**src/Pyz/Yves/ProductGroupWidget/ProductGroupWidgetDependencyProvider.php**

```php
<?php

namespace Pyz\Yves\ProductGroupWidget;

use SprykerShop\Yves\ProductGroupWidget\ProductGroupWidgetDependencyProvider as SprykerShopProductGroupWidgetDependencyProvider;
use SprykerShop\Yves\ProductReviewWidget\Plugin\ProductGroupWidget\ProductReviewStorageProductViewExpanderPlugin;

class ProductGroupWidgetDependencyProvider extends SprykerShopProductGroupWidgetDependencyProvider
{
/**
* @return array<\SprykerShop\Yves\ProductGroupWidgetExtension\Dependency\Plugin\ProductViewBulkExpanderPluginInterface>
*/
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:
Expand Down