Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update installation guides for sylius 1.8 #268

Merged
merged 3 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,60 @@ It is used by `KnpSnappyBundle` and can be configured according to [their documm
mkdir -p templates/bundles/SyliusAdminBundle/
cp -R vendor/sylius/refund-plugin/src/Resources/views/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/
```

4. If you use sylius v1.8 you also need to change files `src/Entity/Shipping/Shipment.php` and `src/Entity/Order/Adjustment.php` to use proper traits and interfaces
arti0090 marked this conversation as resolved.
Show resolved Hide resolved

```php
<?php

declare(strict_types=1);

namespace App\Entity\Order;

use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Order\Model\Adjustment as BaseAdjustment;
use Sylius\RefundPlugin\Entity\AdjustmentInterface as RefundAdjustmentInterface;
use Sylius\RefundPlugin\Entity\AdjustmentTrait;

/**
* @ORM\Entity
* @ORM\Table(name="sylius_adjustment")
*/
class Adjustment extends BaseAdjustment implements RefundAdjustmentInterface
{
use AdjustmentTrait;
}
```

```php
<?php

declare(strict_types=1);

namespace App\Entity\Shipping;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Shipment as BaseShipment;
use Sylius\RefundPlugin\Entity\ShipmentTrait;
use Sylius\RefundPlugin\Entity\ShipmentInterface as RefundShipmentInterface;

/**
* @ORM\Entity
* @ORM\Table(name="sylius_shipment")
*/
class Shipment extends BaseShipment implements RefundShipmentInterface
{
use ShipmentTrait;

public function __construct()
{
parent::__construct();
/** @var ArrayCollection<array-key, BaseAdjustmentInterface> $this->adjustments */
arti0090 marked this conversation as resolved.
Show resolved Hide resolved
$this->adjustments = new ArrayCollection();
}
}
```

#### Beware!

Expand Down
54 changes: 54 additions & 0 deletions docs/legacy_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,60 @@
cp -R vendor/sylius/refund-plugin/src/Resources/views/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/
```

1. If you use sylius v1.8 you also need to change files `src/Entity/Shipping/Shipment.php` and `src/Entity/Order/Adjustment.php` to use proper traits and interfaces
arti0090 marked this conversation as resolved.
Show resolved Hide resolved

```php
<?php

declare(strict_types=1);

namespace App\Entity\Order;

use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Order\Model\Adjustment as BaseAdjustment;
use Sylius\RefundPlugin\Entity\AdjustmentInterface as RefundAdjustmentInterface;
use Sylius\RefundPlugin\Entity\AdjustmentTrait;

/**
* @ORM\Entity
* @ORM\Table(name="sylius_adjustment")
*/
class Adjustment extends BaseAdjustment implements RefundAdjustmentInterface
{
use AdjustmentTrait;
}
```

```php
<?php

declare(strict_types=1);

namespace App\Entity\Shipping;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Shipment as BaseShipment;
use Sylius\RefundPlugin\Entity\ShipmentTrait;
use Sylius\RefundPlugin\Entity\ShipmentInterface as RefundShipmentInterface;

/**
* @ORM\Entity
* @ORM\Table(name="sylius_shipment")
*/
class Shipment extends BaseShipment implements RefundShipmentInterface
{
use ShipmentTrait;

public function __construct()
{
parent::__construct();
/** @var ArrayCollection<array-key, BaseAdjustmentInterface> $this->adjustments */
arti0090 marked this conversation as resolved.
Show resolved Hide resolved
$this->adjustments = new ArrayCollection();
}
}
```

1. Clear cache:

```bash
Expand Down