tweakwise / magento2-tweakwise-export
Tweakwise 导出 Magento 2 模块
Requires
- php: ^8.0
- laminas/laminas-http: ^2.15.0
Requires (Dev)
- bitexpert/phpstan-magento: ^0.30.1
- fzaninotto/faker: ^1.7
- magento/framework: ^103.0
- phpstan/extension-installer: ^1.3
- symfony/config: ^6.4
- symfony/finder: ^6.4.0
- youwe/coding-standard-magento2: ^2.0.0
- youwe/testing-suite: ^2.17
Replaces
- emico/tweakwise-export: v4.2.4
- dev-master
- v7.1.1
- v7.1.0
- v7.0.1
- v7.0.0
- v7.0.0-beta.3
- v7.0.0-beta.2
- v7.0.0-beta.1
- v6.0.2
- v6.0.1
- v6.0.0
- v5.4.1
- v5.4.0
- v5.3.1
- v5.3.0
- v5.2.0
- v5.1.2
- v5.1.1
- v5.1.0
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- v5.0.0
- v5.0.0-alpha
- v4.2.4
- 4.2.3
- v4.2.2
- v4.2.1
- v4.2.0
- v4.1.0
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.0
- v3.0.0
- v2.1.0
- v2.0.2
- v2.0.1
- v2.0.0
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.0
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.4
- v1.1.3
- V1.1.2
- V1.1.1
- V1.1.0
- v1.0.14
- V1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-beta
- dev-beta-3
- dev-beta2
- dev-fix/TW-40-yes-no-attribute-save-issue
- dev-fix-use-inventory-stock-table
- dev-chore/removed-semantic-release-changelog
- dev-fix/trigger-release
This package is auto-updated.
Last update: 2024-09-24 13:08:50 UTC
README
如果您已安装 emico/tweakwise 包,请先卸载该包。此包将替换那个包
使用 composer 安装包
composer require tweakwise/magento2-tweakwise-export
启用模块
运行安装程序
php bin/magento module:enable Tweakwise_Magento2TweakwiseExport php bin/magento setup:upgrade php bin/magento setup:static-content:deploy
使用方法
所有导出设置都可以在“商店”->“配置”->“目录”->“Tweakwise”->“导出”下找到。
可以使用命令行生成数据源。
php bin/magento tweakwise:export php bin/magento tweakwise:export -t stock //stock export php bin/magento tweakwise:export -t price //price export php bin/magento tweakwise:export -s storecode //store level export, only works is store level export is enabled.
如果启用了“按商店级别导出”,则可以使用命令行生成单个商店的数据源。
php bin/magento tweakwise:export --store '<storecode>'
调试
调试使用 Magento / PHP 的默认调试功能进行。您可以通过将部署模式设置为开发者来启用数据源的缩进。
php bin/magento deploy:mode:set developer Usage: tweakwise:export [-c|--validate] [file] Arguments: file Export to specific file (default: "var/feeds/tweakwise.xml") store Export a specific storeId, only possible of Store Level Export is enabled. Options: --validate (-c) Validate feed and rollback if fails. --help (-h) Display this help message --quiet (-q) Do not output any message --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug --version (-V) Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output --no-interaction (-n) Do not ask any interactive question
数据源结构
数据源包含一些头部信息,然后是类别和产品。Tweakwise 本地不支持多个商店,因此所有类别和产品都以 1000{store_id} 为前缀。如果产品(ID为1178)在多个商店(例如1、5和8)中活跃且可见,则它在数据源中将出现三次(如果启用了按商店级别导出,则产品将导出到3个不同的数据源中)ID为:100011178、100051178 和 100081178。该产品的数据取决于特定商店的属性值。简而言之,实体以 1000{store_id}{entity_id}
的形式出现在数据源中。
数据源仅包含在目录配置中可见的产品。如果产品有子产品(例如可配置产品),则数据源还将包含所有子产品的数据。子产品的数据将汇总到“父”产品上。这是因为在用户搜索尺寸为M的T恤时,可配置产品必须在结果中显示,因此可配置产品应与子产品中所有可用的尺寸一起导出。
数据源仅包含对搜索或导航有影响属性,请检查 src/Model/ProductAttributes.php:45
以查看属性必须满足哪些标准才能导出。
数据源价格以商店默认配置的货币导出(从v5.1.0开始)。如果可用汇率,则计算该货币的价格。如果不可用汇率,则使用原始价格。
关于数据源实现的说明
由于 Magento 本身的接口和数据处理器对于大型目录来说太慢,我们决定使用自己的数据检索查询。结果是,我们需要跟踪 Magento 的内部工作原理,并受其更改的影响。如果您发现数据检索有问题,请在 GitHub 上创建问题。
数据源 URL
https://yoursite.com/tweakwise/feed/export/key/{{feed_key}} https://yoursite.com/tweakwise/feed/export/key/{{feed_key}}/type/stock //库存导出 https://yoursite.com/tweakwise/feed/export/key/{{feed_key}}/type/price //价格导出 https://yoursite.com/tweakwise/feed/export/key/{{feed_key}}/store/storecode //按商店级别导出,仅在启用了按商店级别导出时可用
导出设置
- 门店级别导出:为每个门店生成单独的数据源。如果启用门店级别导出。
- 启用:如果该门店的产品应该导出到tweakwise,请注意,如果某些门店此选项为假,则导航和搜索也应禁用该门店。
- 计划:生成数据源的cron计划。我们强烈建议您在服务器的crontab上注册导出任务,而不是使用Magento cron。
- 计划导出:在下次cron运行时生成数据源。(默认数据源)
- 密钥:当ExportController请求数据源内容或CacheFlush控制器请求刷新缓存时,将验证此密钥。如果请求没有匹配密钥参数的密钥,则不会提供数据源(或者在缓存控制器的情况下,将不会刷新缓存)。
- 允许缓存刷新:允许自动刷新缓存,您可以在导航器中配置一个任务,在发布完成后运行以刷新Magento缓存。您必须在任务配置中指定一个URL:使用https://yoursite.com/tweakwise/cache/flush/key/{{feed_key}}作为其URL,其中feed_key等于在密钥设置中配置的密钥(见上文)。如果此设置设置为无,则tweakwise-export将忽略这些请求。
- 实时导出:当ExportController请求数据源时,它将实时生成一个新的数据源。请注意,这不建议使用!
- Tweakwise导入API URL:导航器中的任务可以通过API执行。在此处使用导入任务API URL,自动告诉tweakwise在生成数据源后导入数据。可以使用单独的触发器用于库存/价格导出。
- 导出缺货组合产品子项:Tweakwise导出将聚合父产品上的子数据,此设置确定是否应包括缺货子产品中的数据。
- 排除子属性:这些属性的值将在聚合到父产品时被排除。
- 哪个价格值将作为“价格”导出到tweakwise。
可见性设置
Magento有多个可见性设置,tweakwise只知道可见产品,这意味着如果产品在数据源中,则在导航和搜索时将是可见的。magento可见性设置将导出到数据源中,因此您可以添加一个隐藏过滤器到您的tweakwise模板中,以人工使用正确的设置。如果您这样做,请从子产品中排除可见性属性(见“导出设置”)。
贡献者
如果您想作为贡献者创建一个pull request,请使用semantic-release的指南。semantic-release自动化整个包发布工作流程,包括:确定下一个版本号,生成发布说明,并发布包。通过遵循提交信息格式,将自动创建一个带有提交消息作为发布说明的发布。按照以下描述的指南进行操作:https://github.com/semantic-release/semantic-release?tab=readme-ov-file#commit-message-format。