From 05a3d9ddd6217ed2bf48124ddf1e81fcd68b7704 Mon Sep 17 00:00:00 2001 From: David Buros Date: Wed, 20 Nov 2024 11:54:19 +0100 Subject: [PATCH] fix(sylius-compatibility): add missing channelPriceHistoryConfig field to management in channel form for Sylius 1.13 --- src/Form/Extension/ChannelTypeExtension.php | 1 + .../views/Admin/Channel/_noCommerceForm.html.twig | 5 +++++ src/Resources/views/Admin/Channel/_standardForm.html.twig | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/src/Form/Extension/ChannelTypeExtension.php b/src/Form/Extension/ChannelTypeExtension.php index 5825338..3983c65 100644 --- a/src/Form/Extension/ChannelTypeExtension.php +++ b/src/Form/Extension/ChannelTypeExtension.php @@ -56,6 +56,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ->remove('currencies') ->remove('defaultTaxZone') ->remove('taxCalculationStrategy') + ->remove('channelPriceHistoryConfig') ->addEventSubscriber(new RemoveBaseCurrencySubscriber()) ; } diff --git a/src/Resources/views/Admin/Channel/_noCommerceForm.html.twig b/src/Resources/views/Admin/Channel/_noCommerceForm.html.twig index 61259e0..0452369 100644 --- a/src/Resources/views/Admin/Channel/_noCommerceForm.html.twig +++ b/src/Resources/views/Admin/Channel/_noCommerceForm.html.twig @@ -80,5 +80,10 @@ {# {{ form_row(form.skippingPaymentStepAllowed) }}#} {{ form_row(form.accountVerificationRequired) }} +{#
#} +{# {{ form_row(form.channelPriceHistoryConfig.lowestPriceForDiscountedProductsVisible) }}#} +{# {{ form_row(form.channelPriceHistoryConfig.lowestPriceForDiscountedProductsCheckingPeriod) }}#} +{# {{ form_row(form.channelPriceHistoryConfig.taxonsExcludedFromShowingLowestPrice, {'remote_url': path('sylius_admin_ajax_taxon_by_name_phrase'), 'load_edit_url': path('sylius_admin_ajax_taxon_by_code')}) }}#} +{#
#} diff --git a/src/Resources/views/Admin/Channel/_standardForm.html.twig b/src/Resources/views/Admin/Channel/_standardForm.html.twig index ad5630f..b9400f2 100644 --- a/src/Resources/views/Admin/Channel/_standardForm.html.twig +++ b/src/Resources/views/Admin/Channel/_standardForm.html.twig @@ -80,5 +80,12 @@ {{ form_row(form.skippingPaymentStepAllowed) }} {{ form_row(form.accountVerificationRequired) }} + {% if form.channelPriceHistoryConfig is defined %} +
+ {{ form_row(form.channelPriceHistoryConfig.lowestPriceForDiscountedProductsVisible) }} + {{ form_row(form.channelPriceHistoryConfig.lowestPriceForDiscountedProductsCheckingPeriod) }} + {{ form_row(form.channelPriceHistoryConfig.taxonsExcludedFromShowingLowestPrice, {'remote_url': path('sylius_admin_ajax_taxon_by_name_phrase'), 'load_edit_url': path('sylius_admin_ajax_taxon_by_code')}) }} +
+ {% endif %}