juicesweb / sylius-feed-plugin
Sylius电子商务平台内生成feed的插件
dev-master / 1.0.x-dev
2023-09-19 22:41 UTC
Requires
- php: >=7.4 || ^8.0
- ext-json: *
- doctrine/collections: ^1.6
- doctrine/orm: ^2.7
- doctrine/persistence: ^1.3 || ^2.0
- knplabs/knp-menu: ^3.1
- league/flysystem: ^1.1 || ^2.1
- league/flysystem-bundle: ^1.1 || ^2.4
- liip/imagine-bundle: ^2.4
- psr/event-dispatcher: ^1.0
- psr/log: ^1.0 || ^2.0 || ^3.0
- setono/doctrine-orm-batcher: ^0.6
- setono/doctrine-orm-batcher-bundle: ^0.3.1
- setono/symfony-main-request-trait: ^1.0
- spatie/enum: ^3.7
- sylius/resource-bundle: ^1.6
- symfony/config: ^4.4 || ^5.4
- symfony/console: ^4.4 || ^5.4
- symfony/dependency-injection: ^4.4 || ^5.4
- symfony/event-dispatcher: ^4.4 || ^5.4
- symfony/event-dispatcher-contracts: ^1.1 || ^2.2 || ^3.0
- symfony/form: ^4.4 || ^5.4
- symfony/http-foundation: ^4.4 || ^5.4.7
- symfony/http-kernel: ^4.4 || ^5.4
- symfony/messenger: ^4.4 || ^5.4
- symfony/mime: ^4.4 || ^5.4 || ^6.0
- symfony/options-resolver: ^4.4 || ^5.4
- symfony/routing: ^4.4 || ^5.4
- symfony/serializer: ^4.4 || ^5.4
- symfony/translation-contracts: ^1.1 || ^2.3
- symfony/uid: ^5.4 || ^6.0
- symfony/validator: ^4.4 || ^5.4
- symfony/workflow: ^4.4 || ^5.4
- twig/twig: ^2.14
- webmozart/assert: ^1.1
Requires (Dev)
- api-platform/core: ^2.6
- friendsofsymfony/oauth-server-bundle: >2.0.0-alpha.0 ^2.0@dev
- lexik/jwt-authentication-bundle: ^2.15
- php-http/message-factory: ^1.1
- phpspec/phpspec: ^7.2
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- psalm/plugin-phpunit: ^0.16
- psalm/plugin-symfony: ^3.0
- roave/security-advisories: dev-latest
- setono/code-quality-pack: ^2.2
- setono/sylius-behat-pack: ^0.2
- sylius/admin-api-bundle: ^1.11
- sylius/sylius: ~1.10.14
- symfony/debug-bundle: ^4.4 || ^5.4
- symfony/dotenv: ^4.4 || ^5.4
- symfony/intl: ^4.4 || ^5.4
- symfony/web-profiler-bundle: ^4.4 || ^5.4
- weirdan/doctrine-psalm-plugin: ^2.2
This package is not auto-updated.
Last update: 2024-10-03 01:38:09 UTC
README
这是一个用于创建各种feed的插件。你想为你的Google Merchant center创建产品feed吗?那么这个插件就是为你准备的。
安装
步骤1:下载插件
打开命令控制台,进入你的项目目录,并执行以下命令以下载此插件的最新稳定版本
$ composer require setono/sylius-feed-plugin
此命令要求你全局安装Composer,如Composer文档中的安装章节所述。
步骤2:启用插件
然后,通过将以下内容添加到你的项目config/bundles.php
文件中注册的插件/包列表中启用插件
<?php return [ // ... League\FlysystemBundle\FlysystemBundle::class => ['all' => true], Setono\SyliusFeedPlugin\SetonoSyliusFeedPlugin::class => ['all' => true], Setono\DoctrineORMBatcherBundle\SetonoDoctrineORMBatcherBundle::class => ['all' => true], // It is important to add plugin before the grid bundle Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], // ... ];
注意,你必须在使用网格包之前实例化插件,否则你会看到一个异常,如您请求了一个不存在的参数 "setono_sylius_feed.model.feed.class"。
步骤3:导入路由
# config/routes/setono_sylius_feed.yaml setono_sylius_feed: resource: "@SetonoSyliusFeedPlugin/Resources/config/routing.yaml"
如果你不使用本地化URL,请使用此路由文件:@SetonoSyliusFeedPlugin/Resources/config/routing_non_localized.yaml
步骤4:配置插件
# config/packages/setono_sylius_feed.yaml imports: - { resource: "@SetonoSyliusFeedPlugin/Resources/config/app/config.yaml" }
步骤5:更新数据库模式
使用Doctrine迁移创建迁移文件并更新数据库。
$ bin/console doctrine:migrations:diff $ bin/console doctrine:migrations:migrate
步骤6:使用异步传输(可选,但推荐)
此插件中的所有命令都将扩展CommandInterface。因此,你可以通过添加以下内容到你的消息传递器配置来轻松路由所有命令。
# config/packages/messenger.yaml framework: messenger: routing: # Route all command messages to the async transport # This presumes that you have already set up an 'async' transport # See docs on how to setup a transport like that: https://symfony.com.cn/doc/current/messenger.html#transports-async-queued-messages 'Setono\SyliusFeedPlugin\Message\Command\CommandInterface': async
使用方法
设置完成后,你想要创建一个feed。转到/admin/feeds/new
创建一个新的feed。请记住启用它并选择一个或多个频道。
之后,转到你的控制台并运行此命令
$ php bin/console setono:sylius-feed:process
如果你没有更改任何配置,应该有一个包含你产品的feed在/var/storage/setono_sylius_feed/feed
目录中。