diff --git a/src/Form/Type/AddProductsToCartType.php b/src/Form/Type/AddProductsToCartType.php index a3d26c96..80611a66 100644 --- a/src/Form/Type/AddProductsToCartType.php +++ b/src/Form/Type/AddProductsToCartType.php @@ -48,6 +48,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void { /** @var WishlistProductInterface $wishlistProduct */ foreach ($options['wishlist_products'] as $key => $wishlistProduct) { + if (is_int($key)) { + $key = (string) $key; + } $builder ->add($key, AddToCartType::class, [ 'label' => false, diff --git a/src/Resources/views/WishlistDetails/index.html.twig b/src/Resources/views/WishlistDetails/index.html.twig index 6278954f..88165837 100644 --- a/src/Resources/views/WishlistDetails/index.html.twig +++ b/src/Resources/views/WishlistDetails/index.html.twig @@ -32,8 +32,10 @@ - {% for childForm in form.children if childForm.vars.name != '_token' %} - {% include "@BitBagSyliusWishlistPlugin/WishlistDetails/_item.html.twig" %} + {% for childForm in form.children %} + {% if childForm.vars.name != '_token' %} + {% include "@BitBagSyliusWishlistPlugin/WishlistDetails/_item.html.twig" %} + {% endif %} {% endfor %}