# This file is a part of the Sylius package.
# (c) Sylius Sp. z o.o.

sylius_shop_cart_summary:
    path: /
    methods: [GET]
    defaults:
        _controller: sylius.controller.order::summaryAction
        _sylius:
            template: "@SyliusShop/Cart/summary.html.twig"
            form: Sylius\Bundle\OrderBundle\Form\Type\CartType

sylius_shop_cart_save:
    path: /
    methods: [PUT, PATCH]
    defaults:
        _controller: sylius.controller.order::saveAction
        _sylius:
            template: "@SyliusShop/Cart/summary.html.twig"
            redirect:
                route: sylius_shop_cart_summary
                parameters: {}
            form: Sylius\Bundle\OrderBundle\Form\Type\CartType
            flash: sylius.cart.save

sylius_shop_cart_checkout:
    path: /checkout
    methods: [PATCH]
    defaults:
        _controller: sylius.controller.order::saveAction
        _sylius:
            template: "@SyliusShop/Cart/summary.html.twig"
            redirect: sylius_shop_checkout_start
            form: Sylius\Bundle\OrderBundle\Form\Type\CartType
            flash: false

sylius_shop_cart_clear:
    path: /
    methods: [DELETE]
    defaults:
        _controller: sylius.controller.order::clearAction
        _sylius:
            redirect: sylius_shop_cart_summary

sylius_shop_cart_item_remove:
    path: /{id}/remove
    methods: [DELETE]
    defaults:
        _controller: sylius.controller.order_item::removeAction
        _sylius:
            flash: sylius.cart.remove_item
            redirect:
                route: sylius_shop_cart_summary
                parameters: {}
