26 lines
953 B
PHP
26 lines
953 B
PHP
<?php
|
|||
|
|
|
||
|
|
use Modules\Core\Catalog\Recommendations\RandomRule;
|
||
|
|
use Modules\Core\Catalog\Recommendations\SameCategoryRule;
|
||
|
|
|
||
|
|
return [
|
||
|
|
/*
|
||
|
|
|--------------------------------------------------------------------------
|
||
|
|
| Product recommendation rules
|
||
|
|
|--------------------------------------------------------------------------
|
||
|
|
|
|
||
|
|
| Tried in order by Modules\Core\Catalog\Services\RecommendationService —
|
||
|
|
| the first rule that returns at least one product wins. The order here IS
|
||
|
|
| the fallback chain: SameCategoryRule first, then RandomRule as a
|
||
|
|
| last-resort so a product page is never left with zero recommendations
|
||
|
|
| (as long as the store has more than one product). A consuming app can
|
||
|
|
| reorder, add, or remove rules freely — nothing about the chain shape is
|
||
|
|
| hardcoded in the service itself.
|
||
|
|
|
|
||
|
|
*/
|
||
|
|
'recommendation_rules' => [
|
||
|
|
SameCategoryRule::class,
|
||
|
|
RandomRule::class,
|
||
|
|
],
|
||
|
|
];
|