문제

I apologize if this seems to be a very naive question..but i've just learnt Symfony2 and trying to learn the workings of Sylius.

When I add a product to the cart it seems to always return the error :

Submitted form is invalid

I have searched the solution to this but nothing seems to be documented (or have I missed it ??)

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

도움이 되었습니까?

해결책

It has something to do with having options on products. I had the same error and looking through the profiler at the Doctrine info there was an error for 2 of the objects that were being persisted to the database. Specifically, it couldn't map Sylius\Bundle\AssortmentBundle\Entity\CustomizableProduct or Sylius\Bundle\AssortmentBundle\Entity\Variant\Variant.

To fix it I had to Generate Variants of the product which is on the product details page in the admin area. Without having variants to add to the cart, it couldn't choose a specific type of the product to add to the cart.

I feel like this should produce a better error, especially when running the app in dev mode.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top