1. Go to this page and download the library: Download setono/sylius-review-plugin library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Setono\SyliusReviewPlugin\EligibilityChecker\EligibilityCheck;
use Setono\SyliusReviewPlugin\EligibilityChecker\ReviewRequestEligibilityCheckerInterface;
final class MyEligibilityChecker implements ReviewRequestEligibilityCheckerInterface
{
public function check(ReviewRequestInterface $reviewRequest): EligibilityCheck
{
if($this->getCustomer()->hasGreenEyes()) {
return EligibilityCheck::ineligible('The review request is not eligible because we don't trust people with green eyes...');
}
return EligibilityCheck::eligible();
}
}