Skip to content

Commit

Permalink
core-2275 fixed checkout and login
Browse files Browse the repository at this point in the history
  • Loading branch information
stereomon committed Jan 30, 2018
1 parent 971932a commit f6e9a09
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions src/SprykerShop/Yves/CheckoutPage/Form/Steps/PaymentForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -145,15 +144,15 @@ protected function getPaymentMethodChoices(array $paymentMethodSubForms)
$subFormName = ucfirst($paymentMethodSubForm->getName());

if (!$paymentMethodSubForm instanceof SubFormProviderNameInterface) {
$choices[$paymentMethodSubForm->getPropertyPath()] = $subFormName;
$choices[$subFormName] = $paymentMethodSubForm->getPropertyPath();
continue;
}

if (!isset($choices[$paymentMethodSubForm->getProviderName()])) {
$choices[$paymentMethodSubForm->getProviderName()] = [];
}

$choices[$paymentMethodSubForm->getProviderName()][$paymentMethodSubForm->getPropertyPath()] = $subFormName;
$choices[$paymentMethodSubForm->getProviderName()][$subFormName] = $paymentMethodSubForm->getPropertyPath();
}

return $choices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{{ form_label(_view.paymentForm.paymentSelection[key]) }}
<div class="__toggler-target">
<div class="row columns">
{{ checkout.include_subform(_view.paymentForm[_view.paymentForm.paymentSelection[key].vars.value]) }}
{{ checkout.include_subform(_view.paymentForm[_view.paymentForm.paymentSelection[key].vars.value]) }}
</div>
</div>
</li>
Expand Down

0 comments on commit f6e9a09

Please sign in to comment.