Copied to clipboard

Flag this post as spam?

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

  • Simon 687 posts 1062 karma points
    Sep 02, 2016 @ 10:05

    Get All Merchello Products

    Hi guys,

    Can anyone guide me on how I can get all products of Merchello, because I want just a drop-down with products Names.

    Thank you in advance.

    Kind Regards

  • Simon Dingley 1383 posts 3233 karma points c-trib
    Sep 02, 2016 @ 10:16
    Simon Dingley

    Hi Simon,

    Try something like the following:

    merchelloHelper.Query.Product.Search(1, 10000)

    Where 10,000 is higher than the total number of products. I don't believe there is currently a method to directly request all products but it would be a good idea to add this as a new feature on the issue tracker as I can see it might be useful.

    Cheers, Simon

  • Simon 687 posts 1062 karma points
    Sep 30, 2016 @ 19:48

    But with this the query execution will occur so it can be used to skip for pagination.

    Are there another way how I can get all products as SQL, as LINQ?

    Thank you

  • Simon 687 posts 1062 karma points
    Dec 13, 2016 @ 14:48

    Hi Simon

    Can I use the GetAll() from - Product Service?

    It returns IEnumberable. I think I can filter using the where clause and execute later on, right?

    Kind Regards

  • john blair 6 posts 76 karma points
    Mar 25, 2019 @ 19:11
    john blair


    I too am trying to get a list of products. I've used the following code but get 0 products back. I have installed the fasttrack starter kit and the catalog page shows all the products ok. Am i missing something? I rebuilt the Merchello examine indexes via the umbraco back end but made no difference. THe following code is run in vs from the App_Code folder. I'm using latest merchello and umbraco 7.x

    I've just started looking into the merchello api - it looks like there are almost no code examples out there...and i find im wasting my time in it just me?

            var merchello = new MerchelloHelper();
            var allProducts = merchello.Query.Product.Search(0, int.MaxValue).Items.ToList();

    Ideally I wanted to use the Serarch method with the search term ....but thought it would be easy to get a basic list of products....i guess not.

    UPDATE: My search line of code was wrong - the first page is 1 not 0 - the following worked for me.

    // Merchello search - limit search to that configured on the front end.
    var allProducts = merchello.Query.Product.Search(q, 1, Convert.ToInt32(maxSearchItems)).Items.ToList();
  • Thi Tar 11 posts 91 karma points
    Jul 31, 2017 @ 12:13
    Thi Tar

    Hi Simon,

    Have you achieved to get all products of Merchello? Did you use GetAll()? Can I ask you how did you do to achieve this?

    Thanks in advance

Please Sign in or register to post replies

Write your reply to: