PHP code example of fluffydiscord / sylius-classification-bundle
1. Go to this page and download the library: Download fluffydiscord/sylius-classification-bundle 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/ */
fluffydiscord / sylius-classification-bundle example snippets
// config/bundles.php
return [
// ...
FluffyDiscord\SyliusClassificationBundle\SyliusClassificationBundle::class => ['all' => true],
];
// src/Entity/Product/ProductVariant.php
namespace App\Entity\Product;
use FluffyDiscord\SyliusClassificationBundle\Entity\Variant\ClassificationValuesAwareInterface;
use FluffyDiscord\SyliusClassificationBundle\Entity\Variant\ClassificationValuesAwareTrait;
use Sylius\Component\Core\Model\ProductVariant as BaseProductVariant;
class ProductVariant extends BaseProductVariant implements ClassificationValuesAwareInterface
{
use ClassificationValuesAwareTrait;
public function __construct()
{
parent::__construct();
$this->initializeClassificationValues();
}
}