Created
February 18, 2016 14:23
-
-
Save pjedrzejewski/0eb9f6490aa134b7f565 to your computer and use it in GitHub Desktop.
Simplified cart actions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sylius_shop_add_to_cart: | |
path: /cart/ | |
methods: [POST] | |
defaults: | |
_controller: sylius.controller.cart_item:createAction | |
_sylius: | |
factory: | |
method: createForCart | |
arguments: | |
- 'expr:service('sylius.context.cart').getCart()' | |
sylius_shop_remove_from_cart: | |
path: /cart/{id} | |
methods: [DELETE] | |
defaults: | |
_controller: sylius.controller.cart_item.deleteAction | |
_sylius: | |
repository: | |
method: findOneByCartAndId | |
arguments: | |
- 'expr:service('sylius.context.cart').getCart()' | |
- $id | |
sylius_shop_clear_cart: | |
path: /cart/ | |
methods: [DELETE] | |
defaults: | |
_controller: sylius.controller.cart:deleteAction | |
_sylius: | |
repository: | |
method: find | |
arguments: ['expr:service('sylius.context.cart').getCart().getId()'] | |
sylius_shop_cart_summary: | |
path: /cart/ | |
methods: [GET, PUT, PATCH] | |
defaults: | |
_controller: sylius.controller.cart:updateAction | |
_sylius: | |
repository: | |
method: find | |
arguments: ['expr:service('sylius.context.cart').getCart().getId()'] | |
redirect: referer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment