I'm writing a CSV import and need a way to get all the current products which are part of a collection but aren't in the examine cache. I've tried the following but they all seem to try get products from Examine:
Thanks for coming back to me. I did try GetFromCollection as you can see in my original post but this also didn't return any products.
The reason I can't rely on examine is because the import saves the products with raise events set to false, which from what i can tell results in them not being added to the examine cache.
However if I run the import again straight afterwards both of those method calls seem to return 0 products.
This is working now, it turned out to be something I was doing rather than anything in the Merchello code base :( . Thank you for your help anyway and sorry to waste your time.
Get products from collection without using Examine cache
Hey,
I'm writing a CSV import and need a way to get all the current products which are part of a collection but aren't in the examine cache. I've tried the following but they all seem to try get products from Examine:
categoryCollection is an IEntityCollection. Any ideas of the correct way to do this?
Thanks,
Tom
The extensions off of
IEntityCollection
will use the Merchello helper to query the products (so Examine first).However, you can use the fallback method directly from the
ProductService
Hi Rusty,
Thanks for coming back to me. I did try GetFromCollection as you can see in my original post but this also didn't return any products.
The reason I can't rely on examine is because the import saves the products with raise events set to false, which from what i can tell results in them not being added to the examine cache.
However if I run the import again straight afterwards both of those method calls seem to return 0 products.
Thanks,
Tom
Are you using the product service in your import? Maybe it's the RuntimeCache not getting cleared?
Hi Rusty,
This is working now, it turned out to be something I was doing rather than anything in the Merchello code base :( . Thank you for your help anyway and sorry to waste your time.
Cheers, Tom
is working on a reply...