Author Topic: getProduct & searchForProducts  (Read 1378 times)

David

  • Full Member
  • ***
  • Posts: 59
    • View Profile
getProduct & searchForProducts
« on: October 23, 2007, 11:34:09 AM »
I don't know if I'm doing something wrong, but maybe this could be an error.

I need to find a product for a custom field. First I tried it with the searchForProducts method, I've got an AdminProduct with the product I need, but the field categories is null ¿?

if I use the getProduct method with the ID i've got in the first step I've got the product again, with the same information, but with the correct categories field.

bye

Brian

  • Administrator
  • Sr. Member
  • *****
  • Posts: 212
    • View Profile
    • KonaKart Website
Re: getProduct & searchForProducts
« Reply #1 on: October 23, 2007, 12:01:29 PM »
Hi David,

No, you're not doing anything wrong and it's not an error... this is expected behaviour for performance reasons.

The searchForProducts call returns "lightweight" product objects because there may be many of them so we don't fill them up with too many populated attributes.   If you want to drill down and get more detail you use getProduct as you have found.

Regards,
Brian

David

  • Full Member
  • ***
  • Posts: 59
    • View Profile
Re: getProduct & searchForProducts
« Reply #2 on: October 24, 2007, 10:40:06 AM »
mmmm, interesting. Thanks for the answer