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

#9858 Fix for promotion of 100 percent with coupon #9919

Merged
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
Prev Previous commit
#9858 Directly change view transformer to percent float when building…
… the form for promotion
  • Loading branch information
laurent35240 committed Nov 18, 2018
commit c2af9ea1914be9fd69923098ed99591b13d8e368

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

namespace Sylius\Bundle\PromotionBundle\Form\Type\Action;

use Sylius\Bundle\PromotionBundle\Form\DataTransformer\PercentFloatToLocalizedStringTransformer;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\PercentType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Range;
Expand All @@ -27,7 +29,7 @@ final class PercentageDiscountConfigurationType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('percentage', PercentFloatType::class, [
->add('percentage', PercentType::class, [
'label' => 'sylius.form.promotion_action.percentage_discount_configuration.percentage',
'constraints' => [
new NotBlank(['groups' => ['sylius']]),
Expand All @@ -42,6 +44,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
],
])
;
$builder->get('percentage')->resetViewTransformers()->addViewTransformer(new PercentFloatToLocalizedStringTransformer());
}

/**
Expand Down