Skip to content

Commit

Permalink
bug #268 update installation guides for sylius 1.8 (arti0090, GSadee)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.0-dev branch.

Discussion
----------



Commits
-------

68d5596 update install files
c6f7e4b fixes
1140c3b Minor fixes in installation guides
  • Loading branch information
GSadee authored Mar 16, 2021
2 parents 55943d4 + 1140c3b commit 20a030e
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 0 deletions.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,62 @@ 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:

```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\AdjustmentInterface as BaseAdjustmentInterface;
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 */
$this->adjustments = new ArrayCollection();
}
}
```

#### Beware!

Expand Down
56 changes: 56 additions & 0 deletions docs/legacy_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,62 @@
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:
```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\AdjustmentInterface as BaseAdjustmentInterface;
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 */
$this->adjustments = new ArrayCollection();
}
}
```
1. Clear cache:
```bash
Expand Down

0 comments on commit 20a030e

Please sign in to comment.