Copied to clipboard

Flag this post as spam?

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


  • Richard B 14 posts 124 karma points
    Jul 20, 2016 @ 11:28
    Richard B
    0

    Get list of products by variant property

    Hi, what is the best way to get a list of products based on a variant property - specifically I would like all products that have any variants in stock.

    Thanks

  • Rune Grønkjær 1371 posts 3102 karma points
    Aug 01, 2016 @ 06:46
    Rune Grønkjær
    100

    Hi Richard,

    You would fetch all products and then use TC.GetVariants( storeId, product, true ) to get the variants for the products and check their stock.

    Your can either make your own Classes to "save" the products and their variants or you could just use GetVariants. In GetVariants Tea Commerce will cache the result, so it will go lightning fast the second time you get variants for the same product.

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft