outeredge / magento-structured-data-module
outer/edge出品的Magento结构化数据模块
5.0.8
2024-07-26 10:48 UTC
Requires
- php: ^8.1
Requires (Dev)
- dev-master
- 5.0.8
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.2.1
- 4.2.0
- 4.1.0
- 4.0.10
- 4.0.9
- 4.0.8
- 4.0.7
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.4.1
- 2.4.0
- 2.3.9
- 2.3.8
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.25
- 2.2.24
- 2.2.23
- 2.2.22
- 2.2.21
- 2.2.20
- 2.2.19
- 2.2.18
- 2.2.17
- 2.2.16
- 2.2.15
- 2.2.14
- 2.2.13
- 2.2.12
- 2.2.11
- 2.2.10
- 2.2.9
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.0
- 1.2.1
- 1.2.0
- 1.1.0
- dev-fix-pb-description-issue
- dev-fix-beforeClean
- dev-improve-cache
- dev-fix-availability
- dev-fix-sequence-issue
- dev-fix-flush-cache
- dev-add-cache
- dev-improve-performance
- dev-fix-out-of-stock
- dev-64-improve-tax-calculation
- dev-vseager-patch-ratingcount
- dev-check-review-enable
- dev-54-product-backorders
- dev-product-reviews
- dev-category-data
- dev-fix-get-product-attr-color
- dev-graphql
- dev-add-gtin-field
- dev-fix-reviews
- dev-magento1
This package is auto-updated.
Last update: 2024-09-25 15:55:12 UTC
README
outer/edge为Magento 2提供的结构化数据模块
我们的开源模块允许您通过安装我们的模块并设置一些配置选项,快速将结构化数据标记(也称为丰富片段)添加到任何Magento 2店铺。
安装此模块后,您的产品、联系和CMS页面将包含有效的结构化数据。例如: https://developers.google.com/search/docs/advanced/structured-data/product
它将类似于以下内容
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Product",
"@id": "https://example.co.uk/blue-t-shirt#Product",
"brand": {
"@type": "Brand",
"name": "Nike"
},
"aggregateRating": {
"@type": "AggregateRating",
"bestRating": "100",
"worstRating": "1",
"ratingValue": "4.55",
"reviewCount": "5"
},
"name": "Nike Blue T-Shirt",
"sku": "blue-t-shirt",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer viverra vitae nulla quis venenatis. Donec sollicitudin pharetra eros, in facilisis justo fringilla eu. In at consequat felis.",
"image": "https://example.co.uk/media/catalog/product/b/t/blue-t-shirt.jpg",
"offers": {
"@type": "Offer",
"url": "https://example.co.uk/blue-t-shirt",
"price": 18.99,
"priceCurrency": "GBP",
"priceSpecification": {
"@type": "UnitPriceSpecification",
"price": 18.99,
"priceCurrency": "GBP",
"valueAddedTaxIncluded": true
},
"availability": "http://schema.org/InStock",
"itemCondition": "http://schema.org/NewCondition"
}
}
</script>
该模块提供以下结构化数据
产品页面(支持GraphQL)
- @type
- @id
- name
- sku
- description
- image
- weight
- brand
- aggregateRating
- bestRating
- worstRating
- ratingValue
- reviewCount
- mpn
- material
- color
- price
- priceCurency
- valueAddedTaxIncluded
- availability
- itemCondition
- AggregateOffer
- offers
- highPrice
- lowPrice
联系页面
- @type
- @id
- name
- image
- address
- telephone
- url
- geo
CMS页面
- name
- mainContentOfPage
- description
- primaryImageOfPage
安装
通过Composer安装
composer require outeredge/magento-structured-data-module
查看结构化数据模块的配置
配置在 商店 > 配置 > outer/edge > 结构化数据
中可用。以下选项可用
结构化数据(产品)
- 启用: 启用或禁用产品页面上的结构化数据。
- 使用简短描述: 使用
short_description
属性作为description
标记。默认情况下将使用description
。 - 包含子产品: 选择是否在可配置产品页面上包含每个子(简单)产品的单独出价。
- 包含产品重量: 在产品页面结构化数据中添加
weight
架构。 - 产品品牌/制造商字段: 选择用于填充结构化数据值的Magento属性。
- 品牌(默认:
manufacturer
或brand
) - MPN(默认:空)
- ISBN(默认:空)
- 尺寸(默认:空)
- GTIN(默认:空)
- 颜色(默认:
Color
或Colour
) - 材料(默认:空)
- 关键词(默认:空)
- 品牌(默认:
结构化数据(CMS页面)
- 启用: 启用或禁用CMS页面上的结构化数据。
- 启用关于页面: 启用或禁用
"@type": "AboutPage"
。 - 关于页面: 选择用于
"@type": "AboutPage"
的CMS页面。
结构化数据(联系页面)
- 启用: 启用或禁用联系页面上的结构化数据。
- 类型: 选择业务是本地企业还是组织。
- 纬度: 指定本地企业的纬度。
- 经度: 指定本地企业的经度。
一旦模块安装和配置完成,您将在源代码中找到结构化数据标记
GraphQL
我们的结构化数据模块为内置的Magento GraphGL端点提供了产品结构化数据。只需按照以下示例请求structured_data
字段,并按照产品数据提供示例,数据将以JSON数组的形式返回
{
products(
filter: {
...
}
) {
items {
sku
name
structured_data
}
}
}
卸载模块
通过Composer移除
composer remove outeredge/magento-structured-data-module
参考资料
关于结构化数据格式的Google文档(使用JSON-LD格式)
https://developers.google.com/search/docs/guides/intro-structured-data https://developers.google.com/search/docs/advanced/structured-data/product