I'm already implement the basic of SyliusCartBundle ( http://docs.sylius.org/en/latest/bundles/SyliusCartBundle/installation.html )
but the problem is the method to add item to a cart, because the only way that I know is with
<a href="{{ path('sylius_cart_item_add', {'productId': product.id}) }}">Add product to cart</a>
acording to http://docs.sylius.org/en/latest/bundles/SyliusCartBundle/actions.html
and I want to add a item without redirect the webpage.
sorry if is too basic but I only start with symfony 4 day ago.
Just like @zizoujal say is with ajax. But when I ask I was a beginner in MVC and I dont undestand the method.
The solution is:
Finally I dont use Symfony2 (SyliusCartBundle) but with a little more experience in MCV I can undestand and I implment my own action (in cakephp).
Not the best way to do it but it may help you:
Sylius/Bundle/CartBundle/Controller/CartItemController:addAction
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.