@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | public function buildForm(FormBuilderInterface $builder, array $options): void |
| 28 | 28 | { |
| 29 | 29 | $builder->add('depositTaxCategory', TaxCategoryChoiceType::class, [ |
| 30 | - 'required' => false, |
|
| 31 | - 'placeholder' => '---', |
|
| 32 | - 'label' => 'gweb_deposit.admin.product_variant.tax_category', |
|
| 30 | + 'required' => false, |
|
| 31 | + 'placeholder' => '---', |
|
| 32 | + 'label' => 'gweb_deposit.admin.product_variant.tax_category', |
|
| 33 | 33 | ]); |
| 34 | 34 | |
| 35 | 35 | $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event): void { |
@@ -39,18 +39,18 @@ discard block |
||
| 39 | 39 | 'channelDeposits', |
| 40 | 40 | ChannelCollectionType::class, |
| 41 | 41 | [ |
| 42 | - 'entry_type' => ChannelDepositType::class, |
|
| 43 | - 'entry_options' => function (ChannelInterface $channel) use ($productVariant) { |
|
| 44 | - return [ |
|
| 42 | + 'entry_type' => ChannelDepositType::class, |
|
| 43 | + 'entry_options' => function (ChannelInterface $channel) use ($productVariant) { |
|
| 44 | + return [ |
|
| 45 | 45 | 'channel' => $channel, |
| 46 | 46 | 'product_variant' => $productVariant, |
| 47 | 47 | 'required' => false, |
| 48 | - ]; |
|
| 49 | - }, |
|
| 50 | - 'label' => 'gweb_deposit.admin.product_variant.price', |
|
| 48 | + ]; |
|
| 49 | + }, |
|
| 50 | + 'label' => 'gweb_deposit.admin.product_variant.price', |
|
| 51 | 51 | ] |
| 52 | 52 | ); |
| 53 | - } |
|
| 53 | + } |
|
| 54 | 54 | ); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -27,29 +27,29 @@ discard block |
||
| 27 | 27 | public function buildForm(FormBuilderInterface $builder, array $options): void |
| 28 | 28 | { |
| 29 | 29 | $builder->add( |
| 30 | - 'price', |
|
| 31 | - MoneyType::class, |
|
| 32 | - [ |
|
| 30 | + 'price', |
|
| 31 | + MoneyType::class, |
|
| 32 | + [ |
|
| 33 | 33 | 'label' => 'gweb_deposit.admin.product_variant.price', |
| 34 | 34 | 'required' => false, |
| 35 | 35 | 'currency' => $options['channel']->getBaseCurrency()->getCode(), |
| 36 | - ] |
|
| 36 | + ] |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | $builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) use ($options): void { |
| 40 | - $channelDeposit = $event->getData(); |
|
| 40 | + $channelDeposit = $event->getData(); |
|
| 41 | 41 | |
| 42 | - if (!$channelDeposit instanceof $this->dataClass) { |
|
| 43 | - $event->setData(null); |
|
| 42 | + if (!$channelDeposit instanceof $this->dataClass) { |
|
| 43 | + $event->setData(null); |
|
| 44 | 44 | |
| 45 | - return; |
|
| 46 | - } |
|
| 45 | + return; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - $channelDeposit->setChannelCode($options['channel']->getCode()); |
|
| 49 | - $channelDeposit->setProductVariant($options['product_variant']); |
|
| 48 | + $channelDeposit->setChannelCode($options['channel']->getCode()); |
|
| 49 | + $channelDeposit->setProductVariant($options['product_variant']); |
|
| 50 | 50 | |
| 51 | - $event->setData($channelDeposit); |
|
| 52 | - } |
|
| 51 | + $event->setData($channelDeposit); |
|
| 52 | + } |
|
| 53 | 53 | ); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -61,17 +61,17 @@ discard block |
||
| 61 | 61 | parent::configureOptions($resolver); |
| 62 | 62 | |
| 63 | 63 | $resolver |
| 64 | - ->setRequired('channel') |
|
| 65 | - ->setAllowedTypes('channel', [ChannelInterface::class]) |
|
| 66 | - ->setDefined('product_variant') |
|
| 67 | - ->setAllowedTypes('product_variant', ['null', ProductVariantInterface::class]) |
|
| 68 | - ->setDefaults( |
|
| 64 | + ->setRequired('channel') |
|
| 65 | + ->setAllowedTypes('channel', [ChannelInterface::class]) |
|
| 66 | + ->setDefined('product_variant') |
|
| 67 | + ->setAllowedTypes('product_variant', ['null', ProductVariantInterface::class]) |
|
| 68 | + ->setDefaults( |
|
| 69 | 69 | [ |
| 70 | - 'label' => function (Options $options): string { |
|
| 71 | - return $options['channel']->getName(); |
|
| 72 | - }, |
|
| 70 | + 'label' => function (Options $options): string { |
|
| 71 | + return $options['channel']->getName(); |
|
| 72 | + }, |
|
| 73 | 73 | ] |
| 74 | - ); |
|
| 74 | + ); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | public function getFilters(): array |
| 35 | 35 | { |
| 36 | 36 | return [ |
| 37 | - new TwigFilter('gweb_calculate_deposit', [$this->helper, 'getPrice']), |
|
| 37 | + new TwigFilter('gweb_calculate_deposit', [$this->helper, 'getPrice']), |
|
| 38 | 38 | ]; |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -29,11 +29,11 @@ |
||
| 29 | 29 | $menu = $event->getMenu(); |
| 30 | 30 | |
| 31 | 31 | $menu->addChild('deposit', ['position' => 1]) |
| 32 | - ->setAttribute( |
|
| 32 | + ->setAttribute( |
|
| 33 | 33 | 'template', |
| 34 | 34 | '@GwebSyliusProductDepositPlugin/Resources/views/Admin/ProductVariant/Tab/_deposit.html.twig' |
| 35 | - ) |
|
| 36 | - ->setLabel($this->translator->trans('gweb_deposit.admin.product_variant.menu')) |
|
| 37 | - ->setLabelAttribute('icon', 'dollar'); |
|
| 35 | + ) |
|
| 36 | + ->setLabel($this->translator->trans('gweb_deposit.admin.product_variant.menu')) |
|
| 37 | + ->setLabelAttribute('icon', 'dollar'); |
|
| 38 | 38 | } |
| 39 | 39 | } |