diff --git a/src/SprykerShop/Yves/CheckoutPage/Form/DataProvider/ShipmentFormDataProvider.php b/src/SprykerShop/Yves/CheckoutPage/Form/DataProvider/ShipmentFormDataProvider.php index 55192443..9b586fc7 100644 --- a/src/SprykerShop/Yves/CheckoutPage/Form/DataProvider/ShipmentFormDataProvider.php +++ b/src/SprykerShop/Yves/CheckoutPage/Form/DataProvider/ShipmentFormDataProvider.php @@ -101,9 +101,10 @@ protected function createAvailableShipmentChoiceList(QuoteTransfer $quoteTransfe if (!isset($shipmentMethods[$shipmentMethodTransfer->getCarrierName()])) { $shipmentMethods[$shipmentMethodTransfer->getCarrierName()] = []; } - $shipmentMethods[$shipmentMethodTransfer->getCarrierName()][$shipmentMethodTransfer->getIdShipmentMethod()] = $this->getShipmentDescription( + $description = $this->getShipmentDescription( $shipmentMethodTransfer ); + $shipmentMethods[$shipmentMethodTransfer->getCarrierName()][$description] = $shipmentMethodTransfer->getIdShipmentMethod(); } return $shipmentMethods; diff --git a/src/SprykerShop/Yves/CheckoutPage/Form/Steps/PaymentForm.php b/src/SprykerShop/Yves/CheckoutPage/Form/Steps/PaymentForm.php index 218b61fe..34388800 100644 --- a/src/SprykerShop/Yves/CheckoutPage/Form/Steps/PaymentForm.php +++ b/src/SprykerShop/Yves/CheckoutPage/Form/Steps/PaymentForm.php @@ -77,8 +77,7 @@ protected function addPaymentMethodChoices(FormBuilderInterface $builder, array self::PAYMENT_SELECTION, ChoiceType::class, [ - 'choices' => array_flip($paymentMethodChoices), - 'choices_as_values' => true, + 'choices' => $paymentMethodChoices, 'label' => false, 'required' => true, 'expanded' => true, @@ -145,7 +144,7 @@ protected function getPaymentMethodChoices(array $paymentMethodSubForms) $subFormName = ucfirst($paymentMethodSubForm->getName()); if (!$paymentMethodSubForm instanceof SubFormProviderNameInterface) { - $choices[$paymentMethodSubForm->getPropertyPath()] = $subFormName; + $choices[$subFormName] = $paymentMethodSubForm->getPropertyPath(); continue; } @@ -153,7 +152,7 @@ protected function getPaymentMethodChoices(array $paymentMethodSubForms) $choices[$paymentMethodSubForm->getProviderName()] = []; } - $choices[$paymentMethodSubForm->getProviderName()][$paymentMethodSubForm->getPropertyPath()] = $subFormName; + $choices[$paymentMethodSubForm->getProviderName()][$subFormName] = $paymentMethodSubForm->getPropertyPath(); } return $choices; diff --git a/src/SprykerShop/Yves/CheckoutPage/Form/Steps/ShipmentForm.php b/src/SprykerShop/Yves/CheckoutPage/Form/Steps/ShipmentForm.php index 99a20886..d7082e62 100644 --- a/src/SprykerShop/Yves/CheckoutPage/Form/Steps/ShipmentForm.php +++ b/src/SprykerShop/Yves/CheckoutPage/Form/Steps/ShipmentForm.php @@ -60,8 +60,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) protected function addShipmentMethods(FormBuilderInterface $builder, array $options) { $builder->add(self::FIELD_ID_SHIPMENT_METHOD, ChoiceType::class, [ - 'choices' => array_flip($options[self::OPTION_SHIPMENT_METHODS]), - 'choices_as_values' => true, + 'choices' => $options[self::OPTION_SHIPMENT_METHODS], 'expanded' => true, 'multiple' => false, 'required' => true, diff --git a/src/SprykerShop/Yves/CheckoutPage/Theme/default/checkout/payment.twig b/src/SprykerShop/Yves/CheckoutPage/Theme/default/checkout/payment.twig index 7d0b569f..3fd59273 100644 --- a/src/SprykerShop/Yves/CheckoutPage/Theme/default/checkout/payment.twig +++ b/src/SprykerShop/Yves/CheckoutPage/Theme/default/checkout/payment.twig @@ -21,7 +21,7 @@ {{ form_label(_view.paymentForm.paymentSelection[key]) }}