PHP code example of brille24 / sylius-tierprice-plugin

1. Go to this page and download the library: Download brille24/sylius-tierprice-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/ */

    

brille24 / sylius-tierprice-plugin example snippets


return [
    //...

    Brille24\SyliusTierPricePlugin\Brille24SyliusTierPricePlugin::class => ['all' => true],
];

class ProductVariant extends BaseProductVariant implements \Brille24\SyliusTierPricePlugin\Entity\ProductVariantInterface
{
    use \Brille24\SyliusTierPricePlugin\Traits\TierPriceableTrait;

    public function __construct() {
        parent::__construct(); // Your contructor here

        $this->initTierPriceableTrait(); // "Constructor" of the trait
    }

    protected function createTranslation(): ProductVariantTranslationInterface
    {
        return new ProductVariantTranslation();
    }
}