Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Thi Tar 11 posts 91 karma points
    Jul 31, 2017 @ 04:47
    Thi Tar
    0

    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

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Jul 31, 2017 @ 11:27
    Alex Skrypnyk
    100

    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

  • Thi Tar 11 posts 91 karma points
    Jul 31, 2017 @ 11:38
    Thi Tar
    0

    Hi Alex,

    Thank you so much. I will give it a try.

    Thanks again

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Jul 31, 2017 @ 13:30
    Alex Skrypnyk
    0

    You are welcome, Thi

    Please, share with our community is it working for you?

    Alex

  • Thi Tar 11 posts 91 karma points
    Aug 01, 2017 @ 02:25
    Thi Tar
    0

    Hi Alex,

    Sure. Once I have tried, I will share with the community.

    Regards

  • Thi Tar 11 posts 91 karma points
    Aug 22, 2017 @ 03:20
    Thi Tar
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft