PHP code example of asdoria / sylius-shipping-delivery-time-plugin
1. Go to this page and download the library: Download asdoria/sylius-shipping-delivery-time-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');
asdoria / sylius-shipping-delivery-time-plugin example snippets
use Asdoria\SyliusShippingDeliveryTimePlugin\Traits\Aware\ShippingMethodCountdownAwareTrait;
use Asdoria\SyliusShippingDeliveryTimePlugin\Model\Aware\ShippingMethodCountdownAwareInterface;
class ShippingMethod extends BaseShippingMethod implements ShippingMethodCountdownAwareInterface
{
use ShippingMethodCountdownAwareTrait;
public function __construct()
{
parent::__construct();
$this->initializeShippingSchedulesCollection();
}
}
use Asdoria\SyliusShippingDeliveryTimePlugin\Model\Aware\ProductCountdownAwareInterface;
use Asdoria\SyliusShippingDeliveryTimePlugin\Traits\Aware\ProductCountdownAwareTrait;
class Product extends BaseProduct implements ProductInterface, ProductCountdownAwareInterface
{
use ProductCountdownAwareTrait;
}
use Asdoria\SyliusShippingDeliveryTimePlugin\Model\Aware\DefaultShippingZoneAwareInterface;
use Asdoria\SyliusShippingDeliveryTimePlugin\Traits\Aware\DefaultShippingZoneAwareTrait;
class Channel extends BaseChannel implements ChannelInterface, DefaultShippingZoneAwareInterface
{
use DefaultShippingZoneAwareTrait;
}
$bundles = [
Asdoria\SyliusShippingDeliveryTimePlugin\AsdoriaSyliusShippingDeliveryTimePlugin::class => ['all' => true],
];
xml
<mapped-superclass name="App\Entity\Product\Product" table="sylius_product">
<field name="additionalDeliveryTime" column="additional_delivery_time" nullable="true" type="integer">
<options>
<option name="default">0</option>
</options>
</field>
</mapped-superclass>
bash
php bin/console assets:install