-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from logeecom/master
PISYL-148: PISYL-207 && PISYL-240 && PISYL-241 && PISYL-244 && PISYL-245
- Loading branch information
Showing
53 changed files
with
1,781 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ Ensure that you have `wkhtmltopdf` installed, and that you have the proper path | |
#### 2. Require Mollie plugin with composer: | ||
|
||
```bash | ||
composer require mollie/sylius-plugin --no-scripts -w | ||
composer require mollie/sylius-plugin --no-scripts -W | ||
``` | ||
|
||
#### 3. Update the GatewayConfig entity class with the following code: | ||
|
@@ -79,7 +79,7 @@ If you don't use annotations, you can also define new Entity mapping inside your | |
``` | ||
For an example, check [tests/Application/src/Resources/config/doctrine/GatewayConfig.orm.xml](/tests/Application/src/Resources/config/doctrine/GatewayConfig.orm.xml) file. | ||
|
||
Override GatewayConfig resource: | ||
Ensure that the GatewayConfig resource is overridden in the Sylius configuration file: | ||
```yaml | ||
# config/packages/_sylius.yaml | ||
... | ||
|
@@ -91,7 +91,7 @@ sylius_payum: | |
model: App\Entity\Payment\GatewayConfig | ||
``` | ||
#### 4. Update the Order entity class with the following code: | ||
#### 4. Update the Order entity class with the following code: (do this also when updating to plugin version 5.4.0) | ||
```php | ||
<?php | ||
|
@@ -100,11 +100,13 @@ declare(strict_types=1); | |
|
||
namespace App\Entity\Order; | ||
|
||
use SyliusMolliePlugin\Entity\MolliePaymentIdOrderTrait; | ||
use SyliusMolliePlugin\Entity\OrderInterface; | ||
use SyliusMolliePlugin\Entity\MollieSubscriptionInterface; | ||
use SyliusMolliePlugin\Entity\AbandonedEmailOrderTrait; | ||
use SyliusMolliePlugin\Entity\QRCodeOrderTrait; | ||
use SyliusMolliePlugin\Entity\RecurringOrderTrait; | ||
use Doctrine\Common\Collections\Collection; | ||
use Doctrine\ORM\Mapping as ORM; | ||
use Sylius\Component\Core\Model\Order as BaseOrder; | ||
use Sylius\Component\Core\Model\OrderItemInterface; | ||
|
||
|
@@ -116,25 +118,39 @@ class Order extends BaseOrder implements OrderInterface | |
{ | ||
use AbandonedEmailOrderTrait; | ||
use RecurringOrderTrait; | ||
use QRCodeOrderTrait; | ||
use MolliePaymentIdOrderTrait; | ||
|
||
/** | ||
* @var bool | ||
* @ORM\Column(type="boolean", name="abandoned_email") | ||
*/ | ||
protected $abandonedEmail = false; | ||
protected bool $abandonedEmail = false; | ||
|
||
/** | ||
* @var ?int | ||
* @ORM\Column(type="integer", name="recurring_sequence_index", nullable=true) | ||
*/ | ||
protected $recurringSequenceIndex; | ||
protected ?int $recurringSequenceIndex = null; | ||
|
||
/** | ||
* @var string|null | ||
* @ORM\Column(type="text", name="qr_code", nullable=true) | ||
*/ | ||
protected ?string $qrCode = null; | ||
|
||
/** | ||
* @var string|null | ||
* @ORM\Column(type="text", name="mollie_payment_id", nullable=true) | ||
*/ | ||
protected ?string $molliePaymentId = null; | ||
|
||
/** | ||
* @var MollieSubscriptionInterface|null | ||
* @ORM\ManyToOne(targetEntity="SyliusMolliePlugin\Entity\MollieSubscription") | ||
* @ORM\JoinColumn(name="subscription_id", fieldName="subscription", onDelete="RESTRICT") | ||
*/ | ||
protected $subscription = null; | ||
protected ?MollieSubscriptionInterface $subscription = null; | ||
|
||
public function getRecurringItems(): Collection | ||
{ | ||
|
@@ -172,6 +188,7 @@ class Order extends BaseOrder implements OrderInterface | |
return 0 < $this->getNonRecurringItems()->count(); | ||
} | ||
} | ||
|
||
``` | ||
|
||
If you don't use annotations, you can also define new Entity mapping inside your `src/Resources/config/doctrine` directory. | ||
|
@@ -188,7 +205,7 @@ If you don't use annotations, you can also define new Entity mapping inside your | |
</mapped-superclass> | ||
</doctrine-mapping> | ||
``` | ||
Override Order resource: | ||
Ensure that the Order resource is overridden in the Sylius configuration file: | ||
|
||
```yaml | ||
# config/packages/_sylius.yaml | ||
|
@@ -214,6 +231,7 @@ use Doctrine\ORM\Mapping as ORM; | |
use SyliusMolliePlugin\Entity\ProductInterface; | ||
use SyliusMolliePlugin\Entity\ProductTrait; | ||
use Sylius\Component\Core\Model\Product as BaseProduct; | ||
use SyliusMolliePlugin\Entity\ProductType; | ||
|
||
/** | ||
* @ORM\Entity | ||
|
@@ -227,7 +245,7 @@ class Product extends BaseProduct implements ProductInterface | |
* @ORM\ManyToOne(targetEntity="SyliusMolliePlugin\Entity\ProductType") | ||
* @ORM\JoinColumn(name="product_type_id", fieldName="productType", onDelete="SET NULL") | ||
*/ | ||
protected $productType; | ||
protected ?ProductType $productType = null; | ||
} | ||
``` | ||
|
||
|
@@ -254,7 +272,7 @@ If you don't use annotations, you can also define new Entity mapping inside your | |
</entity> | ||
</doctrine-mapping> | ||
``` | ||
Override Product resource: | ||
Ensure that the Product resource is overridden in the Sylius configuration file: | ||
|
||
```yaml | ||
# config/packages/_sylius.yaml | ||
|
@@ -384,7 +402,7 @@ If you don't use annotations, you can also define new Entity mapping inside your | |
</mapped-superclass> | ||
</doctrine-mapping> | ||
``` | ||
Override ProductVariant resource: | ||
Ensure that the ProductVariant resource is overridden in the Sylius configuration file: | ||
|
||
```yaml | ||
# config/packages/_sylius.yaml | ||
|
@@ -431,7 +449,6 @@ winzou_state_machine: | |
``` | ||
|
||
#### 10. Add image directory parameter in `config/packages/_sylius.yaml`: | ||
|
||
```yaml | ||
# config/packages/_sylius.yaml | ||
|
@@ -467,13 +484,17 @@ bin/console doctrine:migrations:migrate | |
``` | ||
#### 13. Copy Sylius templates overridden in plugin to your templates directory (e.g templates/bundles/): | ||
**Note:** Some directories may already exist in your project | ||
``` | ||
mkdir -p templates/bundles/SyliusAdminBundle/ | ||
mkdir -p templates/bundles/SyliusShopBundle/ | ||
mkdir -p templates/bundles/SyliusUiBundle/ | ||
mkdir -p templates/bundles/SyliusRefundPlugin/ | ||
``` | ||
**Note:** Ba aware that the following commands will override your existing templates! | ||
``` | ||
cp -R vendor/mollie/sylius-plugin/tests/Application/templates/bundles/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/ | ||
cp -R vendor/mollie/sylius-plugin/tests/Application/templates/bundles/SyliusShopBundle/* templates/bundles/SyliusShopBundle/ | ||
cp -R vendor/mollie/sylius-plugin/tests/Application/templates/bundles/SyliusUiBundle/* templates/bundles/SyliusUiBundle/ | ||
|
@@ -587,7 +608,7 @@ nvm use 12 | |
Ensure you have the following packages installed: | ||
|
||
```bash | ||
yarn add babel-preset-env bazinga-translator intl-messageformat lodash.get [email protected] [email protected] webpack-notifier | ||
yarn add @babel/preset-env bazinga-translator intl-messageformat lodash.get [email protected] [email protected] webpack-notifier | ||
yarn add --dev @babel/[email protected] @babel/[email protected] @babel/[email protected] @symfony/[email protected] | ||
``` | ||
|
||
|
@@ -610,3 +631,9 @@ Update the scheme, since webpack and asset require new tables that are not in th | |
```bash | ||
php bin/console doctrine:schema:update --force | ||
``` | ||
|
||
If you are missing translations, just clear the cache: | ||
|
||
```bash | ||
php bin/console cache:clear | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.