Copied to clipboard

Flag this post as spam?

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


  • Puck Holshuijsen 184 posts 727 karma points
    Jun 27, 2017 @ 12:31
    Puck Holshuijsen
    0

    I need a list of Master products only, no variants included

    Hi Guys,

    I am currently working on a webshop with a lot of variants per product. I got a page with 35 master products, and each of that master product has 192 variants. So a total of 6720 products.

    As you can understand, the overview page is really slow.

    To get my productslist i am using the following:

     var queryResult = merchelloHelper.ProductContentQuery()
                      .Page(pageNr) // defaults to 1
                      .ItemsPerPage(ItemsPerPage) // defaults to 10                           
                      .ConstrainByCollectionKey(key)
                      .Execute();
    

    It's pretty straight forward (i think).

    But for my overview page, I just need the master products with an array of the optionchoices names.

    Just to show:

    Available colors: red, green, blue - Available sizes: S M L XL

    Is there a way to only get my master products, and leave all the variants at this point? The first time I load this page, it takes around 1.5 minutes...

    Thanks! Puck

  • Puck Holshuijsen 184 posts 727 karma points
    Jun 29, 2017 @ 06:57
    Puck Holshuijsen
    0

    I wrote a little piece of SQL myself to get this done, it would be great if it is possible to do this by default.

    I went from 1.5 minutes (7000 products) to 900ms loading (without caching) for my master products.

Please Sign in or register to post replies

Write your reply to:

Draft