XiaoFaye / WooCommerce.NET

A .NET Wrapper for WooCommerce/WordPress REST API
MIT License
391 stars 217 forks source link

Get ALL variation for a product #734

Closed tiziana-git closed 1 year ago

tiziana-git commented 1 year ago

I use .Product.Variations.GetAll(CULng(oProdMod(0).id))

but it gets me only 10 variations

i try this but how to pass product id?

            Dim ParCall As Dictionary(Of String, String) = New Dictionary(Of String, String)()
            ParCall.Add("per_page", "100")
            ParCall.Add("page", 1)
            ParCall.Add("sku", oProdMod(0).sku) ?????
            Dim oVarProd As List(Of Variation) = Await wc.Product.Variations.GetAll(ParCall)
tiziana-git commented 1 year ago

I have found the solution

            Dim ParCall As Dictionary(Of String, String) = New Dictionary(Of String, String)()
            ParCall.Add("per_page", "100")
            ParCall.Add("page", 1)
            Dim oVarProd As List(Of Variation) = Await wc.Product.Variations.GetAll(CULng(oProdMod(0).id), ParCall)