bkwld / craft-importable-shopify-feeds
一个将 Shopify 数据映射到易于 FeedMe 消费的数据源格式的 Craft 插件。
1.9.0
2024-04-08 18:59 UTC
Requires
- craftcms/cms: ^3.0 || ^4.0
- guzzlehttp/guzzle: ^7.4
- illuminate/collections: ^8 || ^9
Requires (Dev)
- craftcms/rector: dev-main
README
一个将 Shopify 数据映射到易于 FeedMe 消费的数据源格式的 Craft 插件。
设置
此插件假定您的 Craft .env 文件包含以下内容
SHOPIFY_URL=https://your-store.myshopify.com SHOPIFY_ADMIN_API_ACCESS_TOKEN=xxxxxxxxxxx
此外,您需要授予您的自定义应用以下权限
- 产品列表
read_product_listings
- 产品
read_products
使用
设置 FeedMe 以查询以下任一路径。我们仅公开最小数据集,以用于创建匹配的 Craft 产品。假设 Shopify 是所有其他字段和其数据的真实来源,这些数据不应在 Craft 中缓存。
产品
https://cms-domain.com/actions/importable-shopify-feeds/feeds/products
[ { "title": "Product Title", "handle": "product-title" }, ]
变体
https://cms-domain.com/actions/importable-shopify-feeds/feeds/variants
[ { "title": "Variant Title", "sku": "413071", "product":{ "title": "Product Title", "handle": "product-title" }, "dashboardTitle": "Product Title - Variant Title (413071)" }, ]
收藏夹
https://cms-domain.com/actions/importable-shopify-feeds/feeds/collections
[ { "title": "Collection Title", "handle": "collection-title" }, ]
多个 Shopify 店铺
如果您有多个 Shopify 店铺但只有一个 Craft 实例(例如,如果您正在使用 Craft 的多站功能来管理多个 Shopify 店铺),您可以使用任意命名空间后缀指定 Shopify ENV 凭据。例如
SHOPIFY_URL=https://your-store.myshopify.com SHOPIFY_ADMIN_API_ACCESS_TOKEN=xxxxxxxxxxx SHOPIFY_URL_CANADA=https://your-canadian-store.myshopify.com SHOPIFY_ADMIN_API_ACCESS_TOKEN_CANADA=xxxxxxxxxxx
然后,您可以在所有 feed URL 中使用该命名空间,如下所示
https://cms-domain.com/actions/importable-shopify-feeds/feeds/products?store=CANADA