雪域科技/magento2-extended-product-repository

一个允许通过扩展属性选项标签创建产品的 Magento 2 模块

v3.1.0 2022-06-17 14:28 UTC

README

Build Status codecov

描述

该 Magento 2 模块增加了以下扩展属性。

  • 可配置产品选项中的属性代码字段:现在端点可以指定可配置产品选项的属性代码。
  • 可配置产品关联的 SKU:现在端点可以指定产品 SKU 作为可配置产品链接

先决条件

  • PHP 7.0 或更高版本
  • Composer (https://getcomposer.org.cn/download/).
  • magento/framework 100 或更高版本
  • magento/module-catalog 101 或更高版本
  • magento/module-eav 100 或更高版本
  • magento/module-configurable-product 100 或更高版本

安装

composer require snowio/magento2-extended-product-repository
php bin/magento module:enable SnowIO_ExtendedProductRepository
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush

用法

  • 现在,configurable_product_option 可以有一个 attribute_code,允许端点指定可配置产品选项的属性代码。
  • configurable_product_linked_skus 允许端点指定 SKU 作为可配置产品链接,而不是 Magento ID。
{
    "product": {
        "type_id": "configurable",
        "sku": "test-from-snowio-configurable",
        "attribute_set_id": 11,
        "name": "test from snow.io configurable",
        "price": 10,
        "visibility": 4,
        "status": 1,
        "custom_attributes": {
            "axis_size": "s_xxl",
            "url_key": "test-from-snowio-configurable.html"
        },
        "extension_attributes": {
            "configurable_product_options": [
                {
                    "extension_attributes": {
                        "attribute_code": "axis_size"
                    }
                }
            ],
            "configurable_product_linked_skus": [
                "test-from-snowio-simple"
            ]
        }
    }
}

许可证

本软件根据 MIT 许可证授权。 查看许可证