Attribute typename not visible in JSON API

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
jjag3r
Posts: 2
Joined: 31 Jan 2024, 19:08

Attribute typename not visible in JSON API

Post by jjag3r » 19 Aug 2024, 19:33

Hello,

I'm trying to return typename (name of the attribute type) when selecting product or attribute:

Code: Select all

/jsonapi/product?id=19557&include=attribute/type
or

Code: Select all

/jsonapi/attribute?id=3294&include=type
I get only type code and not type name:

Code: Select all

"attributes": {
            "attribute.id": "3294",
            "attribute.domain": "product",
            "attribute.type": "MKT_Material",
            "attribute.code": "MKT10899",
            "attribute.label": "Aluminij",
            "attribute.status": 1,
            "attribute.position": 0
        }
        
Is this even possible? In the documentation, there is always typename included:
https://aimeos.org/docs/2023.x/frontend ... h-products

Code: Select all

...
, {
        "id": "25",
        "type": "attribute",
        "attributes": {
            "attribute.id": "25",
            "attribute.domain": "product",
            "attribute.code": "demo-black",
            "attribute.status": 1,
            "attribute.type": "color",
            "attribute.typename": "Color",
            "attribute.position": 1,
            "attribute.label": "Demo: Black"
        }
    },
    ....
Thank you!

User avatar
aimeos
Administrator
Posts: 8620
Joined: 01 Jan 1970, 00:00

Re: Attribute typename not visible in JSON API

Post by aimeos » 20 Aug 2024, 09:57

There's no "typename" property available. The documentation is wrong and we've fixed it now.

Up to 2023.10, the type items were not relevant because the type items didn't contain the translations and it was necessary to translate the attribute type code in the client code. Since 2024.x the type items can contain translations to different languages and now, the type items become relevant.

We will add the possibility to fetch the attribute type items in the upcoming 2024.10 (ETA in 6 weeks) to by using "include=attribute.type".
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

jjag3r
Posts: 2
Joined: 31 Jan 2024, 19:08

Re: Attribute typename not visible in JSON API

Post by jjag3r » 25 Aug 2024, 11:11

Thank you very much for fast response and the implementation. Looking forward to use this feature.

User avatar
aimeos
Administrator
Posts: 8620
Joined: 01 Jan 1970, 00:00

Re: Attribute typename not visible in JSON API

Post by aimeos » 24 Sep 2024, 09:30

The necessary changes have been added now and you will be able to fetch the attribute type items using "include=attribute.type" starting in version 2024.10
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply