Merge pull request #6729 from davalb/master

fixes #6595
This commit is contained in:
Michał Marcinkowski 2016-11-16 18:41:37 +01:00 committed by GitHub
commit 31daf892ea

View file

@ -1,13 +1,14 @@
Routing and default actions
===========================
This bundle provides a quite simple default routing with several handy and common actions.
You can see the usage guide below.
Routing for cart-actions is available in the ShopBundle.
The ShopBundle is not individually available but it is included in the Sylius/Sylius repository.
You can see the usage guide for these actions below.
Cart summary page
-----------------
To point user to the cart summary page, you can use the ``sylius_cart_summary`` route.
To point user to the cart summary page, you can use the ``sylius_shop_cart_summary`` route.
It will render the page with the `cart` and `form` variables by default.
The `cart` is the current cart and `form` is the view of the cart form.
@ -19,7 +20,7 @@ In our simple example, we only need to add the following link in the places wher
.. code-block:: html
<a href="{{ path('sylius_cart_item_add', {'productId': product.id}) }}">Add product to cart</a>
<a href="{{ path('sylius_shop_cart_item_add', {'productId': product.id}) }}">Add product to cart</a>
Clicking this link will add the selected product to the cart.
@ -30,7 +31,7 @@ On the cart summary page you have access to all the cart items, so another simpl
.. code-block:: html
<a href="{{ path('sylius_cart_item_remove', {'id': item.id}) }}">Remove from cart</a>
<a href="{{ path('sylius_shop_cart_item_remove', {'id': item.id}) }}">Remove from cart</a>
Where `item` variable represents one of the `cart.items` collection items.
@ -41,7 +42,7 @@ Clearing the cart is simple as clicking the following link.
.. code-block:: html
<a href="{{ path('sylius_cart_clear')}}">Clear cart</a>
<a href="{{ path('sylius_shop_cart_clear')}}">Clear cart</a>
Basic cart update
-----------------
@ -51,6 +52,6 @@ with the following action.
.. code-block:: html
<form action="{{ path('sylius_cart_save') }}" method="post">Save cart</a>
<form action="{{ path('sylius_shop_cart_save') }}" method="post">Save cart</a>
You cart will be validated and saved if everything is alright.