-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to specify attributes to load on ProductRepository::getList() #1341
Comments
It's not right to use product collection directly, but this implementation of repository obviously does not support your scenario. So it should be fixed. |
Thanks for the reply Anton.
Of course it should also check if it is an inclusive filter. I would expect the result to be pretty much what developers want. Is there something planed? |
Is there an internal ticket for this issue? |
Yes. MAGETWO-38948. I don't think smth. is planned here. In my opinion attributeSetId and list of attributes to load do not belong to search criteria. These are operation modifiers and should be passed as an additional argument. |
From a clients point of view I would expect that each product received from the repository would have all values loaded for that product's attribute set, even if the |
@Vinai, internal ticket is closed and fix is available in 1.0.0-beta. Please, check it on this version. |
From what I can see now all attributes that are assigned to at least one attribtue set are always added to be selected, This works, thanks! |
Using Magento version 0.74.0-beta12, I'm trying to load a list of products, some of which belong to the Bag attribute set of the sample data.
Roughly this is the code I'm playing with:
As far as I can tell the
ProductRepository::getList()
method only adds the default attribute set attributes to the underlying collection.How can I add additional attributes to the loaded products? As far as I can tell it is only possible to specify attribute filters using the
SearchCriteria
.Or is it right to use
\Magento\Catalog\Model\Resource\Product\Collection
directly?Thanks for clarifying.
The text was updated successfully, but these errors were encountered: