PHP code example of tilleuls / sylius-click-n-collect-plugin
1. Go to this page and download the library: Download tilleuls/sylius-click-n-collect-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');
tilleuls / sylius-click-n-collect-plugin example snippets
return [
CoopTilleuls\SyliusClickNCollectPlugin\CoopTilleulsSyliusClickNCollectPlugin::class => ['all' => true],
];
4. Import the configuration:
namespace App\Entity\Shipping;
use CoopTilleuls\SyliusClickNCollectPlugin\Entity\ClickNCollectShippingMethod;
use CoopTilleuls\SyliusClickNCollectPlugin\Entity\ClickNCollectShippingMethodInterface;
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\ShippingMethod as BaseShippingMethod;
class ShippingMethod extends BaseShippingMethod implements ClickNCollectShippingMethodInterface
{
use ClickNCollectShippingMethod {
__construct as initializeShippingMethodLocations;
}
public function __construct()
{
parent::__construct();
$this->initializeShippingMethodLocations();
}
}
namespace App\Entity\Shipping;
use CoopTilleuls\SyliusClickNCollectPlugin\Entity\ClickNCollectShipment;
use CoopTilleuls\SyliusClickNCollectPlugin\Entity\ClickNCollectShipmentInterface;
use CoopTilleuls\SyliusClickNCollectPlugin\Validator\Constraints\SlotAvailable;
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Shipment as BaseShipment;
class Shipment extends BaseShipment implements ClickNCollectShipmentInterface
{
use ClickNCollectShipment;
}