2

I have the next code to obtain product list from Magento API in VB.

    Dim pws As New MagentoService.MagentoService
    Dim sesionID = pws.login("xxxxxx", "xxxxxxxxxxxxxx")
    Dim result

    Dim filters As New MagentoService.filters
    Dim complexFilter(0) As MagentoService.complexFilter
    complexFilter(0) = New MagentoService.complexFilter
    complexFilter(0).key = "manufacturer"
    Dim assEnt As New MagentoService.associativeEntity
    With assEnt
        .key = "manufacturer"
        .value = "34"
    End With
    complexFilter(0).value = assEnt

    filters.complex_filter = complexFilter
    result = pws.catalogProductList(sesionID, filters, "0")

And all works fine, I get the product list from manufacturer 34. But now I want to get the product from manufacturer 34 and set 9. I can't code the apropiate filter.

Any one can help me? Thanks in advance.

  • I have no idea about VB, but couldn't you just build a similar variable as assEnt and make complexFilter(1).value = yourNewVar? – Marius Jul 22 '15 at 11:25
  • I try it before but don't works. – jfrubio Jul 22 '15 at 13:28
2

Finally I found the solution, you are right Marius. See detail.

    Dim pws As New MagentoService.MagentoService
    Dim sesionID = pws.login("xxxxxxx", "xxxxxxxxxxx")
    Dim result

    Dim filters As New MagentoService.filters
    Dim complexFilter(2) As MagentoService.complexFilter
    complexFilter(0) = New MagentoService.complexFilter
    complexFilter(0).key = "manufacturer"
    Dim assEnt As New MagentoService.associativeEntity
    With assEnt
        .key = "manufacturer"
        .value = "34"
    End With
    complexFilter(0).value = assEnt

    complexFilter(1) = New MagentoService.complexFilter
    complexFilter(1).key = "set"
    Dim assEnt2 As New MagentoService.associativeEntity
    With assEnt2
        .key = "set"
        .value = "9"
    End With
    complexFilter(1).value = assEnt2

    filters.complex_filter = complexFilter
    result = pws.catalogProductList(sesionID, filters, "0")

Now I get SOAP answer filtered by set and manufacturer.

Thanks

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.