DEV Community

Discussion on: Managing the Cart Storage | Building a Shopping Cart with Symfony

Collapse
 
butachan profile image
butachan

Hi thanks for this great tutorial,
I am taking it as reference for my project. But I have some issues (probably beginner issues)
In my project, the user is required to build a cart, so I just use UserRepository as CartSessionStorage. Is that fine ?

Secondly, I don't know how Forms pass data. When I submit addtocart, I get "too few arguments to function entity OrderItem::__construct(), 0 passed ... at least 2 expected".
this error occurs before entering in the controller method. The arguments needed are Order from the current connected user and the current item. Maybe you have an idea. As I am beginner, I don't understand how forms work