GetRefItems from Json API
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!
- QuốcTrungNguyễnHoàng
- Posts: 14
- Joined: 06 Aug 2019, 03:22
GetRefItems from Json API
Hi, I'm try to get preview URL for product from JSON API product resource. My Json Reponse here:
How can i map references object Id from Relationship array with object id from Included Array not use loop for every product ?
How can i map references object Id from Relationship array with object id from Included Array not use loop for every product ?
Re: GetRefItems from Json API
The jsonapi.org standard doesn't allow to structure the "included" array in advance, so the best way is to loop over the "included" array once at the beginning and create an object tree of
e.g.
Afterwards, you can do a quick lookup when iterating over the products.
Code: Select all
{
"<domain>": {
"<id>": <entry>,
// ...
}
}
Code: Select all
let map = {};
for( let entry of included ) {
map[entry['type']][entry['id']] = entry;
}
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
- QuốcTrungNguyễnHoàng
- Posts: 14
- Joined: 06 Aug 2019, 03:22
Re: GetRefItems from Json API
Thank for your help,
Another problems,
I use Product JSON API Resource with f_catid filter, it not return promotion products in response
Another problems,
I use Product JSON API Resource with f_catid filter, it not return promotion products in response
Re: GetRefItems from Json API
Use promotion for f_listtype to get the promotional products of a category
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
- QuốcTrungNguyễnHoàng
- Posts: 14
- Joined: 06 Aug 2019, 03:22
Re: GetRefItems from Json API
I have some change from product category. But products retrieve from JSON api still not change, but products retrieve from MShop Product Class changed. It look like Json API get old categoryID of product. How can i fixed it? Tks very much.
Sorry for my bad English.
Sorry for my bad English.
Re: GetRefItems from Json API
Keep you index tables up to date and rebuild the product index using the "index/rebuild" job controller.
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