-
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
Extending quote item with extension attributes - problem with load/save of attributes #21634
Comments
Hi @bartoszkubicki. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @bartoszkubicki do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @engcom-backlog-nazar. Thank you for working on this issue.
|
Hi @bartoszkubicki thank you for you report, It will be processed faster if you move this to https://github.com/magento/community-features |
Summary (*)
Recently, I was trying to extend quote item with extension attributes. I needed it inside cart and checkout. So there are actually two ways for loading and persisting extension attributes along extended model.
For
CartItemRepository
this maybe would work for webapi - inside cart, checkout quote items are loaded in other ways - sometimes fromqoute
- by items collection, sometimes by directly loading model. It turns out thatCartItemRepository
is not very useful in frontend. Here comes also other grave problem - service contracts vs ,methods loading/returing/requiring concret implementations - many cases forquote
andquote item
.ExtensionPool
, but it requires resource model usingEntityManager
, which is is not recommended . Despite of this for qoute item it is imposible, beacause, crud operations are performed in 'old-fashioned' way.Finally, to perform crud operations on cart and checkout, with main logic in subtotals I ended up with plugins for three classes and override 5 methods -
quote items
are not loaded in any consistent way.Examples (*)
Hard to provide - generally module doesn't seem to follow general guidelines from Magento.
Proposed solution
Clean up crud operations for
quote
andquote item
, so service contract are used more widely on frontend, so we are not relying on implementations, but on contracts.The text was updated successfully, but these errors were encountered: