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

sylius_shop_partial_cart_summary:
    path: /summary
    methods: [GET]
    defaults:
        _controller: sylius.controller.order::widgetAction
        _sylius:
            template: $template

sylius_shop_partial_cart_add_item:
    path: /add-item
    methods: [GET]
    defaults:
        _controller: sylius.controller.order_item::addAction
        _sylius:
            template: $template
            factory:
                method: createForProduct
                arguments: [expr:notFoundOnNull(service('sylius.repository.product').find($productId))]
            form:
                type: Sylius\Bundle\CoreBundle\Form\Type\Order\AddToCartType
                options:
                    product: expr:notFoundOnNull(service('sylius.repository.product').find($productId))
            redirect:
                route: sylius_shop_cart_summary
                parameters: {}
