PHP code example of gewebe / sylius-product-deposit-plugin

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

    

gewebe / sylius-product-deposit-plugin example snippets




return [
    // ...
    Gewebe\SyliusProductDepositPlugin\GewebeSyliusProductDepositPlugin::class => ['all' => true],
];

# src/Entity/Product/ProductVariant.php

namespace App\Entity\Product;

use Doctrine\ORM\Mapping as ORM;
use Gewebe\SyliusProductDepositPlugin\Entity\ProductVariantInterface as ProductVariantDepositInterface;
use Gewebe\SyliusProductDepositPlugin\Entity\ProductVariantDepositTrait;
use Sylius\Component\Core\Model\ProductVariant as BaseProductVariant;

/**
 * @ORM\Entity
 * @ORM\Table(name="sylius_product_variant")
 */
class ProductVariant extends BaseProductVariant implements ProductVariantDepositInterface
{
    use ProductVariantDepositTrait;

    public function __construct()
    {
        parent::__construct();

        $this->initProductVariantDepositTrait();
    }

    // ...
}