• Resolved mattap

    (@mattap)


    Hey!

    I’m trying to use the php models to retreive products, purchases, checkouts, subscriptions, etc.

    The models ‘all’ method seems to work perfectly fine. However, when attempting to query using the ‘where’ method the result is still every object (i.e. it’s not queried and filtered).

    The only query that does in fact work as far as I can see is the example provided in your documentation (product – archived – true/false).

    I can’t determine what I’m doing wrong if I am.

    I’ve considered that potentially not everything in the object is querable so I checked your REST API reference and used only the query params set out (e.g. checkout – cutomer_ids). In that example I tried both customer and customer_ids as the key, both of which didn’t filter the output.

    I know I can filter the output after the fact to get what I need, but it would be great if I could get this working so I don’t have to retreive all objects as this could be quite a large number when, after it’s filtered, might only result in 1 or 2 entries.

    Thanks
    Matt

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mattap

    (@mattap)

    did some digging into the RequestService class and saw the api url that’s created and immediately saw what I was missing.

    I was trying ‘customer’ and ‘customer_ids’ as the key. Meaning I was missing off the [] at the end of the customer_ids.

    Long story short, I tried ‘customer_ids[]’ as the key and it worked as expected.

    Plugin Support Ivan C.

    (@ivanbsf)

    Hello @mattap

    It’s fantastic to hear that you have found a solution!

    Also, If you have any questions or issues, please feel free to contact us through the contact page on the SureCart website.

    Best,

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.