- Issue created by @krystalcode
- 🇵🇪Peru krystalcode
Adding a patch for Commerce 2.33, I'll create an MR against the latest 2.x version soon.
- Merge request !503Draft: Issue #3544499 Add support for filtering and paging to the cart provider → (Open) created by krystalcode
- 🇵🇪Peru krystalcode
Remaining tasks as of now.
- Get feedback from maintainers to ensure they're in agreement with the approach.
- Add
NULL
handling and deprecation notice for the extra argument in the constructor.
Some more comments.
- I'm more in favor of unit tests, but since I know other like kernel or functional tests more those could be added/updated.
- Unit test are added this way so that classes extending the cart provider, for example, to alter the query, can easily add their own unit tests so that all checks are run with the changes without having to repeat all this code. Not sure if there's a better way.
- The tests could be refactored to reduce code repetition, but I think it would make code less understandable. For tests, I think there should be quick visibility on what exactly the test checks for without having to go through levels of inheritance and other tricks.
- We do lose the ability or add or remove the cache item for a specific cart when created or finalized - we have to clear all caches for the user. But I think that's more than compensated by the other performance advantages e.g. not loading cart entities at all for authenticated users - unless requested, limiting the number of carts requested and loaded etc.
- 🇵🇪Peru krystalcode
Moving to Needs Review to get some initial feedback from module maintainers.
- 🇵🇪Peru krystalcode
Re-uploading patch from #5 with some changes removed because they were moved to a separate issue.
- 🇮🇱Israel jsacksick
Thank you for your contribution, however please note that all new feature requests should go against 3.x.
TBH, this is a big MR to review and we have currently bigger priorities so I can't really promise we'll be able to review/commit these changes anytime soon.In general, breaking down the issue into multiple is always a good idea as it makes our job easier when it comes to reviewing the changes and simply even consider merging those.
In the meantime there is a query tag that can be implemented in your own project, and could also consider swapping the CartProvider.