Can someone guide me or advise me how can I get the product lists in Merchello? Basically what I need is to get the products lists(the product name, availability value, image url etc) as a json data.
The only thing that you need - transform objects to json, it's easy to do with UmbracoApiControllers, just return all products from UmbracoApiController and you will have json.
I have managed to get the product data as the json in Merchello with Product service GetAll() method. But now I have got another problem with the image for each product. Where can I upload the image for the products and how to get the url of the image as the json? I’ve read about Merchello product extended data and tried image with the upload editor. After that, what do I do? Do I need to write some code to get the url and where the uploaded images are saved?
Get All products as a json data in Merchello
Hi All,
Can someone guide me or advise me how can I get the product lists in Merchello? Basically what I need is to get the products lists(the product name, availability value, image url etc) as a json data.
Thanks in advance
Hi Thi
Try to use GetAll() method from ProductService - https://github.com/Merchello/Merchello/blob/v2.2.0/src/Merchello.Core/Services/ProductService.cs
The only thing that you need - transform objects to json, it's easy to do with UmbracoApiControllers, just return all products from UmbracoApiController and you will have json.
Thanks,
Alex
Hi Alex,
Thank you so much. I will give it a try.
Thanks again
You are welcome, Thi
Please, share with our community is it working for you?
Alex
Hi Alex,
Sure. Once I have tried, I will share with the community.
Regards
Hi Alex,
I have managed to get the product data as the json in Merchello with Product service GetAll() method. But now I have got another problem with the image for each product. Where can I upload the image for the products and how to get the url of the image as the json? I’ve read about Merchello product extended data and tried image with the upload editor. After that, what do I do? Do I need to write some code to get the url and where the uploaded images are saved?
Will appreciate any helps.
Regards,
Thi Tar
is working on a reply...