PHP code example of setono / sylius-order-edit-plugin

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

    

setono / sylius-order-edit-plugin example snippets




declare(strict_types=1);

namespace App\Entity\Order;

use Doctrine\ORM\Mapping as ORM;
use Setono\SyliusOrderEditPlugin\Entity\EditableOrderInterface;
use Setono\SyliusOrderEditPlugin\Entity\EditableOrderTrait;
use Sylius\Component\Core\Model\Order as BaseOrder;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_order')]
class Order extends BaseOrder implements EditableOrderInterface
{
    use EditableOrderTrait;
}


// ...

public function up(Schema $schema): void
{
    // ...
    $this->addSql('UPDATE sylius_order SET initial_total = total');
}

// ...
shell
php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate