parameters:
    oro_product.sku.regex_pattern: '/^[-_a-zA-Z0-9]*$/'
    oro_product.sku.import_export.separator: '|'

services:
    oro_product.product.manager.api:
        class: 'Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager'
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - 'Oro\Bundle\ProductBundle\Entity\Product'
            - "@doctrine.orm.entity_manager"

    oro_product.brand.manager.api:
        class: 'Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager'
        public: true
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - 'Oro\Bundle\ProductBundle\Entity\Brand'
            - "@doctrine.orm.entity_manager"

    oro_product.service.quantity_rounding:
        class: 'Oro\Bundle\ProductBundle\Rounding\QuantityRoundingService'
        public: false
        parent: oro_currency.service.abstract_rounding

    Oro\Bundle\ProductBundle\Rounding\QuantityRoundingService:
        alias: 'oro_product.service.quantity_rounding'

    oro_product.formatter.unit_value:
        abstract: true
        class: 'Oro\Bundle\ProductBundle\Formatter\UnitValueFormatter'
        arguments:
            - '@translator'
            - '@oro_locale.formatter.number'

    oro_product.formatter.unit_label:
        abstract: true
        class: 'Oro\Bundle\ProductBundle\Formatter\UnitLabelFormatter'
        arguments:
            - "@translator"

    oro_product.formatter.product_unit_value:
        parent: oro_product.formatter.unit_value
        public: true
        calls:
            - [setTranslationPrefix, ['oro.product_unit']]

    oro_product.formatter.product_unit_label:
        parent: oro_product.formatter.unit_label
        public: true
        calls:
            - [setTranslationPrefix, ['oro.product_unit']]

    oro_product.formatter.unit_precision_label:
        class: 'Oro\Bundle\ProductBundle\Formatter\UnitPrecisionLabelFormatter'
        arguments:
            - '@oro_product.formatter.product_unit_label'
            - '@translator'

    oro_product.twig.product_unit_extension:
        class: 'Oro\Bundle\ProductBundle\Twig\ProductUnitExtension'
        public: false
        arguments:
            - "@oro_platform.twig.service_locator"
        tags:
            - { name: twig.extension }

    oro_product.twig.product_form_unit_fields_settings:
        class: 'Oro\Bundle\ProductBundle\Twig\ProductUnitFieldsSettingsExtension'
        public: false
        arguments:
            - "@oro_platform.twig.service_locator"
        tags:
            - { name: twig.extension }

    oro_product.twig.product_extension:
        class: Oro\Bundle\ProductBundle\Twig\ProductExtension
        public: false
        arguments:
            - "@oro_platform.twig.service_locator"
        tags:
            - { name: twig.extension }

    oro_product.twig.product_kit_item_extension:
        class: 'Oro\Bundle\ProductBundle\Twig\ProductKitItemExtension'
        arguments:
            - '@oro_platform.twig.service_locator'
        tags:
            - { name: twig.extension }

    oro_product.form.autocomplete.product.search_handler:
        parent: oro_form.autocomplete.search_handler
        arguments:
            - 'Oro\Bundle\ProductBundle\Entity\Product'
            - ['sku', 'defaultName.string']
        tags:
            - { name: oro_form.autocomplete.search_handler, alias: Oro\Bundle\ProductBundle\Form\Type\ProductType, acl_resource: oro_product_view }
            - { name: oro_form.autocomplete.search_handler, alias: oro_product_frontend, acl_resource: oro_product_frontend_view }

    oro_product.form.autocomplete.brand.search_handler:
        parent: oro_form.autocomplete.search_handler
        class: Oro\Bundle\ProductBundle\Autocomplete\BrandSearchHandler
        arguments:
            - 'Oro\Bundle\ProductBundle\Entity\Brand'
            - ['name']
            - '@oro_entity.entity_name_resolver'
        tags:
            - { name: oro_form.autocomplete.search_handler, acl_resource: oro_product_brand_view, alias: Oro\Bundle\ProductBundle\Form\Type\BrandType }

    oro_product.service.sku_incrementor:
        class: 'Oro\Bundle\ProductBundle\Duplicator\SkuIncrementor'
        public: false
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_security.acl_helper'
            - 'Oro\Bundle\ProductBundle\Entity\Product'

    oro_product.service.duplicator:
        class: 'Oro\Bundle\ProductBundle\Duplicator\ProductDuplicator'
        public: true
        arguments:
            - "@oro_entity.doctrine_helper"
            - "@event_dispatcher"
            - "@oro_attachment.file_manager"
            - "@oro_attachment.provider.attachment"
            - "@oro_product.service.sku_incrementor"

    oro_product.service.related_items_handler:
        class: 'Oro\Bundle\ProductBundle\Form\Handler\RelatedItemsHandler'
        arguments:
            - '@translator'
        calls:
            - [addAssigner, ['relatedProducts', '@oro_product.related_item.related_product.assigner_strategy']]
            - [addAssigner, ['upsellProducts', '@oro_product.related_item.upsell_product.assigner_strategy']]

    oro_product.service.product_update_handler:
        class: 'Oro\Bundle\ProductBundle\Form\Handler\ProductUpdateHandler'
        parent: oro_form.update_handler
        calls:
            - [setActionGroupRegistry, ['@oro_action.action_group_registry']]
            - [setTranslator, ['@translator']]
            - [setUrlGenerator, ['@router']]
            - [setRelatedItemsHandler, ['@oro_product.service.related_items_handler']]

    oro_product.storage.product_data_bag:
        class: Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag
        arguments:
            - '_product_data_bag'
        calls:
            - [setName, ['product_data_bag']]
        tags:
            - { name: oro_security.session_bag }

    oro_product.storage.session_data_storage:
        class: 'Oro\Bundle\ProductBundle\Storage\ProductDataStorage'
        abstract: true
        arguments:
            - '@request_stack'

    oro_product.storage.product_data_storage:
        public: true
        parent: oro_product.storage.session_data_storage

    oro_product.storage.product_website_reindex_request_data_storage:
        class: Oro\Bundle\ProductBundle\Storage\ProductWebsiteReindexRequestDataStorage
        arguments:
            - '@oro_product.driver.product_website_reindex_request_dbal_driver'
            - '@oro_website.website.provider'

    oro_product.validator.product_by_sku:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\ProductBySkuValidator'
        arguments:
            - "@doctrine"
            - "@oro_security.acl_helper"
        tags:
            - { name: validator.constraint_validator, alias: oro_product_product_by_sku_validator }

    oro_product.validator.quantity_unit_precision:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\QuantityUnitPrecisionValidator'
        arguments:
            - '@oro_product.service.quantity_rounding'
        tags:
            - { name: validator.constraint_validator, alias: oro_product_quantity_unit_precision }

    oro_product.validator.product_unit_exists:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\ProductUnitExistsValidator'
        tags:
            - { name: validator.constraint_validator, alias: oro_product_product_unit_exists }

    oro_product.validator.product_image:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\ProductImageValidator'
        public: true
        tags:
            - { name: validator.constraint_validator, alias: oro_product_image_validator }

    oro_product.validator.product_image_type:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\ProductImageTypeValidator'
        arguments:
            - "@oro_layout.provider.image_type"
            - "@translator"
        tags:
            - { name: validator.constraint_validator, alias: oro_product_image_type_validator }

    oro_product.validator.product_image_collection:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\ProductImageCollectionValidator'
        public: true
        arguments:
            - "@oro_layout.provider.image_type"
            - "@translator"
            - "@oro_product.helper.product_image_helper"
        tags:
            - { name: validator.constraint_validator, alias: oro_product_image_collection_validator }

    oro_product.validator.not_empty_configurable_attributes:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\NotEmptyConfigurableAttributesValidator'
        public: true
        arguments:
            - '@oro_product.provider.variant_field_provider'
        tags:
            - { name: validator.constraint_validator, alias: not_empty_configurable_attributes }

    oro_product.validator.product_page_template:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\ProductPageTemplateValidator'
        arguments:
            - '@oro_layout.page_templates_manager'
        tags:
            - { name: validator.constraint_validator, alias: oro_product_page_template_validator }

    oro_product.component_processor.filter:
        class: 'Oro\Bundle\ProductBundle\ComponentProcessor\ComponentProcessorFilter'
        public: false
        arguments:
            - "@oro_product.website_search.repository.product"

    Oro\Bundle\ProductBundle\Search\ProductRepository:
        alias: oro_product.website_search.repository.product

    oro_product.website_search.repository.product:
        parent: oro_website_search.repository.abstract
        public: true
        class: 'Oro\Bundle\ProductBundle\Search\ProductRepository'
        arguments:
            - '@event_dispatcher'
            - '@oro_config.manager'
        calls:
            - [setEntityName, ['Oro\Bundle\ProductBundle\Entity\Product']]

    oro_product.component_processor.registry:
        class: 'Oro\Bundle\ProductBundle\ComponentProcessor\ComponentProcessorRegistry'
        public: false

    oro_product.component_processor.data_storage_aware.processor:
        class: 'Oro\Bundle\ProductBundle\ComponentProcessor\DataStorageAwareComponentProcessor'
        arguments:
            - "@router"
            - "@oro_product.storage.product_data_storage"
            - "@security.authorization_checker"
            - "@oro_security.token_accessor"
            - "@session"
            - "@translator"
        calls:
            - [setComponentProcessorFilter,  ["@oro_product.component_processor.filter"]]
            - [setProductMapper, ["@oro_product.component_processor.quick_add_product_mapper"]]
        abstract: true

    oro_product.component_processor.quick_add_product_mapper:
        class: 'Oro\Bundle\ProductBundle\Model\Mapping\ProductMapper'
        arguments:
            - '@oro_product.component_processor.quick_add_product_mapper_data_accessor'
            - '@oro_product.component_processor.quick_add_product_mapper_data_loader'

    oro_product.component_processor.quick_add_product_mapper_data_accessor:
        class: 'Oro\Bundle\ProductBundle\ComponentProcessor\ComponentProcessorDataAccessor'

    oro_product.component_processor.quick_add_product_mapper_data_loader:
        class: 'Oro\Bundle\ProductBundle\ComponentProcessor\ComponentProcessorDataLoader'
        arguments:
            - '@oro_product.website_search.repository.product'

    oro_product.event_listener.related_items_product_edit_listener:
        class: Oro\Bundle\ProductBundle\EventListener\RelatedItemsProductEditListener
        arguments:
            - '@translator'
            - '@oro_product.related_item.helper.config_helper'
            - '@security.authorization_checker'
        tags:
            - { name: kernel.event_listener, event: oro_ui.scroll_data.before.product-edit, method: onProductEdit }
            - { name: kernel.event_listener, event: oro_ui.scroll_data.before.product-related-items-update, method: onProductEdit }
            - { name: kernel.event_listener, event: oro.form.update_handler.before_form_data_set.oro_product, method: onFormDataSet }

    oro_product.event_listener.product_grid_widget:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductGridWidgetRenderEventListener'
        arguments:
            - "@oro_datagrid.datagrid.request_parameters_factory"
        tags:
            - { name: kernel.event_listener, event: product_grid.render, method: onWidgetRender }

    oro_product.menu.frontend.quick_add:
        class: 'Oro\Bundle\ProductBundle\Menu\Frontend\QuickAddMenuBuilder'
        public: false
        arguments:
            - "@oro_product.component_processor.registry"
        tags:
            - { name: oro_menu.builder, alias: frontend_menu }

    oro_product.provider.custom_field_provider.cache:
        parent: oro.data.cache
        tags:
            - { name: 'cache.pool', namespace: 'oro_product_custom_fields' }

    oro_product.event_listener.entity_config:
        class: 'Oro\Bundle\CacheBundle\EventListener\CacheClearListener'
        arguments:
            - '@oro_product.provider.custom_field_provider.cache'
        tags:
            - { name: kernel.event_listener, event: oro.entity_config.post_flush, method: clearCache }

    oro_product.provider.custom_field_provider:
        class: 'Oro\Bundle\ProductBundle\Provider\CustomFieldProvider'
        arguments:
            - "@oro_entity_config.provider.extend"
            - "@oro_entity_config.provider.entity"
        calls:
            - [setCache, ['@oro_product.product_variant_field.field_value_handler.enum_type_handler.cache']]

    oro_product.provider.product_status_provider:
        class: 'Oro\Bundle\ProductBundle\Provider\ProductStatusProvider'
        public: true

    oro_product.provider.product_inventory_status_provider:
        class: 'Oro\Bundle\ProductBundle\Provider\ProductInventoryStatusProvider'
        public: true
        arguments:
            - '@doctrine'

    oro_product.provider.product_type_provider:
        class: 'Oro\Bundle\ProductBundle\Provider\ProductTypeProvider'
        public: true
        arguments:
            - !abstract '$availableProductTypes defined in Oro\Bundle\ProductBundle\DependencyInjection\OroProductExtension'

    oro_product.product_unit.cache:
        public: false
        parent: oro.data.cache
        tags:
              - { name: 'cache.pool', namespace: 'oro_product_unit' }

    oro_product.provider.product_units_provider:
        class: 'Oro\Bundle\ProductBundle\Provider\ProductUnitsProvider'
        public: true
        arguments:
            - '@doctrine'
            - '@oro_product.formatter.product_unit_label'
            - '@oro_product.product_unit.cache'

    oro_product.service.single_unit_mode:
        class: 'Oro\Bundle\ProductBundle\Service\SingleUnitModeService'
        public: false
        arguments:
            - "@oro_config.manager"

    oro_product.layout.data_provider.single_unit_mode:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\SingleUnitModeProvider'
        arguments:
            - "@oro_product.service.single_unit_mode"
        tags:
            - { name: layout.data_provider, alias: oro_product_single_unit_mode }

    oro_product.layout.data_provider.unit_visibility:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\UnitVisibilityProvider'
        arguments:
            - "@oro_product.visibility.unit"
        tags:
            - { name: layout.data_provider, alias: oro_unit_visibility }

    oro_product.layout.data_provider.product_unit_fields_settings:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\ProductUnitFieldsSettingsProvider'
        arguments:
            - "@oro_product.visibility.product_unit_fields_settings"
        tags:
            - { name: layout.data_provider, alias: oro_product_unit_fields_settings }

    oro_product.provider.default_product_unit_provider.chain:
        class: 'Oro\Bundle\ProductBundle\Provider\ChainDefaultProductUnitProvider'
        public: false
        arguments:
            - !tagged_iterator oro_product.default_product_unit_provider

    oro_product.provider.default_product_unit_provider.system:
        class: 'Oro\Bundle\ProductBundle\Provider\SystemDefaultProductUnitProvider'
        public: false
        arguments:
            - "@oro_config.manager"
            - "@oro_entity.doctrine_helper"
        tags:
            - { name: oro_product.default_product_unit_provider }

    oro_product.provider.default_product_unit_provider.single_unit:
        class: 'Oro\Bundle\ProductBundle\Provider\SingleUnitDefaultProductUnitProvider'
        public: false
        arguments:
            - "@oro_product.service.single_unit_mode"
            - "@oro_product.provider.default_product_unit_provider.system"
        tags:
            - { name: oro_product.default_product_unit_provider, priority: 240 }

    oro_product.event_listener.product_variant_custom_fields_datagrid:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductVariantCustomFieldsDatagridListener'
        arguments:
            - "@oro_entity.doctrine_helper"
            - "@oro_product.provider.custom_field_provider"
            - "@oro_product.provider.variant_field_provider"
            - 'Oro\Bundle\ProductBundle\Entity\Product'
            - 'Oro\Bundle\ProductBundle\Entity\ProductVariantLink'
        calls:
            - [setFieldAclHelper, ['@oro_security.form.field_acl_helper']]
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.product-product-variants-view, method: onBuildAfter }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.product-product-variants-edit, method: onBuildAfterEditGrid }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.before.product-product-variants-edit, method: onBuildBeforeHideUnsuitable }

    oro_product.validator.unique_variant_links:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\UniqueProductVariantLinksValidator'
        arguments:
            - '@property_accessor'
            - '@doctrine'
        tags:
            - { name: validator.constraint_validator, alias: oro_product_unique_variant_links }

    oro_product.validator.variant_links:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\ProductVariantLinksValidator'
        arguments:
            - '@property_accessor'
        tags:
            - { name: validator.constraint_validator, alias: oro_product_variant_links }

    oro_product.validator.unique_variant_links_simple_product:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\UniqueVariantLinksSimpleProductValidator'
        arguments:
            - '@validator'
            - '@doctrine'
        tags:
            - { name: validator.constraint_validator, alias: oro_product_unique_variant_links_simple_product }

    oro_product.validator.empty_variant_field_in_simple_product_for_variant_links:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\EmptyVariantFieldInSimpleProductForVariantLinksValidator'
        arguments:
            - '@property_accessor'
            - '@doctrine'
        tags:
            - { name: validator.constraint_validator, alias: oro_product_empty_variant_field_in_simple_product_for_variant_links }

    oro_product.validator.product_variant_field:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\ProductVariantFieldValidator'
        arguments:
            - '@oro_product.provider.custom_field_provider'
        tags:
            - { name: validator.constraint_validator, alias: oro_product_variant_field }

    oro_product.validator.attribute_family_usages_product_variant_field:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\AttributeFamilyUsageInVariantFieldValidator'
        arguments:
            - '@oro_entity_config.manager.attribute_manager'
            - '@oro_entity.doctrine_helper'
            - '@oro_entity_config.config_manager'
        tags:
            - { name: validator.constraint_validator, alias: oro_product_attribute_family_usage_in_variant_field }

    oro_product.validator.attribute_value_usages_product_variant_field:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\AttributeValueUsageInVariantValidator'
        arguments:
            - '@doctrine'
            - '@oro_entity_extend.enum_synchronizer'
        tags:
            - { name: validator.constraint_validator, alias: oro_product_attribute_value_usage_in_variant_field }

    oro_product.event_listener.restricted_products_datagrid:
        class: 'Oro\Bundle\ProductBundle\EventListener\RestrictedProductsDatagridEventListener'
        arguments:
            - "@request_stack"
            - "@oro_product.product.manager"
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.products-select-grid, method: onBuildAfter }

    oro_product.event_listener.command.platform_update:
        class: 'Oro\Bundle\ProductBundle\EventListener\PlatformUpdateCommandListener'
        arguments:
            - "@oro_entity_config.config_model_manager"
        tags:
            - { name: kernel.event_listener, event: console.command, method: onConsoleCommand }

    oro_product.entity.event_listener.product_collection_variant_reindex_message_send_listener:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductCollectionVariantReindexMessageSendListener'
        arguments:
            - '@oro_product.handler.async_reindex_product_collection_handler'
            - '@oro_product.helper.product_collection_segment'
            - '@oro_product.model.segment_message_factory'
        tags:
            - { name: doctrine.event_listener, event: postFlush }

    oro_product.event_listener.product_content_variant_reindex:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductContentVariantReindexEventListener'
        arguments:
            - "@event_dispatcher"
            - '@oro_entity.doctrine.field_updates_checker'
            - '@oro_product.entity.event_listener.product_collection_variant_reindex_message_send_listener'
            - "@?oro_web_catalog.provider.web_catalog_usage_provider"
        tags:
            - { name: doctrine.event_listener, event: onFlush }

    oro_product.model.product_visibility_query_builder_modifier:
        class: 'Oro\Bundle\ProductBundle\Model\ProductVisibilityQueryBuilderModifier'
        public: false

    oro_product.model.product_visibility_search_query_modifier:
        class: 'Oro\Bundle\ProductBundle\Model\ProductVisibilitySearchQueryModifier'
        public: false

    oro_product.autocomplete.product_visibility_limited.search_handler:
        class: 'Oro\Bundle\ProductBundle\Autocomplete\ProductVisibilityLimitedSearchHandler'
        arguments:
            - 'Oro\Bundle\ProductBundle\Entity\Product'
            - '@request_stack'
            - '@oro_product.product.manager'
            - '@oro_product.website_search.repository.product'
            - '@oro_locale.helper.localization'
            - '@oro_frontend.request.frontend_helper'
        calls:
            - [initDoctrinePropertiesByManagerRegistry, ['@doctrine']]
            - [setAclHelper, ['@oro_security.acl_helper']]
            - [setPropertyAccessor, ['@property_accessor']]
            - setNotAllowedProductTypes:
                -
                    - !php/const Oro\Bundle\ProductBundle\Entity\Product::TYPE_CONFIGURABLE
                    - !php/const Oro\Bundle\ProductBundle\Entity\Product::TYPE_KIT
        tags:
            - { name: oro_form.autocomplete.search_handler, alias: oro_product_visibility_limited }

    oro_product.autocomplete.configurable_product_visibility_limited.search_handler:
        parent: oro_product.autocomplete.product_visibility_limited.search_handler
        calls:
            - [setNotAllowedProductTypes, [[]]]
        tags:
            - { name: oro_form.autocomplete.search_handler, alias: oro_all_product_visibility_limited }

    oro_product.autocomplete.product_families.search_handler:
        class: 'Oro\Bundle\ProductBundle\Autocomplete\ProductFamilySearchHandler'
        arguments:
            - '@doctrine'
            - '@property_accessor'
            - '@oro_security.acl_helper'
        calls:
            - [setEntityNameResolver, ['@oro_entity.entity_name_resolver']]
        tags:
            - { name: oro_form.autocomplete.search_handler, alias: oro_product_families }

    oro_product.autocomplete.oro_product_visibility_limited_with_prices.search_handler:
        class: 'Oro\Bundle\ProductBundle\Autocomplete\ProductVisibilityLimitedWithPricesSearchHandler'
        arguments:
            - '@oro_pricing.form.autocomplete.product_with_prices.search_handler'
            - '@oro_product.autocomplete.product_visibility_limited.search_handler'
        tags:
            - { name: oro_form.autocomplete.search_handler, alias: oro_product_visibility_limited_with_prices }

    oro_product.product.manager:
        class: 'Oro\Bundle\ProductBundle\Entity\Manager\ProductManager'
        arguments:
            - "@event_dispatcher"

    oro_product.event_listener.restrict_disabled_products:
        class: 'Oro\Bundle\ProductBundle\EventListener\RestrictDisabledProductsEventListener'
        arguments:
            - "@oro_product.model.product_visibility_search_query_modifier"
            - "@oro_product.model.product_visibility_query_builder_modifier"
        tags:
            - { name: kernel.event_listener, event: oro_product.product_search_query.restriction, method: onSearchQuery }
            - { name: kernel.event_listener, event: oro_product.product_db_query.restriction, method: onDBQuery }

    oro_product.event_listener.abstract_product_db_query_restriction:
        abstract: true
        arguments:
            - "@oro_config.manager"
            - "@oro_product.model.product_visibility_query_builder_modifier"
            - "@oro_frontend.request.frontend_helper"

    oro_product.event_listener.product_db_query_restriction:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductDBQueryRestrictionEventListener'
        parent: oro_product.event_listener.abstract_product_db_query_restriction
        calls:
            - [setFrontendSystemConfigurationPath, ['oro_product.general_frontend_product_visibility']]
        tags:
            - { name: kernel.event_listener, event: oro_product.product_db_query.restriction, method: onDBQuery }

    oro_product.event_listener.abstract_product_search_query_restriction:
        abstract: true
        arguments:
            - "@oro_config.manager"
            - "@oro_product.model.product_visibility_search_query_modifier"
            - "@oro_frontend.request.frontend_helper"
            - "oro_product.general_frontend_product_visibility"

    oro_product.event_listener.product_search_query_restriction:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductSearchQueryRestrictionEventListener'
        parent: oro_product.event_listener.abstract_product_search_query_restriction
        tags:
            - { name: kernel.event_listener, event: oro_product.product_search_query.restriction, method: onSearchQuery }

    oro_product.repository.product:
        alias: Oro\Bundle\ProductBundle\Entity\Repository\ProductRepository

    Oro\Bundle\ProductBundle\Entity\Repository\ProductRepository:
        parent: oro_entity.abstract_repository
        arguments:
            - 'Oro\Bundle\ProductBundle\Entity\Product'
        tags:
            - { name: doctrine.repository_service }

    oro_product.repository.product_unit:
        alias: Oro\Bundle\ProductBundle\Entity\Repository\ProductUnitRepository

    Oro\Bundle\ProductBundle\Entity\Repository\ProductUnitRepository:
        parent: oro_entity.abstract_repository
        arguments:
            - 'Oro\Bundle\ProductBundle\Entity\ProductUnit'
        tags:
            - { name: doctrine.repository_service }

    Oro\Bundle\ProductBundle\Entity\Repository\ProductUnitPrecisionRepository:
        parent: oro_entity.abstract_repository
        arguments:
            - 'Oro\Bundle\ProductBundle\Entity\ProductUnitPrecision'
        tags:
            - { name: doctrine.repository_service }

    oro_product.repository.product_image:
        parent: oro_entity.abstract_repository
        arguments:
            - 'Oro\Bundle\ProductBundle\Entity\ProductImage'
        tags:
            - { name: doctrine.repository_service }

    Oro\Bundle\ProductBundle\Entity\Repository\CollectionSortOrderRepository:
        parent: oro_entity.abstract_repository
        arguments:
            - 'Oro\Bundle\ProductBundle\Entity\CollectionSortOrder'
        tags:
            - { name: doctrine.repository_service }

    oro_product.model.builder.quick_add_row_input_parser:
        class: 'Oro\Bundle\ProductBundle\Model\Builder\QuickAddRowInputParser'
        arguments:
            - '@oro_product.provider.product_units_provider'
            - '@oro_locale.formatter.number'

    oro_product.model.builder.quick_add_row_product_mapper:
        class: 'Oro\Bundle\ProductBundle\Model\Builder\QuickAddRowProductMapperAdapter'
        arguments:
            - '@oro_product.model.builder.quick_add_row_product_mapper.implementation'

    oro_product.model.builder.quick_add_row_product_mapper.implementation:
        class: 'Oro\Bundle\ProductBundle\Model\Mapping\ProductMapper'
        arguments:
            - '@oro_product.model.builder.quick_add_row_product_mapper_data_accessor'
            - '@oro_product.model.builder.quick_add_row_product_mapper_data_loader'

    oro_product.model.builder.quick_add_row_product_mapper_data_accessor:
        class: 'Oro\Bundle\ProductBundle\Model\Builder\QuickAddRowDataAccessor'

    oro_product.model.builder.quick_add_row_product_mapper_data_loader:
        class: 'Oro\Bundle\ProductBundle\Model\Builder\QuickAddRowDataLoader'
        arguments:
            - '@oro_product.model.builder.quick_add_row_product_loader'

    oro_product.model.builder.quick_add_row_product_loader:
        class: 'Oro\Bundle\ProductBundle\Model\Builder\QuickAddRowProductLoader'
        arguments:
            - '@doctrine'
            - '@oro_product.product.manager'
            - '@oro_security.acl_helper'
        calls:
            -
                setNotAllowedProductTypes:
                    -
                        - !php/const Oro\Bundle\ProductBundle\Entity\Product::TYPE_CONFIGURABLE
                        - !php/const Oro\Bundle\ProductBundle\Entity\Product::TYPE_KIT

    oro_product.model.builder.quick_add_row_collection:
        class: 'Oro\Bundle\ProductBundle\Model\Builder\QuickAddRowCollectionBuilder'
        arguments:
            - '@oro_product.model.builder.quick_add_row_input_parser'
            - '@oro_product.model.builder.quick_add_row_product_mapper'

    oro_product.model.quick_add_row_product_grouper:
        class: 'Oro\Bundle\ProductBundle\Model\Grouping\QuickAddRowGrouper'

    oro_product.datagrid_theme_helper:
        class: 'Oro\Bundle\ProductBundle\DataGrid\DataGridThemeHelper'
        public: false
        arguments:
            - '@request_stack'
            - '@session'

    Oro\Bundle\ProductBundle\DataGrid\DataGridThemeHelper:
        alias: 'oro_product.datagrid_theme_helper'

    oro_product.event_listener.frontend_product_search_datagrid:
        class: 'Oro\Bundle\ProductBundle\EventListener\FrontendProductDatagridListener'
        arguments:
            - '@oro_product.datagrid_theme_helper'
            - '@oro_product.provider.product_image_placeholder'
            - '@oro_ui.tools.url_helper'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.pre.frontend-product-search-grid, method: onPreBuild }
            - { name: kernel.event_listener, event: oro_datagrid.search_datasource.result.after.frontend-product-search-grid, method: onResultAfter }

    oro_product.event_listener.frontend_product_search_datagrid.webp_aware:
        class: 'Oro\Bundle\ProductBundle\EventListener\WebpAwareFrontendProductDatagridListener'
        arguments:
            - '@oro_product.datagrid_theme_helper'
            - '@oro_product.provider.product_image_placeholder'
            - '@oro_attachment.tools.webp_configuration'
            - '@oro_ui.tools.url_helper'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.pre.frontend-product-search-grid, method: onPreBuild }
            - { name: kernel.event_listener, event: oro_datagrid.search_datasource.result.after.frontend-product-search-grid, method: onResultAfter }

    oro_product.event_listener.doctrine.product_variants_changed:
        class: Oro\Bundle\ProductBundle\EventListener\Doctrine\ProductVariantsChangedListener
        arguments:
            - '@oro_product.search.product_reindex_manager'
        tags:
            - { name: doctrine.orm.entity_listener, entity_manager: default, entity: 'Oro\Bundle\ProductBundle\Entity\ProductVariantLink', event: prePersist}
            - { name: doctrine.orm.entity_listener, entity_manager: default, entity: 'Oro\Bundle\ProductBundle\Entity\ProductVariantLink', event: preRemove}

    oro_product.event_listener.doctrine.product_unit:
        class: Oro\Bundle\ProductBundle\EventListener\Doctrine\ProductUnitEntityListener
        public: false
        arguments:
            - '@oro_product.provider.product_units_provider'
        tags:
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\ProductBundle\Entity\ProductUnit', event: postPersist, method: invalidateProductUnitCache }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\ProductBundle\Entity\ProductUnit', event: postUpdate, method: invalidateProductUnitCache }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\ProductBundle\Entity\ProductUnit', event: postRemove, method: invalidateProductUnitCache }

    oro_product.event_listener.product_handler:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductHandlerListener'
        arguments:
            - '@property_accessor'
            - '@logger'
        tags:
            - { name: kernel.event_listener, event: oro.form.update_handler.before_entity_flush, method: onBeforeFlush }

    oro_product.layout.data_provider.product_form:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\ProductFormProvider'
        arguments:
            - '@form.factory'
            - '@router'
            - '@oro_product.provider.product_variant_availability_provider'
            - '@doctrine'
        tags:
            - { name: layout.data_provider, alias: oro_product_form }

    oro_product.product_list_event_dispatcher:
        class: Oro\Bundle\ProductBundle\Event\ProductListEventDispatcher
        arguments:
            - '@event_dispatcher'

    oro_product.product_list_builder:
        class: Oro\Bundle\ProductBundle\Provider\ProductListBuilder
        arguments:
            - '@oro_search.query_factory'
            - '@oro_product.product_list_event_dispatcher'

    oro_product.event_listener.product_list:
        class: Oro\Bundle\ProductBundle\EventListener\ProductListEventListener
        arguments:
            - '@oro_product.provider.product_image_placeholder'
            - '@oro_attachment.tools.webp_configuration'
            - '@oro_ui.tools.url_helper'
        tags:
            - { name: kernel.event_listener, event: oro_product.product_list.build_query, method: onBuildQuery, priority: 10 }
            - { name: kernel.event_listener, event: oro_product.product_list.build_result, method: onBuildResult, priority: 10 }

    oro_product.provider.frontend_product_units_provider:
        class: Oro\Bundle\ProductBundle\Provider\FrontendProductUnitsProvider
        arguments:
            - '@doctrine'

    oro_product.provider.product_matrix_availability_provider:
        class: 'Oro\Bundle\ProductBundle\Provider\ProductMatrixAvailabilityProvider'
        arguments:
            - '@oro_product.provider.product_variant_availability_provider'
            - '@oro_product.provider.frontend_product_units_provider'

    oro_product.provider.product_view_form_availability:
        class: 'Oro\Bundle\ProductBundle\Provider\ProductFormAvailabilityProvider'
        arguments:
            - '@oro_config.manager'
            - 'oro_product.matrix_form_on_product_view'
            - '@oro_product.provider.product_matrix_availability_provider'
            - '@oro_ui.user_agent_provider'

    oro_product.provider.product_list_form_availability:
        class: 'Oro\Bundle\ProductBundle\Provider\ProductFormAvailabilityProvider'
        arguments:
            - '@oro_config.manager'
            - 'oro_product.matrix_form_on_product_listing'
            - '@oro_product.provider.product_matrix_availability_provider'
            - '@oro_ui.user_agent_provider'

    oro_product.layout.data_provider.product_view_form_availability_provider:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\ProductViewFormAvailabilityProvider'
        arguments:
            - '@oro_product.provider.product_view_form_availability'
            - '@oro_product.provider.product_matrix_availability_provider'
            - '@oro_config.manager'
            - '@oro_ui.user_agent_provider'
        tags:
            - { name: layout.data_provider, alias: product_view_form_availability_provider }

    oro_product.layout.data_provider.product_list_form_availability_provider:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\ProductListFormAvailabilityProvider'
        arguments:
            - '@oro_product.provider.product_list_form_availability'
        tags:
            - { name: layout.data_provider, alias: product_list_form_availability_provider }

    oro_product.layout.data_provider.product_variant:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\ProductVariantProvider'
        arguments:
            - '@oro_product.provider.product_variant_availability_provider'
        tags:
            - { name: layout.data_provider, alias: oro_product_variant }

    oro_product.event_listener.website_search_segment:
        class: 'Oro\Bundle\ProductBundle\EventListener\WebsiteSearchSegmentListener'
        arguments:
            - '@oro_product.provider.content_variant_segment_provider'
            - '@oro_segment.static_segment_manager'
        tags:
            - { name: kernel.event_listener, event: oro_website_search.before_reindex, method: process }

    oro_product.provider.website_search_index_data:
        class: 'Oro\Bundle\ProductBundle\Search\WebsiteSearchProductIndexDataProvider'
        arguments:
            - '@oro_entity_config.registry.attribute_type'
            - '@oro_entity_config.provider.attribute_configuration'
            - '@oro_product.provider.index_fields'
            - '@property_accessor'
            - '@oro_website_search.attribute.searchable_information_provider'

    oro_product.provider.website_search_index_data.product_variants:
        class: 'Oro\Bundle\ProductBundle\Search\ProductVariantIndexDataProviderDecorator'
        decorates: 'oro_product.provider.website_search_index_data'
        decoration_inner_name: 'oro_product.provider.website_search_index_data.original'
        arguments:
            - '@oro_product.provider.website_search_index_data.original'
            - '@doctrine'

    oro_product.event_listener.website_search_index:
        class: 'Oro\Bundle\ProductBundle\EventListener\WebsiteSearchProductIndexerListener'
        arguments:
            - '@oro_website.provider.website_localization'
            - '@oro_website_search.manager.website_context_manager'
            - '@doctrine'
            - '@oro_entity_config.manager.attribute_manager'
            - '@oro_product.provider.website_search_index_data'
        tags:
            - { name: kernel.event_listener, event: oro_website_search.event.index_entity.product, method: onWebsiteSearchIndex, priority: -255 }

    oro_product.event_listener.website_search_index.webp_aware:
        class: 'Oro\Bundle\ProductBundle\EventListener\WebpAwareWebsiteSearchProductIndexerListener'
        arguments:
            - '@doctrine'
            - '@oro_attachment.manager'
            - '@oro_website_search.manager.website_context_manager'
        tags:
            - { name: kernel.event_listener, event: oro_website_search.event.index_entity.product, method: onWebsiteSearchIndex, priority: -255 }

    oro_product.event_listener.website_search_index_image:
        class: 'Oro\Bundle\ProductBundle\EventListener\WebsiteSearchProductImageListener'
        arguments:
            - '@oro_website_search.manager.website_context_manager'
            - '@doctrine'
            - '@oro_attachment.manager'
        tags:
            - { name: kernel.event_listener, event: oro_website_search.event.index_entity.product, method: onWebsiteSearchIndex, priority: -255 }

    oro_product.event_listener.restrict_index_products:
        class: 'Oro\Bundle\ProductBundle\EventListener\RestrictIndexProductsEventListener'
        arguments:
            - '@oro_config.manager'
            - '@oro_product.model.product_visibility_query_builder_modifier'
            - '@oro_website_search.manager.website_context_manager'
            - 'oro_product.general_frontend_product_visibility'
        tags:
            - { name: kernel.event_listener, event: oro_website_search.event.restrict_index_entity.product, method: onRestrictIndexEntityEvent }

    oro_product.event_listener.restrict_product_variant_event:
        class: 'Oro\Bundle\ProductBundle\EventListener\RestrictProductVariantEventListener'
        arguments:
            - '@oro_config.manager'
            - '@oro_product.model.product_visibility_query_builder_modifier'
            - 'oro_product.general_frontend_product_visibility'
        tags:
            - { name: kernel.event_listener, event: oro_product.event.restrict_product_variant_event, method: onRestrictProductVariantEvent }

    oro_product.layout.data_provider.cache:
        parent: oro.data.cache
        public: false
        tags:
              - { name: 'cache.pool', namespace: 'oro_product' }

    oro_product.entity_listener.segment:
        class: 'Oro\Bundle\ProductBundle\Entity\EntityListener\SegmentEntityListener'
        public: false
        arguments:
            - '@oro_product.layout.data_provider.cache'
        tags:
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\SegmentBundle\Entity\Segment', event: preUpdate }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\SegmentBundle\Entity\Segment', event: preRemove }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\SegmentBundle\Entity\Segment', event: postPersist }

    oro_product.layout.segment_products_query_cache:
        class: Oro\Bundle\ProductBundle\Layout\SegmentProducts\SegmentProductsQueryCache
        arguments:
            - '@doctrine'
            - '@oro_security.encoder.default'
            - '@oro_product.layout.data_provider.cache'
            - 3600

    oro_product.layout.segment_products_query_provider:
        class: Oro\Bundle\ProductBundle\Layout\SegmentProducts\SegmentProductsQueryProvider
        arguments:
            - '@security.token_storage'
            - '@oro_website.manager'
            - '@oro_segment.segment_manager'
            - '@oro_product.product.manager'
            - '@oro_product.layout.segment_products_query_cache'

    oro_product.layout.data_provider.featured_products:
        class: Oro\Bundle\ProductBundle\Layout\DataProvider\FeaturedProductsProvider
        arguments:
            - '@oro_product.layout.segment_products_query_provider'
            - '@oro_product.provider.segment'
            - '@oro_product.product_list_builder'
            - '@oro_security.acl_helper'
            - '@oro_config.manager'
        tags:
            - { name: layout.data_provider, alias: featured_products }

    oro_product.layout.data_provider.new_arrivals:
        class: Oro\Bundle\ProductBundle\Layout\DataProvider\NewArrivalsProvider
        arguments:
            - '@oro_product.layout.segment_products_query_provider'
            - '@oro_product.provider.segment'
            - '@oro_product.product_list_builder'
            - '@oro_security.acl_helper'
            - '@oro_config.manager'
        tags:
            - { name: layout.data_provider, alias: new_arrivals }

    oro_product.layout.data_provider.segment_products:
        class: Oro\Bundle\ProductBundle\Layout\DataProvider\SegmentProductsProvider
        arguments:
            - '@oro_product.layout.segment_products_query_provider'
            - '@oro_product.product_list_builder'
            - '@oro_security.acl_helper'
        tags:
            - { name: layout.data_provider, alias: segment_products }

    oro_product.event_listener.product_image_listener:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductImageListener'
        public: false
        arguments:
            - '@event_dispatcher'
            - '@oro_layout.provider.image_type'
            - '@oro_product.helper.product_image_helper'
        tags:
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\ProductBundle\Entity\ProductImage', event: postPersist }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\ProductBundle\Entity\ProductImage', event: postUpdate }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\AttachmentBundle\Entity\File', event: postUpdate, method: filePostUpdate }
            - { name: doctrine.event_listener, event: postFlush }
            - { name: doctrine.event_listener, event: onClear }

    oro_product.migration.demo_data_fixtures_listener.product_image:
        parent: oro_platform.event_listener.demo_data_fixtures_listener.abstract
        calls:
            - [disableListener, ['oro_product.event_listener.product_image_resize_listener']]
        tags:
            - { name: kernel.event_listener, event: oro_migration.data_fixtures.pre_load, method: onPreLoad }
            - { name: kernel.event_listener, event: oro_migration.data_fixtures.post_load, method: onPostLoad }

    oro_product.event_listener.product_image_resize_listener:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductImageResizeListener'
        arguments:
            - '@oro_message_queue.client.message_producer'
        tags:
            - { name: kernel.event_listener, event: oro_product.product_image.resize, method: resizeProductImage }

    oro_product.event_listener.product_images_configuration_listener:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductImagesConfigurationListener'
        arguments:
            - '@session'
            - '@translator'
        tags:
            - { name: kernel.event_listener, event: oro_config.update_after, method: afterUpdate }

    oro_product.provider.watermark_image_filter:
        class: 'Oro\Bundle\ProductBundle\Provider\WatermarkImageFilterProvider'
        arguments:
            - '@oro_config.global'
            - '@oro_entity.doctrine_helper'
            - '@oro_attachment.file_manager'
        tags:
            - { name: layout.image_filter.provider }

    oro_product.async.resize_product_image_processor:
        class: 'Oro\Bundle\ProductBundle\Async\ResizeProductImageMessageProcessor'
        arguments:
            - '@doctrine'
            - '@oro_product.provider.product_images_dimensions'
            - '@oro_attachment.manager.image_resize'
        tags:
            - { name: oro_message_queue.client.message_processor }

    oro_product.product_visibility_restriction_listener:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductVisibilityRestrictionListener'
        arguments:
            - '@oro_product.product.manager'
            - '@oro_website_search.provider.search_mapping'
        tags:
            - { name: kernel.event_listener, event: oro_website_search.before_search, method: process }

    oro_product.exception.product_access_listener:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductAccessExceptionListener'
        arguments:
           - "@request_stack"
        tags:
            - { name: kernel.event_listener, event: kernel.exception, method: onAccessException, priority: 1000 }

    oro_product.content_variant_type.product_page:
        class: Oro\Bundle\ProductBundle\ContentVariantType\ProductPageContentVariantType
        public: false
        arguments:
            - '@security.authorization_checker'
            - '@property_accessor'
        tags:
            - { name: oro_web_catalog.content_variant_type }

    oro_product.content_variant_type.product_collection:
        class: Oro\Bundle\ProductBundle\ContentVariantType\ProductCollectionContentVariantType
        public: false
        arguments:
            - '@security.authorization_checker'
        tags:
            - { name: oro_web_catalog.content_variant_type }

    oro_product.provider.routing_information_provider:
        class: Oro\Bundle\ProductBundle\Provider\ProductRoutingInformationProvider
        arguments:
            - '@oro_config.global'
        tags:
            - { name: oro_redirect.routing_information_provider, alias: 'Oro\Bundle\ProductBundle\Entity\Product' }

    oro_product.provider.brand.routing_information_provider:
        class: Oro\Bundle\ProductBundle\Provider\BrandRoutingInformationProvider
        arguments:
            - '@oro_config.global'
        tags:
            - { name: oro_redirect.routing_information_provider, alias: 'Oro\Bundle\ProductBundle\Entity\Brand' }

    oro_product.provider.product_content_variant_provider:
        class: Oro\Bundle\ProductBundle\Provider\ProductContentVariantProvider
        public: false
        tags:
            - { name: oro_web_catalog.content_variant_provider }

    oro_product.provider.product_collection_content_variant_provider:
        class: Oro\Bundle\ProductBundle\Provider\ProductCollectionContentVariantProvider
        public: false
        tags:
            - { name: oro_web_catalog.content_variant_provider }

    oro_product.event_listener.attribute_family_form_view:
        parent: oro_entity_config.event_listener.attribute_family_form_view.abstract
        tags:
            - { name: kernel.event_listener, event: oro_ui.scroll_data.before.product-create-step-one, method: onEdit }

    oro_product.event_listener.attributes_form_view:
        parent: oro_entity_config.event_listener.attributes_form_view.abstract
        class: Oro\Bundle\ProductBundle\EventListener\AttributeFormViewListener
        arguments:
            - '@oro_entity_config.provider.entity'
            - '@translator'
        tags:
            - { name: kernel.event_listener, event: oro_ui.scroll_data.before.product-edit, method: onEdit, priority: -255 }
            - { name: kernel.event_listener, event: oro_ui.scroll_data.before.product-create-step-two, method: onEdit, priority: -255 }
            - { name: kernel.event_listener, event: oro_ui.scroll_data.before.product-view, method: onViewList, priority: -255 }

    oro_product.event_listener.product_multi_file_block_listener:
        class: Oro\Bundle\ProductBundle\EventListener\ProductMultiFileBlockListener
        arguments:
            - '@oro_entity_config.provider.entity'
        calls:
            - [setPages, [['product-visibility-edit', 'product-create-step-one']]]
        tags:
            - { name: kernel.event_listener, event: entity_form.render.before, method: onBeforeFormRender, priority: -250 }

    oro_product.provider.product_variant_availability_provider:
        class: 'Oro\Bundle\ProductBundle\Provider\ProductVariantAvailabilityProvider'
        arguments:
            - '@doctrine'
            - '@oro_product.provider.custom_field_provider'
            - '@property_accessor'
            - '@event_dispatcher'
            - '@oro_product.product_variant_field.registry.product_variant_field_value_handler_registry'

    oro_product.product_variant.registry.product_variant_type_handler_factory:
        class: 'Oro\Bundle\ProductBundle\ProductVariant\Registry\ProductVariantTypeHandlerRegistry'
        calls:
            - [addHandler,  ['@oro_product.product_variant.type_handler.enum_type_handler']]
            - [addHandler,  ['@oro_product.product_variant.type_handler.boolean_type_handler']]

    oro_product.product_variant_field.registry.product_variant_field_value_handler_registry:
        public: false
        class: 'Oro\Bundle\ProductBundle\ProductVariant\Registry\ProductVariantFieldValueHandlerRegistry'
        calls:
            - [addHandler, ['@oro_product.product_variant_field.field_value_handler.enum_type_handler']]
            - [addHandler, ['@oro_product.product_variant_field.field_value_handler.boolean_type_handler']]

    oro_product.product_variant_field.field_value_handler.enum_type_handler.cache:
        parent: oro.data.cache
        tags:
            - { name: 'cache.pool', namespace: 'oro_product_possible_field_values' }

    oro_product.event_listener.cache.enum_value:
        class: Oro\Bundle\CacheBundle\EventListener\CacheClearListener
        arguments:
            - '@oro_product.product_variant_field.field_value_handler.enum_type_handler.cache'
        tags:
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\EnumValueTranslation', event: postPersist, method: clearCache }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\EnumValueTranslation', event: postUpdate, method: clearCache }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\EnumValueTranslation', event: postRemove, method: clearCache }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\AbstractEnumValue', event: postPersist, method: clearCache }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\AbstractEnumValue', event: postUpdate, method: clearCache }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\AbstractEnumValue', event: postRemove, method: clearCache }
            - { name: kernel.event_listener, event: oro.entity_extend.entity.schema.update, method: clearCache }

    oro_product.product_variant_field.field_value_handler.enum_type_handler:
        class: 'Oro\Bundle\ProductBundle\ProductVariant\VariantFieldValueHandler\EnumVariantFieldValueHandler'
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_entity_extend.enum_value_provider'
            - '@logger'
            - '@oro_entity_config.config_manager'
            - '@oro_locale.helper.localization'
            - '@oro_locale.settings'
        calls:
            - [setCache, ['@oro_product.product_variant_field.field_value_handler.enum_type_handler.cache']]

    oro_product.product_variant_field.field_value_handler.boolean_type_handler:
        public: false
        class: 'Oro\Bundle\ProductBundle\ProductVariant\VariantFieldValueHandler\BooleanVariantFieldValueHandler'
        arguments:
            - '@translator'

    oro_product.product_variant.type_handler.enum_type_handler:
        class: 'Oro\Bundle\ProductBundle\ProductVariant\TypeHandler\EnumTypeHandler'
        arguments:
            - '@form.factory'
            - 'Oro\Bundle\ProductBundle\Entity\Product'
            - '@oro_entity_config.config_manager'

    oro_product.product_variant.type_handler.boolean_type_handler:
        class: 'Oro\Bundle\ProductBundle\ProductVariant\TypeHandler\BooleanTypeHandler'
        arguments:
            - '@form.factory'

    oro_product.visibility.product_unit_fields_settings:
        class: 'Oro\Bundle\ProductBundle\Visibility\BasicProductUnitFieldsSettings'
        arguments:
            - "@oro_entity.doctrine_helper"

    oro_product.visibility.single_unit_mode_product_unit_fields_settings_decorator:
        class: 'Oro\Bundle\ProductBundle\Visibility\SingleUnitModeProductUnitFieldsSettingsDecorator'
        public: false
        decorates: oro_product.visibility.product_unit_fields_settings
        decoration_priority: 10
        arguments:
            - "@.inner"
            - "@oro_product.service.single_unit_mode"
            - "@oro_entity.doctrine_helper"

    oro_product.visibility.unit:
        class: 'Oro\Bundle\ProductBundle\Visibility\BasicUnitVisibility'

    oro_product.visibility.single_unit_mode_unit:
        class: 'Oro\Bundle\ProductBundle\Visibility\SingleUnitModeUnitVisibilityDecorator'
        public: false
        decorates: oro_product.visibility.unit
        decoration_priority: 10
        arguments:
            - "@.inner"
            - "@oro_product.service.single_unit_mode"

    oro_product.event_listener.unit_visibility.datagrid_basic:
        class: 'Oro\Bundle\ProductBundle\EventListener\UnitVisibilityModeDataGridListener'
        abstract: true
        arguments:
            - 'unitCode'
            - 'quantity'
            - '@@OroProduct/ProductUnit/Datagrid/quantity.html.twig'
            - {isShortUnitCode: true}
            - '@oro_product.service.single_unit_mode'

    oro_product.layout.data_provider.configurable_products:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\ConfigurableProductProvider'
        arguments:
            - '@oro_product.provider.custom_field_provider'
            - '@property_accessor'
            - '@oro_product.product_variant_field.registry.product_variant_field_value_handler_registry'
            - '@translator'
        tags:
            - { name: layout.data_provider, alias: oro_product_configurable_products }

    oro_product.layout.attribute_block_type_mapper:
        parent: oro_entity_config.block_type.abstract_attribute_block_type_mapper
        calls:
            - [addBlockTypeUsingMetadata, ['Oro\Bundle\ProductBundle\Entity\ProductImage', 'attribute_product_images']]
            - [addBlockTypeUsingMetadata, ['Oro\Bundle\ProductBundle\Entity\Brand', 'attribute_product_brand']]
        tags:
            - { name: oro_entity_config.layout.attribute_block_type_mapper }

    oro_product.virtual_fields.decorator_cache:
        parent: oro.cache.adapter.array
        public: false
        tags:
            - { name: 'cache.pool', namespace: 'virtual_fields_decorator_cache' }

    oro_product.virtual_fields.decorator_factory:
        class: 'Oro\Bundle\ProductBundle\VirtualFields\VirtualFieldsProductDecoratorFactory'
        public: false
        arguments:
            - '@oro_product.virtual_fields.select_query_converter'
            - '@doctrine'
            - '@oro_entity.helper.field_helper'
            - '@oro_product.virtual_fields.decorator_cache'
            - '@oro_entity_config.provider.attribute'

    oro_product.virtual_fields.select_query_converter:
            class: 'Oro\Bundle\ProductBundle\VirtualFields\QueryDesigner\VirtualFieldsSelectQueryConverter'
            arguments:
                - '@oro_query_designer.query_designer.manager'
                - '@oro_entity.virtual_field_provider'
                - '@oro_entity.virtual_relation_provider'
                - '@oro_entity.doctrine_helper'

    oro_product.event_listener.before_remove_field_listener:
        class: 'Oro\Bundle\ProductBundle\EventListener\ValidateBeforeRemoveFieldListener'
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@translator'
        tags:
            - { name: kernel.event_listener, event: oro.entity_extend.field.validate.before_remove, method: onValidateBeforeRemoveField }

    oro_product.provider.page_template_provider:
        class: 'Oro\Bundle\ProductBundle\Provider\PageTemplateProvider'
        arguments:
            - '@oro_layout.theme_manager'
            - '@oro_entity.fallback.resolver.entity_fallback_resolver'

    oro_product.config.event_listener.direct_url_prefix_change:
        class: Oro\Bundle\RedirectBundle\EventListener\ConfigRegenerateDirectUrlListener
        arguments:
            - '@oro_config.manager'
            - '@oro_message_queue.client.message_producer'
            - '@oro_redirect.form.storage.redirect_storage'
            - '@oro_redirect.direct_url_message_factory'
            - 'oro_product.product_direct_url_prefix'
            - 'Oro\Bundle\ProductBundle\Entity\Product'
        tags:
            - { name: kernel.event_listener, event: oro_config.update_after, method: onUpdateAfter }

    oro_product.twig.product_image_extension:
        class: Oro\Bundle\ProductBundle\Twig\ProductImageExtension
        public: false
        arguments:
            - '@oro_platform.twig.service_locator'
        tags:
            - { name: twig.extension }

    oro_product.security.acl.voter.product_collection_segment:
        class: Oro\Bundle\ProductBundle\Acl\Voter\ProductCollectionSegmentVoter
        public: false
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@Psr\Container\ContainerInterface'
        calls:
            - [setClassName, ['Oro\Bundle\SegmentBundle\Entity\Segment']]
        tags:
            - { name: security.voter, priority: 500 }
            - { name: container.service_subscriber, id: oro_product.provider.content_variant_segment_provider }

    oro_product.security.acl.voter.product_status:
        class: Oro\Bundle\ProductBundle\Acl\Voter\ProductStatusVoter
        public: false
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_frontend.request.frontend_helper'
        calls:
            - [setClassName, ['Oro\Bundle\ProductBundle\Entity\Product']]
        tags:
            - { name: security.voter, priority: 100 }

    oro_product.event_listener.restrict_product_view_by_inventory_status:
        class: Oro\Bundle\ProductBundle\EventListener\RestrictProductViewByInventoryStatusListener
        public: false
        arguments:
            - "@oro_config.manager"
        tags:
            - { name: kernel.event_listener, event: kernel.controller, method: onKernelController, priority: -100 }

    oro_product.feature.voter.feature_simple_variations_view_restriction:
        class: Oro\Bundle\ProductBundle\Feature\Voter\SimpleVariationsRestrictionFeatureVoter
        arguments:
            - '@oro_config.manager'
        tags:
            - { name: oro_featuretogle.voter }

    oro_product.event_listener.restrict_variant_product_view:
        class: Oro\Bundle\ProductBundle\EventListener\RestrictVariantProductViewListener
        public: false
        tags:
            - { name: oro_featuretogle.feature, feature: 'simple_variations_view_restriction' }
            - { name: kernel.event_listener, event: kernel.controller, method: onKernelController, priority: -100 }

    oro_product.provider.content_variant_segment_provider:
        class: Oro\Bundle\ProductBundle\Provider\ContentVariantSegmentProvider
        public: true
        arguments:
            - '@oro_entity.doctrine_helper'

    oro_product.event_listener.product_collection_content_variant_datagrid:
        class: Oro\Bundle\ProductBundle\EventListener\ProductCollectionContentVariantDatagridListener
        arguments:
            - '@request_stack'
            - '@oro_datagrid.datagrid.name_strategy'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.before.product-collection-content-variant-grid, method: onBuildBefore }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.product-collection-content-variant-grid, method: onBuildAfter }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.content-node-product-collection-widget-grid, method: onBuildAfter }

    oro_product.event_listener.product_collection_datagrid:
        class: Oro\Bundle\ProductBundle\EventListener\ProductCollectionDatagridListener
        arguments:
            - '@request_stack'
            - '@oro_segment.segment_manager'
            - '@doctrine'
            - '@oro_datagrid.datagrid.name_strategy'
            - '@oro_product.service.product_collection_definition_converter'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.product-collection-grid, method: onBuildAfter }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.product-collection-content-variant-grid, method: onBuildAfter }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.content-node-product-collection-widget-grid, method: onBuildAfter }

    oro_product.provider.segment_with_relations_provider:
        class: Oro\Bundle\ProductBundle\Provider\CronSegmentsProvider
        public: false
        arguments:
            - '@oro_product.provider.content_variant_segment_provider'

    oro_product.model.segment_message_factory:
        class: Oro\Bundle\ProductBundle\Model\SegmentMessageFactory
        public: false
        arguments:
            - '@doctrine'

    oro_product.async.reindex_product_collection_processor:
        class: Oro\Bundle\ProductBundle\Async\ReindexProductCollectionProcessor
        arguments:
            - '@oro_message_queue.job.runner'
            - '@oro_product.model.segment_message_factory'
            - '@oro_segment.provider.segment_snapshot_delta_provider'
            - '@oro_product.storage.product_website_reindex_request_data_storage'
        calls:
            - ['setLogger', ['@logger']]
        tags:
            - { name: 'oro_message_queue.client.message_processor' }

    oro_product.event_listener.product_collections_schedule_configuration:
        class: Oro\Bundle\ProductBundle\EventListener\ProductCollectionsScheduleConfigurationListener
        arguments:
            - '@oro_cron.deferred_scheduler'
        tags:
            - { name: kernel.event_listener, event: oro_config.update_after, method: onUpdateAfter }

    oro_product.helper.product_collection_segment:
        class: Oro\Bundle\ProductBundle\Helper\ProductCollectionSegmentHelper
        public: false
        arguments:
            - '@oro_product.provider.content_variant_segment_provider'
            - '@?oro_web_catalog.provider.web_catalog_usage_provider'

    oro_product.event_listener.product_collection_aware_content_variant_entity_listener:
        public: false
        class: Oro\Bundle\ProductBundle\EventListener\ProductCollectionAwareContentVariantEntityListener
        arguments:
            - '@oro_product.entity.event_listener.product_collection_variant_reindex_message_send_listener'
            - '@oro_product.service.product_collection_definition_converter'
        tags:
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\SegmentBundle\Entity\Segment', event: postPersist }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\SegmentBundle\Entity\Segment', event: preUpdate }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\SegmentBundle\Entity\Segment', event: preRemove }

    oro_product.handler.request_content_variant:
        class: Oro\Bundle\ProductBundle\Handler\RequestContentVariantHandler
        arguments:
            - "@request_stack"

    oro_product.handler.search_product_handler:
        class: Oro\Bundle\ProductBundle\Handler\SearchProductHandler
        arguments: ['@request_stack']

    oro_product.event_listener.product_collection_sort_order_listener:
        public: false
        class: Oro\Bundle\ProductBundle\EventListener\ProductCollectionSortOrderListener
        arguments:
            - '@request_stack'
            - '@event_dispatcher'
        tags:
            - { name: doctrine.event_listener, event: onFlush }
            - { name: doctrine.event_listener, event: postFlush }
            - { name: doctrine.event_listener, event: onClear }

    oro_product.handler.collection_sort_order:
        class: Oro\Bundle\ProductBundle\Handler\CollectionSortOrderHandler
        arguments:
            - '@oro_entity.doctrine_helper'

    oro_product.handler.async_reindex_product_collection_handler:
        class: Oro\Bundle\ProductBundle\Handler\AsyncReindexProductCollectionHandler
        arguments:
            - '@oro_message_queue.job.runner'
            - '@oro_message_queue.job.dependent_job_service'
            - '@oro_message_queue.message_producer'
            - '@oro_product.model.segment_message_factory'

    oro_product.datagrid.event_listener.product_collection_content_variant_filtering:
        class: Oro\Bundle\ProductBundle\DataGrid\EventListener\ProductCollectionContentVariantFilteringEventListener
        arguments:
            - '@oro_product.handler.request_content_variant'
            - '@doctrine'
            - '@oro_config.manager'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.pre.frontend-product-search-grid, method: onPreBuild }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.frontend-product-search-grid, method: onBuildAfter }
            - { name: kernel.event_listener, event: oro_datagrid.search_datasource.result.before.frontend-product-search-grid, method: onSearchResultBefore }

    oro_product.datagrid.event_listener.search_event_listener:
        class: Oro\Bundle\ProductBundle\DataGrid\EventListener\SearchEventListener
        arguments:
            - '@oro_product.handler.search_product_handler'
            - '@oro_product.website_search.repository.product'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.pre.frontend-product-search-grid, method: onPreBuild }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.frontend-product-search-grid, method: onBuildAfter }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.pre.website-search-term-run-original-search-grid, method: onPreBuild }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.website-search-term-run-original-search-grid, method: onBuildAfter }

    oro_product.datagrid.event_listener.frontend_product_grid:
        class: 'Oro\Bundle\ProductBundle\DataGrid\EventListener\FrontendProductGridEventListener'
        arguments:
            - '@oro_entity_config.manager.attribute_manager'
            - '@oro_entity_config.registry.attribute_type'
            - '@oro_entity_config.provider.attribute_configuration'
            - '@oro_entity.doctrine_helper'
            - '@oro_config.manager'
            - '@oro_datagrid.tools.parameters_helper'
            - '@oro_product.provider.family_attribute_counts'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.pre.frontend-product-search-grid, method: onPreBuild }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.pre.website-search-term-run-original-search-grid, method: onPreBuild }

    oro_product.datagrid.event_listener.product_grid:
        class: 'Oro\Bundle\ProductBundle\DataGrid\EventListener\ProductGridEventListener'
        arguments:
            - '@doctrine'
            - '@oro_datagrid.provider.selected_fields'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.orm_datasource.result.after.products-grid, method: onResultAfter }

    oro_product.datagrid.event_listener.product_grid_attribute_family:
        class: 'Oro\Bundle\ProductBundle\DataGrid\EventListener\AttributeFamilyColumnOnProductsListener'
        arguments:
            - '@oro_entity.entity_name_resolver'
            - '@doctrine'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.before.products-grid, method: onBuildBefore }

    oro_product.provider.catalog_context_url_provider:
        class: Oro\Bundle\ProductBundle\Provider\ContentVariantContextUrlProvider
        public: false
        arguments:
            - '@request_stack'
            - '@oro_redirect.url_cache'
            - '@oro_locale.provider.current_localization'
        tags:
            - { name: oro_redirect.context_url_provider, alias: 'content_variant' }

    oro_product.provider.variant_field_provider:
        class: 'Oro\Bundle\ProductBundle\Provider\VariantFieldProvider'
        public: false
        arguments:
            - '@oro_entity_config.manager.attribute_manager'
            - '@oro_entity_config.provider.serialized_field_provider'

    oro_product.provider.grid_count_provider:
        class: Oro\Bundle\ProductBundle\Provider\GridCountProvider
        public: true
        arguments:
            - '@oro_datagrid.datagrid.manager'
            - '@security.authorization_checker'
            - '@oro_datagrid.extension.pager.orm.pager'

    oro_product.provider.brand_status_provider:
        class: 'Oro\Bundle\ProductBundle\Provider\BrandStatusProvider'
        public: true

    oro_product.service.product_collection_definition_converter:
        class: Oro\Bundle\ProductBundle\Service\ProductCollectionDefinitionConverter
        public: true
        arguments:
            - '@oro_query_designer.query_designer.segment_filters_purifier'

    oro_product.event_listener.product_collection_datagrid_parameters_for_selected_products_grid:
        class: Oro\Bundle\ProductBundle\EventListener\ProductCollectionDatagridParametersListener
        calls:
            - [setParameterName,  ['selectedProducts']]
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.product-collection-selected-products-grid, method: onBuildAfter }

    oro_product.event_listener.product_collection_datagrid_parameters_for_add_products_grid:
        class: Oro\Bundle\ProductBundle\EventListener\ProductCollectionDatagridParametersListener
        calls:
            - [setParameterName,  ['hiddenProducts']]
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.product-collection-add-products-base-grid, method: onBuildAfter }

    oro_product.datagrid.extension.mass_action.trigger_event_for_selected_product_ids_mass_action_handler:
        class: Oro\Bundle\ProductBundle\DataGrid\Extension\MassAction\TriggerEventForSelectedProductIdsMassActionHandler
        public: true
        arguments:
            - '@oro_config.manager'
            - '@translator'

    oro_product.datagrid.extension.mass_action.action.trigger_event_for_selected_product_ids_mass_action:
        class: Oro\Bundle\ProductBundle\DataGrid\Extension\MassAction\Action\TriggerEventForSelectedProductIdsMassAction
        shared: false
        tags:
            - { name: oro_datagrid.extension.mass_action.type, type: trigger-event-for-selected-product-ids }

    oro_product.event_listener.product_stickers_frontend_datagrid:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductStickersFrontendDatagridListener'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.pre.frontend-product-search-grid, method: onPreBuild }
            - { name: kernel.event_listener, event: oro_datagrid.search_datasource.result.after.frontend-product-search-grid, method: onResultAfter }

    oro_product.layout.data_provider.product_stickers:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\ProductStickersProvider'
        arguments:
            - "@oro_config.manager"
        tags:
            - { name: layout.data_provider, alias: oro_product_stickers }

    oro_product.layout.data_provider.search_product:
        class: Oro\Bundle\ProductBundle\Layout\DataProvider\SearchProductDataProvider
        arguments:
            - "@oro_product.handler.search_product_handler"
            - "@translator"
        tags:
            - { name: layout.data_provider, alias: oro_product_search }

    oro_product.layout.data_provider.product_filtered_image:
        parent: oro_layout.layout.data_provider.filtered_image.abstract
        public: true
        arguments:
            - '@oro_attachment.manager'
            - '@oro_product.provider.product_image_placeholder'
        tags:
            - { name: layout.data_provider, alias: product_filtered_image }

    oro_product.provider.segment:
        class: Oro\Bundle\ProductBundle\Provider\ProductSegmentProvider
        arguments:
            - '@oro_segment.segment_manager'
            - '@oro_organization.organization_restriction_provider'
            - '@logger'

    oro_product.provider.product_images_urls:
        class: 'Oro\Bundle\ProductBundle\Provider\ProductImagesURLsProvider'
        arguments:
            - '@doctrine'
            - '@oro_attachment.manager'
            - '@oro_product.helper.product_image_helper'

    oro_product.provider.product_images_urls.webp_aware:
        class: 'Oro\Bundle\ProductBundle\Provider\WebpAwareProductImagesURLsProvider'
        parent: oro_product.provider.product_images_urls
        decorates: oro_product.provider.product_images_urls

    oro_product.provider.product_images_dimensions:
        class: 'Oro\Bundle\ProductBundle\Provider\ProductImagesDimensionsProvider'
        arguments:
            - '@oro_layout.provider.image_type'

    oro_product.provider.product_image_file_name:
        class: Oro\Bundle\ProductBundle\Provider\ProductImageFileNameProvider
        decorates: oro_attachment.provider.file_name
        arguments:
            - '@.inner'
            - '@oro_attachment.tools.file_name_extension_helper'
        tags:
            - { name: oro_featuretogle.feature, feature: product_original_filenames }

    oro_product.provider.product_image_file_names:
        class: Oro\Bundle\ProductBundle\Provider\ProductImageFileNamesProvider
        decorates: oro_attachment.provider.image_file_names
        arguments:
            - '@.inner'
            - '@oro_config.manager'
            - '@oro_featuretoggle.checker.feature_checker'

    oro_product.event_listener.attribute_changes:
        class: 'Oro\Bundle\ProductBundle\EventListener\AttributeChangesListener'
        arguments:
            - '@request_stack'
            - '@oro_message_queue.client.message_producer'
        tags:
            - { name: kernel.event_listener, event: oro.entity_config.post_flush, method: postFlush }
            - { name: kernel.event_listener, event: oro.entity_config.pre_flush, method: preFlush }

    oro_product.event_listener.attribute_family_changes:
        class: 'Oro\Bundle\ProductBundle\EventListener\AttributeFamilyChangesListener'
        arguments:
            - '@request_stack'
            - '@doctrine'
            - '@event_dispatcher'
        tags:
            - { name: doctrine.event_listener, event: onFlush }
            - { name: doctrine.event_listener, event: postFlush }

    oro_product.provider.index_fields:
        class: 'Oro\Bundle\ProductBundle\Search\ProductIndexFieldsProvider'
        public: false
        # These attributes are forced to be indexed as a separate fields because they are used at main product grid of front store
        calls:
            - [addForceIndexed,  ['sku']]
            - [addForceIndexed,  ['names']]
            - [addForceIndexed,  ['shortDescriptions']]
            - [addForceIndexed,  ['newArrival']]

    oro_product.event_listener.website_search_mapping:
        class: 'Oro\Bundle\ProductBundle\EventListener\WebsiteSearchMappingListener'
        arguments:
            - '@oro_entity_config.manager.attribute_manager'
            - '@oro_entity_config.registry.attribute_type'
            - '@oro_entity_config.provider.attribute_configuration'
            - '@oro_product.provider.index_fields'
            - '@oro_website_search.attribute.searchable_information_provider'
        tags:
            - { name: kernel.event_listener, event: oro_website_search.event.website_search_mapping.configuration, method: onWebsiteSearchMapping }

    oro_product.voter.guest_quick_order:
        parent: oro_customer.voter.anonymous_customer_user
        calls:
            - [ setFeatureName, ['guest_quick_order_form'] ]
        tags:
            - { name: oro_featuretogle.voter }

    oro_product.voter.customer_user_guest_quick_order:
        parent: oro_customer.voter.customer_user
        calls:
            - [ setFeatureName, ['guest_quick_order_form'] ]
        tags:
            - { name: oro_featuretogle.voter }

    oro_product.voter.guest_quick_order_form:
        class: 'Oro\Bundle\ProductBundle\Voter\GuestQuickOrderFormVoter'
        arguments:
           - '@oro_featuretoggle.voter.config_voter'
           - '@security.token_storage'
           - 'guest_quick_order'
        abstract: true

    oro_product.voter.guest_quick_order_form.config:
        class: 'Oro\Bundle\ProductBundle\Voter\GuestQuickOrderFormVoter'
        arguments:
            - '@oro_featuretoggle.voter.config_voter'
            - '@security.token_storage'
            - 'guest_quick_order_form'
        calls:
            - [ setFeatureName, ['guest_quick_order_config'] ]
        tags:
            - { name: oro_featuretogle.voter }

    oro_product.provider.brand_entity_name:
        class: Oro\Bundle\ProductBundle\Provider\BrandEntityNameProvider
        tags:
            - { name: oro_entity.name_provider, priority: 100 }

    oro_product.provider.product_entity_name:
        class: Oro\Bundle\ProductBundle\Provider\ProductEntityNameProvider
        tags:
            - { name: oro_entity.name_provider, priority: 100 }

    oro_product.provider.product_kit_item_entity_name:
        class: Oro\Bundle\ProductBundle\Provider\ProductKitItemEntityNameProvider
        tags:
            - { name: oro_entity.name_provider, priority: 100 }

    oro_product.provider.serialized_field_provider:
        class: 'Oro\Bundle\ProductBundle\Provider\SerializedFieldProvider'
        decorates: oro_entity_config.provider.serialized_field_provider
        arguments:
            - '@oro_entity_config.provider.extend'

    oro_product.entity_alias_provider:
        class: Oro\Bundle\ProductBundle\Provider\ProductEntityAliasProvider
        public: false
        arguments:
            - '@oro_entity_config.config_manager'
            - '@oro_entity.entity_alias_duplicate_resolver'
            - '@Doctrine\Inflector\Inflector'
        tags:
            - { name: oro_entity.alias_provider }

    oro_product.helper.product_image_helper:
        class: Oro\Bundle\ProductBundle\Helper\ProductImageHelper

    oro_product.validator.product_image_type_collection:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\ProductImageTypeCollectionValidator'
        public: true
        arguments:
            - "@oro_layout.provider.image_type"
            - "@translator"
        tags:
            - { name: validator.constraint_validator, alias: oro_product_image_type_collection_validator }

    oro_product.search.product_reindex_manager:
        class: 'Oro\Bundle\ProductBundle\Search\Reindex\ProductReindexManager'
        public: false
        arguments:
            - '@event_dispatcher'

    oro_product.layout.data_provider.row_view_theme:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\RowViewThemeProvider'
        arguments:
            - '@oro_product.datagrid_theme_helper'
        tags:
            - { name: layout.data_provider, alias: oro_product_datagrid_row_view }

    oro_product.action.condition.at_least_one_available_product:
        class: Oro\Bundle\ProductBundle\Action\Condition\AtLeastOneAvailableProduct
        arguments:
            - "@oro_product.repository.product"
            - "@oro_product.product.manager"
            - "@oro_security.acl_helper"
        tags:
            - { name: oro_action.condition, alias: at_least_one_available_product }

    oro_product.action.remove_restricted_products:
        class: Oro\Bundle\ProductBundle\Action\RemoveRestrictedProducts
        arguments:
            - '@oro_product.repository.product'
            - '@oro_product.product.manager'
            - '@oro_security.acl_helper'
            - '@oro_action.expression.context_accessor'
        tags:
            - { name: oro_action.action, alias: remove_restricted_products }

    oro_product.async.reindex_products_by_attributes_processor:
        class: Oro\Bundle\ProductBundle\Async\ReindexProductsByAttributesProcessor
        arguments:
            - '@oro_message_queue.job.runner'
            - '@doctrine'
            - '@event_dispatcher'
        calls:
            - ['setLogger', ['@logger']]
        tags:
            -
              name: 'oro_message_queue.client.message_processor'
              topicName: !php/const Oro\Bundle\ProductBundle\Async\Topic\ReindexProductsByAttributesTopic::NAME

    oro_product.async.reindex_request_item_products_by_related_job_processor:
        class: Oro\Bundle\ProductBundle\Async\ReindexRequestItemProductsByRelatedJobProcessor
        arguments:
            - '@oro_product.storage.product_website_reindex_request_data_storage'
            - '@oro_message_queue.job.runner'
            - '@oro_message_queue.client.message_producer'
        calls:
            - ['setLogger', ['@logger']]
        tags:
            -
              name: 'oro_message_queue.client.message_processor'
              topicName: !php/const Oro\Bundle\ProductBundle\Async\Topic\ReindexRequestItemProductsByRelatedJobIdTopic::NAME

    oro_product.config.event_listener.display_simple_variations_listener:
        class: Oro\Bundle\ProductBundle\EventListener\Config\DisplaySimpleVariationsListener
        arguments:
            - '@oro_product.layout.data_provider.cache'
            - '@oro_catalog.layout.data_provider.category.cache'
            - 'oro_product.display_simple_variations'
        tags:
            - { name: kernel.event_listener, event: oro_config.update_after, method: onUpdateAfter }

    oro_product.event_listener.restrict_display_product_variants:
        class: 'Oro\Bundle\ProductBundle\EventListener\Visibility\Restrictions\RestrictProductVariationsEventListener'
        arguments:
            - "@oro_config.manager"
            - "@oro_frontend.request.frontend_helper"
            - "@oro_product.model.restrict_display_product_variants_query_builder_modifier"
        tags:
            - { name: kernel.event_listener, event: oro_product.product_search_query.restriction, method: onSearchQuery }
            - { name: kernel.event_listener, event: oro_product.product_db_query.restriction, method: onDBQuery }

    oro_product.event_listener.reindex_parent_configurable_product:
        class: 'Oro\Bundle\ProductBundle\EventListener\Search\ReindexParentConfigurableProductListener'
        public: false
        arguments:
            - '@oro_website.indexation_entities_container'
        tags:
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\ProductBundle\Entity\Product', event: postPersist }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\ProductBundle\Entity\Product', event: postUpdate }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\ProductBundle\Entity\Product', event: preRemove }

    oro_product.model.restrict_display_product_variants_query_builder_modifier:
        class: 'Oro\Bundle\ProductBundle\Model\RestrictProductVariationsBuilderModifier'
        public: false
        arguments:
            - '@oro_entity.doctrine_helper'

    oro_product.datagrid.event_listener.frontend_product_clean_up:
        class: 'Oro\Bundle\ProductBundle\DataGrid\EventListener\FrontendProductCleanUpListener'
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_security.acl_helper'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.search_datasource.result.after.frontend-product-search-grid, method: onSearchResultAfter }
            - { name: kernel.event_listener, event: oro_datagrid.search_datasource.result.after.website-search-term-run-original-search-grid, method: onSearchResultAfter }

    oro_product.event_listener.manually_added_product_collection_indexer_listener:
        class: Oro\Bundle\ProductBundle\EventListener\ManuallyAddedProductCollectionIndexerListener
        arguments:
            - '@doctrine'
            - '@oro_config.manager'
            - '@oro_website_search.manager.website_context_manager'
            - '@oro_web_catalog.content_variant_provider'
            - '@oro_product.service.product_collection_definition_converter'
        tags:
            - { name: kernel.event_listener, event: oro_website_search.event.index_entity, method: onWebsiteSearchIndex, priority: -100 }

    oro_product.validator_constraints.sku_regex_validator:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\SkuRegexValidator
        arguments:
            - '%oro_product.sku.regex_pattern%'
        tags:
            - { name: validator.constraint_validator, alias: oro_product.validator_constraints.sku_regex_validator }

    oro_product.entity.builder.product_family:
        class: Oro\Bundle\ProductBundle\Entity\Builder\ProductFamilyBuilder
        arguments:
            - '@translator'
            - '@oro_entity_config.manager.attribute_group_manager'
        public: true

    oro_product.content_widget_type.product_mini_block:
        class: Oro\Bundle\ProductBundle\ContentWidget\ProductMiniBlockContentWidgetType
        arguments:
            - '@oro_product.product_list_builder'
        tags:
            - { name: oro_cms.content_widget.type }

    oro_product.event_listener.restrict_content_variant_by_product:
        class: Oro\Bundle\ProductBundle\EventListener\RestrictContentVariantByProductEventListener
        tags:
            - { name: kernel.event_listener, event: oro_web_catalog.restrict_content_variant_by_entity, method: applyRestriction }

    oro_product.event_listener.remove_product_image:
        class: Oro\Bundle\ProductBundle\EventListener\RemoveProductImageListener
        arguments:
            - '@oro_message_queue.client.message_producer'
        tags:
            - { name: doctrine.orm.entity_listener, entity: Oro\Bundle\ProductBundle\Entity\ProductImage, event: preRemove }
            - { name: doctrine.event_listener, event: postFlush }
            - { name: doctrine.event_listener, event: onClear }

    oro_product.content_widget_type.product_segment:
        class: Oro\Bundle\ProductBundle\ContentWidget\ProductSegmentContentWidgetType
        arguments:
            - '@doctrine'
        tags:
            - { name: oro_cms.content_widget.type }

    oro_product.delete_handler_extension.product_unit_precision:
        class: Oro\Bundle\ProductBundle\Handler\ProductUnitPrecisionDeleteHandlerExtension
        parent: oro_entity.delete_handler_extension
        arguments:
            - '@oro_product.provider.product_kits_by_unit_precision'
            - '@translator'
        tags:
            - { name: oro_entity.delete_handler_extension, entity: Oro\Bundle\ProductBundle\Entity\ProductUnitPrecision }

    oro_product.provider.brand_slug_source_entity:
        class: Oro\Bundle\ProductBundle\Provider\BrandSlugSourceEntityProvider
        arguments:
            - '@oro_redirect.sluggable_entity_finder'
            - '@oro_config.manager'
        tags:
            - { name: oro_redirect.slug_source_entity_provider, priority: -20 }

    oro_product.provider.product_slug_source_entity:
        class: Oro\Bundle\ProductBundle\Provider\ProductSlugSourceEntityProvider
        arguments:
            - '@oro_redirect.sluggable_entity_finder'
            - '@oro_config.manager'
        tags:
            - { name: oro_redirect.slug_source_entity_provider, priority: 10 }

    oro_product.provider.family_attribute_counts:
        class: Oro\Bundle\ProductBundle\Provider\FamilyAttributeCountsProvider
        arguments:
            - '@oro_datagrid.datagrid.manager'
            - '@oro_product.website_search.repository.product'

    oro_product.event_listener.product_preloading:
        parent: oro_entity.event_listener.default_preloading
        tags:
            - { name: kernel.event_listener, event: oro_entity.preload_entity.product, method: onPreload }
            - { name: kernel.event_listener, event: oro_entity.preload_entity.productimage, method: onPreload }
            - { name: kernel.event_listener, event: oro_entity.preload_entity.productkititem, method: onPreload }
            - { name: kernel.event_listener, event: oro_entity.preload_entity.productkititemlabel, method: onPreload }
            - { name: kernel.event_listener, event: oro_entity.preload_entity.productkititemproduct, method: onPreload }

    oro_product.event_listener.product_data_converter:
        class: 'Oro\Bundle\ProductBundle\EventListener\ProductDataConverterEventListener'
        arguments:
            - '@translator'
            - '@oro_entity_config.manager.attribute_family_manager'
            - '@oro_entity_config.manager.attribute_manager'
            - '@oro_importexport.strategy.import.helper'
        tags:
            - { name: kernel.event_listener, event: oro_product.data_converter.convert_to_import, method: onConvertToImport }

    oro_product.provider.product_autocomplete:
        class: Oro\Bundle\ProductBundle\Provider\ProductAutocompleteProvider
        arguments:
            - '@router'
            - '@oro_product.website_search.repository.product'
            - '@oro_ui.twig.html_tag'
            - '@oro_product.provider.product_image_placeholder'
            - '@oro_config.manager'
            - '@oro_entity_extend.enum_value_provider'
            - '@event_dispatcher'
            - '@oro_ui.tools.url_helper'

    oro_product.layout.data_provider.frontend_product_export_options:
        class: Oro\Bundle\ProductBundle\Layout\DataProvider\FrontendProductExportOptionsProvider
        arguments:
            - '@oro_catalog.handler.request_product'
            - '@oro_product.handler.search_product_handler'
            - '@oro_product.handler.request_content_variant'
        tags:
            - { name: layout.data_provider, alias: frontend_product_export_options }

    oro_product.event_listener.product_quick_order_form_not_found:
        class: Oro\Bundle\ProductBundle\EventListener\ProductQuickOrderFormNotFoundListener
        arguments:
            - '@router'
            - '@oro_security.token_accessor'
        tags:
            - { name: kernel.event_listener, event: kernel.exception, method: onKernelException}

    oro_product.event_listener.product_autocomplete.webp_aware:
        class: Oro\Bundle\ProductBundle\EventListener\WebpAwareProductAutocompleteListener
        arguments:
            - '@oro_attachment.tools.webp_configuration'
            - '@oro_product.provider.product_image_placeholder'
            - '@oro_ui.tools.url_helper'
        tags:
            - { name: kernel.event_listener, event: Oro\Bundle\ProductBundle\Event\CollectAutocompleteFieldsEvent, method: onCollectAutocompleteFields }
            - { name: kernel.event_listener, event: Oro\Bundle\ProductBundle\Event\ProcessAutocompleteDataEvent, method: onProcessAutocompleteData }

    oro_product.manager.user_product_filters_sidebar_state_manager:
        class: Oro\Bundle\ProductBundle\Manager\UserProductFiltersSidebarStateManager
        arguments:
            - '@request_stack'
            - '@doctrine'
            - '@oro_security.token_accessor'
            - '@oro_website.manager'
            - '@oro_config.manager'

    oro_product.layout.data_provider.product_filters_sidebar_state:
        class: Oro\Bundle\ProductBundle\Layout\DataProvider\UserProductFiltersSidebarStateDataProvider
        arguments:
            - '@oro_product.manager.user_product_filters_sidebar_state_manager'
        tags:
            - { name: layout.data_provider, alias: oro_product_filters_sidebar_state_data_provider }

    oro_product.driver.product_website_reindex_request_dbal_driver:
        class: Oro\Bundle\ProductBundle\Driver\ProductWebsiteReindexRequestDbalDriver
        arguments:
            - '@doctrine'

    oro_product.voter.product_original_filenames_configuration_voter:
        class: Oro\Bundle\ProductBundle\Voter\ProductOriginalFileNamesConfigurationVoter
        tags:
            - { name: oro_featuretogle.voter }
            - { name: oro_featuretogle.feature, feature: attachment_original_filenames }

    oro_product.datagrid.provider.product_variants_selected_fields_provider:
        class: Oro\Bundle\ProductBundle\DataGrid\Provider\ProductVariantsSelectedFieldsProvider
        arguments:
            - '@doctrine'
        tags:
            - { name: oro_datagrid.selected_fields_provider }

    oro_product.data_provider.schema_org_product_full_description:
        class: 'Oro\Bundle\ProductBundle\Provider\SchemaOrgProductDescriptionCommonProvider'
        arguments:
            - '@oro_entity_extend.accessor.property_accessor_with_dot_array_syntax'
            - '@oro_ui.html_tag_helper'
            - '@oro_locale.helper.localization'
            - 'descriptions'
        tags:
            - { name: oro_product.description_provider, key: 'oro_product_full_description' }

    oro_product.data_provider.schema_org_product_short_description:
        class: 'Oro\Bundle\ProductBundle\Provider\SchemaOrgProductDescriptionCommonProvider'
        arguments:
            - '@oro_entity_extend.accessor.property_accessor_with_dot_array_syntax'
            - '@oro_ui.html_tag_helper'
            - '@oro_locale.helper.localization'
            - 'shortDescriptions'
        tags:
            - { name: oro_product.description_provider, key: 'oro_product_short_description' }

    oro_product.data_provider.schema_org_product_description:
        class: 'Oro\Bundle\ProductBundle\Provider\SchemaOrgProductDescriptionProvider'
        arguments:
            - '@oro_config.manager'
            - !tagged_iterator { tag: oro_product.description_provider, index_by: 'key' }

    oro_product.event_listener.website_search_description_schema_org_index:
        class: 'Oro\Bundle\ProductBundle\EventListener\WebsiteSearchProductIndexerSchemaOrgListener'
        arguments:
            - '@oro_website.provider.website_localization'
            - '@oro_website_search.manager.website_context_manager'
            - '@oro_product.data_provider.schema_org_product_description'
            - '@doctrine'
        tags:
            - { name: kernel.event_listener, event: oro_website_search.event.index_entity.product, method: onWebsiteSearchIndex, priority: -255 }

    oro_product.layout.data_provider.schema_org_product_description:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\SchemaOrgProductDescriptionLayoutDataProvider'
        arguments:
            - '@oro_product.data_provider.schema_org_product_description'
        tags:
            - { name: layout.data_provider, alias: oro_product_schema_org_product_description }

    oro_product.event_listener.website_related_product_list_schema_org:
      class: 'Oro\Bundle\ProductBundle\EventListener\BuildProductListSchemaOrgListener'
      tags:
        - { name: kernel.event_listener, event: oro_product.product_list.build_query, method: onBuildQueryProductList, priority: -255 }
        - { name: kernel.event_listener, event: oro_product.product_list.build_result, method: onBuildResultProductList, priority: -255 }

    oro_product.quick_add.normalizer:
        class: Oro\Bundle\ProductBundle\QuickAdd\Normalizer\QuickAddCollectionNormalizer
        arguments:
            - !tagged_iterator { tag: oro_product.quick_add.normalizer }

    Oro\Bundle\ProductBundle\QuickAdd\Normalizer\QuickAddCollectionNormalizerInterface:
        alias: oro_product.quick_add.normalizer

    oro_product.quick_add.normalizer.basic:
        class: Oro\Bundle\ProductBundle\QuickAdd\Normalizer\BasicQuickAddCollectionNormalizer
        arguments:
            - '@oro_locale.helper.localization'
            - '@oro_product.formatter.product_unit_label'
            - '@translator'
        tags:
            - { name: oro_product.quick_add.normalizer }

    Oro\Bundle\ProductBundle\Validator\Constraints\QuickAddComponentProcessorValidator:
        arguments:
            - '@oro_product.component_processor.registry'
        tags:
            - { name: validator.constraint_validator }

    oro_product.quick_add.violations_mapper:
        class: Oro\Bundle\ProductBundle\QuickAdd\QuickAddRowCollectionViolationsMapper

    oro_product.form_handler.quick_add_import_from_file:
        class: Oro\Bundle\ProductBundle\Form\Handler\QuickAddImportFromFileHandler
        arguments:
            - '@oro_product.model.builder.quick_add_row_collection'
            - '@event_dispatcher'
            - '@validator'
            - '@oro_product.model.quick_add_row_product_grouper'
            - '@oro_product.quick_add.violations_mapper'
            - '@oro_product.quick_add.normalizer'
            - '@oro_entity.manager.preloading_manager'

    oro_product.form_handler.quick_add_import_from_plain_text:
        class: Oro\Bundle\ProductBundle\Form\Handler\QuickAddImportFromPlainTextHandler
        arguments:
            - '@oro_product.model.builder.quick_add_row_collection'
            - '@event_dispatcher'
            - '@validator'
            - '@oro_product.model.quick_add_row_product_grouper'
            - '@oro_product.quick_add.violations_mapper'
            - '@oro_product.quick_add.normalizer'
            - '@oro_entity.manager.preloading_manager'

    oro_product.form_handler.quick_add_process:
        class: Oro\Bundle\ProductBundle\Form\Handler\QuickAddProcessHandler
        arguments:
            - '@oro_product.component_processor.registry'
            - '@validator'
            - '@oro_product.model.quick_add_row_product_grouper'
            - '@oro_product.quick_add.violations_mapper'
            - '@oro_product.quick_add.normalizer'
            - '@oro_entity.manager.preloading_manager'

    oro_product.form.data_transformer.quick_add_row_collection:
        class: Oro\Bundle\ProductBundle\Form\DataTransformer\QuickAddRowCollectionTransformer
        arguments:
            - '@oro_product.model.builder.quick_add_row_collection'

    oro_product.event_listener.frontend_product_search_listener:
        class: Oro\Bundle\ProductBundle\EventListener\ProductSearchHistoryEventListener
        parent: oro_website_search.event_listener.search_listener
        calls:
            - ['setSearchProductHandler', ['@oro_product.handler.search_product_handler']]
            - ['addSupportedSearchQueryType', ['product_autocomplete']]
            - ['addSupportedSearchQueryType', ['product_search']]
        tags:
            - { name: kernel.event_listener, event: oro_website_search.after_search, method: onSearchAfter }

    oro_product.event_listener.product_duplicate:
        class: Oro\Bundle\ProductBundle\EventListener\ProductDuplicateListener
        arguments:
            - '@oro_entity_config.config_manager'
            - '@oro_entity_config.provider.attribute'
            - '@oro_entity.doctrine_helper'
            - '@property_accessor'
        tags:
            -
                name: kernel.event_listener
                event: oro_product.product.duplicate.after
                method: onDuplicateAfter
                priority: -128

    oro_product.event_listener.product_multi_fields_duplicate:
        class: Oro\Bundle\ProductBundle\EventListener\ProductMultiFieldsDuplicateListener
        arguments:
            - '@oro_entity_config.provider.entity'
            - '@doctrine'
        tags:
            - { name: kernel.event_listener, event: oro_product.product.duplicate.after, method: onDuplicateAfter, priority: -200 }

    oro_product.service.product_collection_segment_manipulator:
        class: Oro\Bundle\ProductBundle\Service\ProductCollectionSegmentManipulator
        arguments:
            - '@doctrine'
            - '@oro_product.service.product_collection_definition_converter'

    oro_product.form.handler.product_collection_segment_products:
        class: Oro\Bundle\ProductBundle\Form\Handler\ProductCollectionSegmentProductsFormHandler
        arguments:
            - '@doctrine'
            - '@oro_product.service.product_collection_segment_manipulator'
            - '@oro_product.handler.collection_sort_order'

    oro_product.event_listener.doctrine.product_kit_item_product.unit_precision:
        class: Oro\Bundle\ProductBundle\EventListener\Doctrine\ProductKitItemProductUnitPrecisionDoctrineListener
        tags:
            - { name: doctrine.orm.entity_listener, entity_manager: default, entity: Oro\Bundle\ProductBundle\Entity\ProductKitItemProduct, event: prePersist }
            - { name: doctrine.orm.entity_listener, entity_manager: default, entity: Oro\Bundle\ProductBundle\Entity\ProductKitItemProduct, event: preUpdate }

    oro_product.event_listener.doctrine.product_kit_item.product_unit:
        class: Oro\Bundle\ProductBundle\EventListener\Doctrine\ProductKitItemProductUnitDoctrineListener
        tags:
            - { name: doctrine.orm.entity_listener, entity_manager: default, entity: Oro\Bundle\ProductBundle\Entity\ProductKitItem, event: preUpdate }

    oro_product.product_kit_item_product_unit_checker:
        class: Oro\Bundle\ProductBundle\Service\ProductKitItemProductUnitChecker

    oro_product.validator.not_empty_product_kit_items_collection_validator:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\NotEmptyProductKitItemsCollectionValidator
        tags:
            - { name: validator.constraint_validator }

    oro_product.validator.only_simple_products_in_product_kit_item_products_collection_validator:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\OnlySimpleProductsInProductKitItemProductsCollectionValidator
        tags:
            - { name: validator.constraint_validator }

    oro_product.validator.only_product_kit_can_have_kit_items_validator:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\OnlyProductKitCanHaveKitItemsValidator
        tags:
            - { name: validator.constraint_validator }

    oro_product.validator.product_kit_item_unit_available_for_specified_products_validator:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\ProductKitItemUnitAvailableForSpecifiedProductsValidator
        arguments:
            - '@oro_product.product_kit_item_product_unit_checker'
        tags:
            - { name: validator.constraint_validator }

    oro_product.validator.product_kit_item_quantity_precision_validator:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\ProductKitItemQuantityPrecisionValidator
        arguments:
            - '@oro_product.product_kit_item_product_unit_checker'
            - '@oro_product.service.quantity_rounding'
        tags:
            - { name: validator.constraint_validator }

    oro_product.provider.product_kits_by_unit_precision:
        class: Oro\Bundle\ProductBundle\Provider\ProductKitsByUnitPrecisionProvider
        arguments:
            - '@doctrine'

    oro_product.provider.product_kits_by_product:
        class: Oro\Bundle\ProductBundle\Provider\ProductKitsByProductProvider
        arguments:
            - '@doctrine'

    oro_product.validator.product_unit_precisions_collection_referenced_by_product_kit_items_validator:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\ProductUnitPrecisionsCollectionReferencedByProductKitItemsValidator
        arguments:
            - '@oro_product.provider.product_kits_by_unit_precision'
        tags:
            - { name: validator.constraint_validator }

    oro_product.validator.product_unit_precision_referenced_by_product_kit_items_validator:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\ProductUnitPrecisionReferencedByProductKitItemsValidator
        arguments:
            - '@doctrine'
            - '@oro_product.provider.product_kits_by_unit_precision'
        tags:
            - { name: validator.constraint_validator }

    oro_product.repository.product_kit_item:
        alias: Oro\Bundle\ProductBundle\Entity\Repository\ProductKitItemRepository

    Oro\Bundle\ProductBundle\Entity\Repository\ProductKitItemRepository:
        parent: oro_entity.abstract_repository
        arguments:
            - 'Oro\Bundle\ProductBundle\Entity\ProductKitItem'
        tags:
            - { name: doctrine.repository_service }

    oro_product.delete_handler_extension.product:
        class: Oro\Bundle\ProductBundle\Handler\ProductDeleteHandlerExtension
        deprecated: '%service_id% is deprecated since 5.1, use oro_product.acl.product_voter instead'
        parent: oro_entity.delete_handler_extension
        arguments:
            - '@oro_product.provider.product_kits_by_product'
            - '@translator'
        tags:
            - { name: oro_entity.delete_handler_extension, entity: Oro\Bundle\ProductBundle\Entity\Product }

    oro_product.delete_handler_extension.product_kit_item:
        class: Oro\Bundle\ProductBundle\Handler\ProductKitItemDeleteHandlerExtension
        parent: oro_entity.delete_handler_extension
        arguments:
            - '@oro_locale.helper.localization'
            - '@translator'
        tags:
            - { name: oro_entity.delete_handler_extension, entity: Oro\Bundle\ProductBundle\Entity\ProductKitItem }

    oro_product.datagrid.extension.mass_action.handler.product_delete:
        class: Oro\Bundle\ProductBundle\DataGrid\Extension\MassAction\ProductDeleteMassActionHandler
        parent: oro_datagrid.extension.mass_action.handler.delete

    oro_product.validator.product_kit_items_owned_by_product_kit_validator:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\ProductKitItemsOwnedByProductKitValidator
        arguments:
            - '@oro_locale.helper.localization'
        tags:
            - { name: validator.constraint_validator }

    oro_product.datagrid.formatter.units_with_precision_property:
        class: Oro\Bundle\ProductBundle\DataGrid\Formatter\Property\UnitsWithPrecisionProperty
        arguments:
            - '@oro_datagrid.extension.formatter.property.twig_property'
        tags:
            - { name: oro_datagrid.extension.formatter.property, type: units_with_precision }

    oro_product.provider.product_kit_item_unit_precision:
        class: Oro\Bundle\ProductBundle\Provider\ProductKitItemUnitPrecisionProvider
        arguments:
            - '@doctrine'

    oro_product.model.product_line_items_holder_factory:
        class: Oro\Bundle\ProductBundle\Model\ProductLineItemsHolderFactory\ProductLineItemsHolderFactory

    oro_product.event_listener.payment_profile_grid_listener:
        class: Oro\Bundle\ProductBundle\EventListener\ProductsSelectGridFrontendGridListener
        calls:
            -
                setNotAllowedProductTypes:
                    -
                        - !php/const Oro\Bundle\ProductBundle\Entity\Product::TYPE_CONFIGURABLE
                        - !php/const Oro\Bundle\ProductBundle\Entity\Product::TYPE_KIT
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.products-select-grid-frontend, method: onBuildAfter }

    oro_product.datagrid.property.product_units:
        class: Oro\Bundle\ProductBundle\DataGrid\Property\ProductUnitsProperty
        # Public because used as a property callback in a datagrid.
        public: true

    oro_product.filter.composed_sku_string_filter:
        class: Oro\Bundle\ProductBundle\Filter\ComposedSkuStringFilter
        arguments:
            - '@form.factory'
            - '@oro_filter.filter_utility'
        tags:
            - { name: oro_filter.extension.orm_filter.filter, type: composed-sku-string }

    oro_product.layout.data_provider.product_types:
        class: 'Oro\Bundle\ProductBundle\Layout\DataProvider\ProductTypesProvider'
        arguments:
            - "@oro_product.provider.product_type_provider"
        tags:
            - { name: layout.data_provider, alias: product_types }

    oro_product_pro.event_listener.frontend.brand_datagrid:
        class: Oro\Bundle\ProductBundle\EventListener\FrontendBrandDatagridListener
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.before.frontend-product-search-grid, method: onBuildBefore }

    oro_product.entity_filter.frontend_brand:
        class: Oro\Bundle\ProductBundle\Filter\FrontendBrandFilter
        arguments:
            - '@form.factory'
            - '@oro_filter.filter_utility'
            - '@doctrine'
        tags:
            - { name: oro_search.extension.search_filter.filter, type: frontend_brand }

    oro_product.validator.product_kit_line_item_contains_required_kit_items:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\ProductKitLineItemContainsRequiredKitItemsValidator
        arguments:
            - '@oro_locale.helper.localization'
        tags:
            - { name: validator.constraint_validator }

    oro_product.event_listener.product_import_wysiwyg_field_config_listener:
        class: Oro\Bundle\ProductBundle\EventListener\ProductImportWysiwygFieldConfigListener
        arguments:
            - '@oro_entity_config.config_manager'
            - '@oro_entity_config.config.config_helper'
        tags:
            - { name: kernel.event_listener, event: oro_entity_config.after_write_field_config, method: onAfterWriteFieldConfig, priority: -255 }

    oro_product.line_item_checksum_generator.general:
        class: Oro\Bundle\ProductBundle\LineItemChecksumGenerator\GeneralLineItemChecksumGenerator
        tags:
            -
                name: oro_product.line_item_checksum_generator
                priority: -128 # General line item checksum generator should be called last.

    oro_product.product_kit.checksum.product_kit_line_item_checksum_generator:
        class: Oro\Bundle\ProductBundle\ProductKit\Checksum\ProductKitLineItemChecksumGenerator
        tags:
            - { name: oro_product.line_item_checksum_generator }

    oro_product.line_item_checksum_generator:
        class: Oro\Bundle\ProductBundle\LineItemChecksumGenerator\CompositeLineItemChecksumGenerator
        arguments:
            - !tagged_iterator { tag: oro_product.line_item_checksum_generator }

    oro_product.line_item_checksum_generator.hashing:
        decorates: oro_product.line_item_checksum_generator
        class: Oro\Bundle\ProductBundle\LineItemChecksumGenerator\HashingLineItemChecksumGenerator
        arguments:
            - '@.inner'

    oro_product.validator.product_kit_item_line_item_product_allowed:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\ProductKitItemLineItemProductAvailableValidator
        arguments:
            - '@oro_entity.tools.entity_state_checker'
        tags:
            - { name: validator.constraint_validator }

    oro_product.validator.product_kit_item_line_item_product_unit_allowed:
        class: Oro\Bundle\ProductBundle\Validator\Constraints\ProductKitItemLineItemProductUnitAvailableValidator
        arguments:
            - '@oro_entity.tools.entity_state_checker'
        tags:
            - { name: validator.constraint_validator }

    oro_product.validator.product_kit_item_line_item_quantity_unit_precision:
        class: 'Oro\Bundle\ProductBundle\Validator\Constraints\ProductKitItemLineItemQuantityUnitPrecisionValidator'
        arguments:
            - '@oro_product.service.quantity_rounding'
            - '@oro_product.formatter.product_unit_label'
        tags:
            - { name: validator.constraint_validator }

    oro_product.event_listener.website_search_product_preloading_index:
        class: 'Oro\Bundle\ProductBundle\EventListener\WebsiteSearchProductPreloadingIndexerListener'
        arguments:
            - '@oro_website_search.manager.website_context_manager'
            - '@oro_entity.manager.preloading_manager'
        tags:
            - { name: kernel.event_listener, event: oro_website_search.event.index_entity.product, method: onWebsiteSearchIndex, priority: 255 }

    oro_product.event_listener.product_brand_view:
        class: Oro\Bundle\ProductBundle\EventListener\ProductBrandViewListener
        arguments:
            - '@security.authorization_checker'
        tags:
            - { name: kernel.event_listener, event: oro_ui.scroll_data.before.product-view, method: onViewList, priority: -260 }
