How to Include Property Labels in Product Property Attributes Using 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!
User avatar
Paulus-Ragnarr
Posts: 16
Joined: 15 Oct 2024, 07:02

How to Include Property Labels in Product Property Attributes Using JSON:API?

Post by Paulus-Ragnarr » 25 Nov 2024, 06:06

Hi Aimeos,

I’m working on a JS frontend and focusing on product details, particularly product properties. Is there a way to include the property label within the product property attributes using the JSON:API include?

The reason is that formatting product.property.type directly in the frontend has been challenging. Including the property label would make the process much more straightforward.

Thanks in advance!
Attachments
Screenshot 2024-11-25 at 1.58.53 PM.png
Screenshot 2024-11-25 at 1.58.53 PM.png (90.76 KiB) Viewed 14582 times
Screenshot 2024-11-25 at 12.09.40 PM.png
Screenshot 2024-11-25 at 12.09.40 PM.png (69.18 KiB) Viewed 14582 times

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

Re: How to Include Property Labels in Product Property Attributes Using JSON:API?

Post by aimeos » 25 Nov 2024, 14:44

You need Aimeos 2024.10.x and use "include=product.property,product.property.type". Then, the "included" section contains a type item related to the property item.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
PaoloLegaspi
Posts: 21
Joined: 07 Nov 2024, 15:02

Re: How to Include Property Labels in Product Property Attributes Using JSON:API?

Post by PaoloLegaspi » 26 Nov 2024, 08:14

Hello thanks for the reply.

I’ve updated from version 2024.07.x to 2024.10.x as you suggested and included the query "product,product/property,product/property/type". However, the response still doesn’t include the property label or the product property type.

Are there any additional configurations I need to set up to get these values?

Thanks!

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

Re: How to Include Property Labels in Product Property Attributes Using JSON:API?

Post by aimeos » 28 Nov 2024, 14:00

Can you please update the JSON:API package to get the required bugfix by executing:

Code: Select all

composer req aimeos/ai-client-jsonapi:2024.10.x-dev
Then, use "include=product.property,product.property.type" to get the product properties and their types.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply