JSON REST API Modifications
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!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 44
- Joined: 05 Oct 2019, 06:42
JSON REST API Modifications
I want to know if I have an api for the product ie http://aimeos.test/default/jsonapi/prod ... [offset]=1
and I want to make change in this particular api. How would I proceed with it? I am not able to find any documentation regarding making change in a particular json api endpoint.
I want to return this api response in random. I want to know how would I proceed to implement this in Aimeos?
and I want to make change in this particular api. How would I proceed with it? I am not able to find any documentation regarding making change in a particular json api endpoint.
I want to return this api response in random. I want to know how would I proceed to implement this in Aimeos?
Re: JSON REST API Modifications
If you change the product API endpoint, it will ALWAYS return random results and this is certainly not what you want. Copy the product Factory and Stanard classes into a new "Random" directory of your own extension and and use your own product manager there instead to get the random results you want:
https://github.com/aimeos/ai-client-jso ... pi/Product
Afterwards, add your new "random" endpoint to your config so it will be available in the frontend:
https://github.com/aimeos/ai-client-jso ... nt.php#L12
https://github.com/aimeos/ai-client-jso ... pi/Product
Afterwards, add your new "random" endpoint to your config so it will be available in the frontend:
https://github.com/aimeos/ai-client-jso ... nt.php#L12
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star