KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: David on October 23, 2007, 05:34:09 pm

Title: getProduct & searchForProducts
Post by: David on October 23, 2007, 05:34:09 pm
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
Title: Re: getProduct & searchForProducts
Post by: Brian on October 23, 2007, 06: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
Title: Re: getProduct & searchForProducts
Post by: David on October 24, 2007, 04:40:06 pm
mmmm, interesting. Thanks for the answer