2017 © Pedro Peláez
 

magento2-module magento2-attribute-option-code

image

snowio/magento2-attribute-option-code

  • Monday, January 15, 2018
  • by joshdifabio
  • Repository
  • 3 Watchers
  • 7 Stars
  • 26,306 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 21 Versions
  • 14 % Grown

The README.md

Magento 2 Attribute Option Code

Description

Magento 2 module that that adds a unique code to an attribute option. Attribute options can now be created by remote clients with an identifier (attribute option code) that the client can specify and later reference during product saves. Attribute options that were created with the client can also be deleted by specifing the attribute option code that belongs to the attribute option. Please refer to the endpoint table for uri endpoint paths., (*1)

Magento Versions

  • 2.3.x use 2.x tags
  • 2.4.x use master

Prerequisites

  • PHP 5.6 or newer
  • Composer (https://getcomposer.org/download/).
  • magento/framework 100 or newer
  • magento/module-eav 100 or newer
  • magento/module-catalog 101 or newer

Installation

composer require snowio/magento2-attribute-option-code
php bin/magento module:enable SnowIO_AttributeOptionCode
php bin/magento setup:upgrade

Usage

Endpoint table

HTTP Method URI Path Description
POST /V1/coded-attribute-options Creates an Attribute option with a corresponding option code. See Creating a coded attribute option
DELETE /V1/coded-attribute-options/entity-type/:entityType/attribute-code/:attributeCode/option-code/:optionCode Deletes an attribute option code. See Deleting attribute options for more information.
PUT /V1/products-with-option-codes/:sku Saves a product with attribute option codes specified instead of attribute option IDs'. See Specifying attribute options in products for more information

Creating a coded attribute option

Request message body (JSON)

{
    "entity_type" : 4,
    "attribute_code" : "testAttribute",
    "option" : {
        "label": "foo",
        "value": "bar",
        "sort_order": 0,
        "is_default": true,
        "store_labels": [
            {
                "store_code" : "testStore",
                "label": "Foo Label Test"
            }
        ]
    }
}
Message body description
  • entity_type integer : The entity type that the attribute option corresponds to.
  • attribute_code string : The attribute code of the that corresponds to the option
  • option :
    • label string : The option label
    • value string : The option code
    • sort_order integer : The option's sort order
    • is_default boolean : default option flag
    • store_labels 1..n :
      • store_code string : The store code for the option
      • label string : The option label

Deleting attribute options

  • :entityType integer : The entity type that the attribute option corresponds to.
  • :attributeCode string : The attribute code that the attribute option corresponds to.
  • :optionCode string : The attribute option code.

Specifying attribute options in products

URI parameters

  • :sku string : The products sku.

Request message body (JSON)

{
    "product": {
        "type_id": "simple",
        "sku": "test-from-snowio-simple",
        "attribute_set_id": 4,
        "name": "test from snow.io simple",
        "price": 10,
        "visibility": 4,
        "status": 1,
        "custom_attributes": {
            "testAttribute": "bar"
        }
    }
}

NOTE that the value of the custom attribute testAttribute is the attribute option code bar., (*2)

License

This software is licensed under the MIT License. View the license, (*3)

The Versions

15/01 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100|^101
  • magento/module-eav ^100|^101
  • magento/module-catalog ^101|^102

 

by Alexander Wanyoike

15/01 2018

v1.8.1

1.8.1.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100|^101
  • magento/module-eav ^100|^101
  • magento/module-catalog ^101|^102

 

by Alexander Wanyoike

12/01 2018

v1.8.0

1.8.0.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100|^101
  • magento/module-eav ^100|^101
  • magento/module-catalog ^101|^102

 

by Alexander Wanyoike

09/10 2017

v1.7.2

1.7.2.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100|^101
  • magento/module-eav ^100|^101
  • magento/module-catalog ^101|^102

 

by Alexander Wanyoike

09/10 2017

dev-m2.2-deps

dev-m2.2-deps

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100|^101
  • magento/module-eav ^100|^101
  • magento/module-catalog ^101|^102

 

by Alexander Wanyoike

26/07 2017

v1.6.2

1.6.2.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

26/07 2017

v1.6.1

1.6.1.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

26/07 2017

v1.6.0

1.6.0.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

25/07 2017

v1.5.0

1.5.0.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

21/07 2017

v1.4.3

1.4.3.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

26/05 2017

v1.4.2

1.4.2.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

22/05 2017

v1.4.1

1.4.1.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

18/05 2017

v1.4.0

1.4.0.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

10/02 2017

dev-feature/update-readme

dev-feature/update-readme

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

18/11 2016

v1.3.0

1.3.0.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

18/11 2016

v1.2.3

1.2.3.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

17/11 2016

v1.2.2

1.2.2.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

15/11 2016

v1.2.1

1.2.1.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

15/11 2016

v1.2.0

1.2.0.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

15/11 2016

v1.1.0

1.1.0.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike

15/11 2016

v1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

  • php >=5.6
  • magento/framework ^100
  • magento/module-eav ^100
  • magento/module-catalog ^101

 

by Alexander Wanyoike