DEV Community


Discussion on: Removing Products from the Cart | Building a Shopping Cart with Symfony

isabellebengrine profile image
Isabelle Bengrine • Edited

Thanks for this reply! of course, I realized later that the persist and flush parts are in the save method of the cartmanager! this was silly of me to ask about that... now if you are curious, I finally found what was preventing the remove and clear buttons to work properly: (oddly this did not prevent your project from working just fine, whereas mine could not): in the twig file we had : form_end(form, {'render_rest': false})
and I found on stackoverflow some comments about a similar issue to mine that said:
"But to submit it separately you must ensure that you're building the "complete" child form in your view" and looking at the forms, I thought we are displaying all the fields anyway, so why do we need this? so I removed the ", {'render_rest': false}" part and now it works!!!
I still do not quite understand why I had some trouble and you did not but this just shows I have so much to learn!!! anyway, again thanks for your help and your patience!!! I love your tutorials!!!