PHP code example of setono / sylius-review-plugin

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/ */

    

setono / sylius-review-plugin example snippets



$bundles = [
    // ...
    Setono\SyliusReviewPlugin\SetonoSyliusReviewPlugin::class => ['all' => true],
    Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
    // ...
];


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();
    }
}
bash
php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate
bash
php bin/console setono:sylius-review:process
php bin/console setono:sylius-review:prune