โ€œAbove form is not validโ€ when adding product to cart: Sylius Cart Bundle

I apologize if this seems like a very naive question ... but I just learned Symfony2 and tried to learn how Sylius works .

When I add a product to the cart, it always returns an error:

Submitted form is invalid

I was looking for a solution to this question, but nothing is documented (or do I have missed this?)

I also commented on the validation section, but still getting the same error. Please help and thanks in advance.

+4
source share
1 answer

This is somehow related to the availability of options for products. I had the same error and viewing the profiler in the Doctrine information was an error for two objects that were stored in the database. In particular, it could not display Sylius \ Bundle \ AssortmentBundle \ Entity \ CustomizableProduct or Sylius \ Bundle \ AssortmentBundle \ Entity \ Variant \ Variant.

To fix this, I had to generate variants of the product, which is located on the product details page in the admin area. Having no options to add to the basket, he could not select a specific type of product to add to the basket.

It seems to me that this should lead to a better error, especially when starting the application in dev mode.

+2
source

Source: https://habr.com/ru/post/1487408/


All Articles