Get text content in all language for JSON Rest APIs

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

Get text content in all language for JSON Rest APIs

Post by traiyani75 » 07 Jun 2021, 12:50

Hello,

We have added english and arabic text into our payment and delivery service. Now, for searching purpose want to get both the text at same time from the REST APIs.

Right now, It is returning English by default and when we pass locale=ar, then it is returning Arabic text content. How can we get both language content as same time?

Thanks in advance

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

Re: Get text content in all language for JSON Rest APIs

Post by aimeos » 09 Jun 2021, 11:28

That's difficult because only the texts for the current language is returned. You would have to change the "jincluded" view helper in the JSON API implementation to return all texts by removing the "isAvailable()" call here:
https://github.com/aimeos/ai-client-jso ... d.php#L144

This may have other unforseen consequences e.g. for prices which are returned but shouldn't be available to the customers.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply