JSON Api to get variants

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!
traiyani75
Advanced
Posts: 114
Joined: 08 Nov 2019, 11:56

JSON Api to get variants

Post by traiyani75 » 04 May 2020, 14:25

Hello,

We are using aimoes JSON API into a mobile application. Now we are working on variants into products.
For that, I have created a product with a selection type and also added two different variants based on the color attributes. And I have checked API for the product list too, It returns the product which has type selection.
Now, How do I get all variants of that product? How do I detect that color attr has only variant products and other attributes don't have products?

Thanks & regards
Tejas

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

Re: JSON Api to get variants

Post by aimeos » 06 May 2020, 07:24

Use "&include=product,attribute". That will return selection products with relationships to products and their attributes.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
mefailing
Posts: 7
Joined: 15 Feb 2022, 14:15

Re: JSON Api to get variants

Post by mefailing » 19 Apr 2022, 11:50

I now get the variants included. However, without the respective price. Can I get the price directly or do I have to send extra Ajax requests?

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

Re: JSON Api to get variants

Post by aimeos » 20 Apr 2022, 10:06

Use ""&include=product,attribute,price" to retrieve the product prices too:
https://aimeos.org/docs/latest/frontend ... -resources
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
mefailing
Posts: 7
Joined: 15 Feb 2022, 14:15

Re: JSON Api to get variants

Post by mefailing » 22 Apr 2022, 09:48

oh thx found it!

Post Reply