PHP code example of cleverage / sylius-dpd-plugin

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

    

cleverage / sylius-dpd-plugin example snippets



# config/bundles.php

return [
    // ...
    CleverAge\SyliusDpdPlugin\CleverAgeSyliusDpdPlugin::class => ['all' => true],
    // ...
];


// src/Entity/ShippingMethod.php

declare(strict_types=1);

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use CleverAge\SyliusDpdPlugin\Contract\DpdShippingMethodInterface;
use CleverAge\SyliusDpdPlugin\Entity\Traits\DpdShippingMethodTrait;
use Sylius\Component\Core\Model\ShippingMethod as BaseShippingMethod;

/**
 * @ORM\Entity()
 * @ORM\Table(name="sylius_shipping_method")
 */
class ShippingMethod extends BaseShippingMethod implements DpdShippingMethodInterface
{
    use DpdShippingMethodTrait;
}



// src/Entity/Order.php

declare(strict_types=1);

namespace App\Entity;

use CleverAge\SyliusDpdPlugin\Entity\Traits\DpdOrderTrait;
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Order as BaseOrder;

/**
 * @ORM\Entity()
 * @ORM\Table(name="sylius_order")
 */
class Order extends BaseOrder
{
    use DpdOrderTrait;
}