techquity / aero-google-shopping
一个用于生成和提供访问Google购物频道的Aero Commerce模块。
由于主存储库已丢失,该软件包已被冻结。
Requires
- php: ^7.2
- ext-simplexml: *
- aerocommerce/core: ^0
- illuminate/database: ^5.8|^6
- illuminate/filesystem: ^5.8|^6
- illuminate/support: ^5.8|^6
This package is auto-updated.
Last update: 2021-06-20 10:28:44 UTC
README
Aero Commerce的Google购物频道路由器。
安装
安装需要Composer和PHP 7.2或更高版本。
composer require techquity/aero-google-shopping "^2.0"
数据库
该软件包为存储Google购物分类的新数据库表提供迁移。要创建表并填充它,请运行以下两个命令
php artisan migrate
php artisan tqt:google:taxonomies
只要正确配置了Laravel调度器,这些分类每天早上6点自动更新。
配置
基本配置可能不适用于每个项目,并且需要运行以下命令来创建项目特定的配置文件。
php artisan vendor:publish --provider="Techquity\GoogleShopping\Providers\GoogleShopping"
基本配置文件应如下所示
<?php return [ 'run_at' => '01:00', 'attributes' => [ 'mpn' => null, 'condition' => 'new', 'energy_efficiency_class' => null, 'age_group' => null, 'color' => 2, 'gender' => null, 'material' => 4, 'size' => [26, 27, 28], 'size_type' => null, 'size_system' => 'GB', 'custom_label_0' => null, 'custom_label_1' => null, 'custom_label_2' => null, 'custom_label_3' => null, 'custom_label_4' => null, ], ];
运行时间
run_at
确定自动重新生成频道的每日时间。它接受简单的字符串格式,使用24小时制,例如'17:30'
、'11:00'
或'01:25'
。
属性
每个必需的属性应映射到您Aero系统中属性组的ID。例如,上面的配置假定可以从应用程序的第四个属性组中检索产品的材料。
一些更通用的属性,如尺寸,可能映射到多个属性组,例如在时尚网站上,您可能有多个针对不同产品范围的尺寸属性组。一个属性组可能是“鞋码”,另一个可能是“腰围”,每个都适用于某些产品。在数组配置的情况下,将使用第一个匹配的组。
在这种情况下,预计产品在映射到Google属性时不会在多个组中具有属性。
将属性设置为null
将从频道中完全删除它。我们不生成具有空值的XML块。
生成频道
配置设置完成后,可以使用以下命令生成初始频道
php artisan aero:feed:generate google
调度
假设您已配置Laravel的调度器并在服务器上定义了cron,则该软件包将在每天凌晨1点自动运行上述命令,无需任何其他更改。您可以使用简单的字符串(如'01:00'
或'17:30'
)在配置文件中更改时间。
有关Laravel内置调度器的更多信息,请参阅Laravel文档
访问订阅源
可以从以下URL访问订阅源:[website.com]/feed/google.xml