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

sylius_grid:
    grids:
        sylius_shop_product:
            driver:
                name: doctrine/orm
                options:
                    class: "%sylius.model.product.class%"
                    repository:
                        method: createShopListQueryBuilder
                        arguments:
                            channel: "expr:service('sylius.context.channel').getChannel()"
                            taxon: "expr:notFoundOnNull(service('sylius.repository.taxon').findOneBySlug($slug, service('sylius.context.locale').getLocaleCode()))"
                            locale: "expr:service('sylius.context.locale').getLocaleCode()"
                            sorting: "expr:service('request_stack').getCurrentRequest().get('sorting', [])"
                            includeAllDescendants: "expr:parameter('sylius_shop.product_grid.include_all_descendants')"
            sorting:
                position: asc
            limits: [9, 18, 27]
            fields:
                createdAt:
                    type: datetime
                    sortable: ~
                position:
                    type: string 
                    sortable: productTaxon.position
                name:
                    type: string 
                    sortable: translation.name
                price:
                    type: int
                    sortable: channelPricing.price
            filters:
                search:
                    type: shop_string
                    label: false
                    options:
                        fields: [translation.name]
                    form_options:
                        type: contains
