集成 sylius 条款和条件插件

Integration sylius Terms & Conditions Plugin

我正在尝试将条款和条件插件集成到我的 sylius 插件中 https://github.com/Setono/SyliusTermsPlugin。我在网格包之前添加了插件,但我总是遇到这个错误“你请求了一个不存在的参数”setono_sylius_terms.model.terms.class”。

这是我的代码:

# config/bundles.php
  Setono\SyliusTermsPlugin\SetonoSyliusTermsPlugin::class => ['all' => true],
  Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true]

# config/packages/_sylius.yaml
   - { resource: "@SetonoSyliusTermsPlugin/Resources/config/app/config.yaml" }

# config/routes.yaml

setono_sylius_terms_shop:
   resource: "@SetonoSyliusTermsPlugin/Resources/config/shop_routing.yaml"
   prefix: /{_locale}
   requirements:
     _locale: ^[a-z]{2}(?:_[A-Z]{2})?$

setono_sylius_terms_admin:
   resource: "@SetonoSyliusTermsPlugin/Resources/config/admin_routing.yaml"
   prefix: /admin

#vendor\setono\sylius-terms-plugin\src\Resources\config\grids
  sylius_grid:
     grids:
      setono_sylius_terms_terms:
        driver:
            name: doctrine/orm
            options:
                class: "%setono_sylius_terms.model.terms.class%"

问题出在 class 的这个电话上,请任何人帮助我。谢谢

此参数由 SyliusResourceBundle 设置,因此请确保 Sylius\Bundle\ResourceBundle\SyliusResourceBundleSyliusTermsPlugin 和任何其他插件之前。

一般来说,应该是:

// config/bundles.php
<?php

return [
    // ...

    Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],

    // All Sylius plugins

    Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],

    // ...
 ];