services:
  _defaults:
    public: false
    autowire: true
    autoconfigure: true
    bind:
      $psVersion: !php/const _PS_VERSION_
      $debugMode: !php/const _PS_MODE_DEV_
      $controllersLockedToAllShopContext: '%prestashop.controllers_all_shop_context%'
      $defaultLanguageContext: '@prestashop.default.language.context'
      $cookieKey: '%cookie_key%'

  Twig\Extension\StringLoaderExtension: ~

  PrestaShopBundle\Twig\:
    resource: "%kernel.project_dir%/src/PrestaShopBundle/Twig/*"

  PrestaShopBundle\Twig\Locator\ModuleTemplateLoader:
    arguments:
      - 'PrestaShop': ''
        'Product': '/Admin/Product'
        'Twig': '/Admin/TwigTemplateForm'
        'AdvancedParameters': '/Admin/Configure/AdvancedParameters'
        'ShopParameters': '/Admin/Configure/ShopParameters'
      - '@=service("prestashop.adapter.module.repository.module_repository").getActiveModulesPaths()'
    tags:
      - { name: twig.loader, priority: 1 }

  # Extensions

  PrestaShopBundle\Twig\LayoutExtension:

  PrestaShopBundle\Twig\TranslationsExtension:
    properties:
      logger: "@logger"
      translator: "@translator"

  PrestaShopBundle\Twig\HookExtension:
    arguments:
      - "@prestashop.core.hook.dispatcher"
      - "@prestashop.adapter.data_provider.module"
      - "@=service('prestashop.adapter.legacy.context').getContext().employee?service('PrestaShop\\\\PrestaShop\\\\Core\\\\Module\\\\ModuleRepository'):null"

  PrestaShopBundle\Twig\Extension\GridExtension:
    arguments:
      $cache: '@prestashop.static_cache.adapter'

  PrestaShopBundle\Twig\ContextIsoCodeProviderExtension:
    arguments:
      - "@=service('prestashop.adapter.legacy.context').getContext().language ? service('prestashop.adapter.legacy.context').getContext().language.iso_code : 'en'"
    tags:
      - { name: twig.extension }

  PrestaShopBundle\Twig\Extension\LocalizationExtension:
    autowire: true

  PrestaShopBundle\Twig\Layout\TemplateVariablesBuilder: ~
  PrestaShopBundle\Twig\Layout\TemplateVariables:
    lazy: true
    factory: [ '@PrestaShopBundle\Twig\Layout\TemplateVariablesBuilder', 'build' ]

  PrestaShopBundle\Twig\Layout\SmartyVariablesFiller: ~

  prestashop.twig.modules.loader:
    alias: PrestaShopBundle\Twig\Locator\ModuleTemplateLoader
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.twig.extension.stringloader:
    alias: Twig\Extension\StringLoaderExtension
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.twig.extension.layout:
    alias: PrestaShopBundle\Twig\LayoutExtension
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.twig.extension.translation:
    alias: PrestaShopBundle\Twig\TranslationsExtension
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.twig.extension.data_formatter:
    alias: PrestaShopBundle\Twig\DataFormatterExtension
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.twig.extension.hook:
    alias: PrestaShopBundle\Twig\HookExtension
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.bundle.twig.extension.column:
    alias: 'PrestaShopBundle\Twig\Extension\GridExtension'
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.bundle.twig.extension.documentation_link_provider_extension:
    alias: 'PrestaShopBundle\Twig\Extension\DocumentationLinkExtension'
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.twig.extension.context_iso_code_provider_extension:
    alias: PrestaShopBundle\Twig\ContextIsoCodeProviderExtension
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.twig.extension.path_with_back_url_extension:
    alias: PrestaShopBundle\Twig\Extension\PathWithBackUrlExtension
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.bundle.twig.extension.js_router_metadata_extension:
    alias: PrestaShopBundle\Twig\Extension\JsRouterMetadataExtension
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.bundle.twig.extension.localization_extension:
    alias: 'PrestaShopBundle\Twig\Extension\LocalizationExtension'
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.bundle.twig.extension.number_extension:
    alias: 'PrestaShopBundle\Twig\Extension\NumberExtension'
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.bundle.twig.extension.multistore_url:
    alias: 'PrestaShopBundle\Twig\Extension\MultistoreUrlExtension'
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.bundle.twig.extension.entity_search_extension:
    alias: 'PrestaShopBundle\Twig\Extension\EntitySearchExtension'
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0
