Commit 01f451b
committed
Add configurable mergeable orders finder class
Introduce `Spree::Config.mergeable_orders_finder_class` to allow
stores to customize which orders are merged when a user logs in.
By default, all incomplete orders from the same store are merged,
but stores can implement custom logic (e.g., only merge orders
from the last 7 days) by providing a custom finder class.
Changes include:
- Add `Spree::MergeableOrdersFinder` to centralize order selection logic
and support custom strategies
- Update `set_current_order` in `Spree::Core::ControllerHelpers::Order`
to delegate order selection to the configured finder
- Add `class_name_attribute :mergeable_orders_finder_class` to
`Spree::AppConfiguration` with default `'Spree::MergeableOrdersFinder'`
Issue #6366
Signed-off-by: Thukten Singye <[email protected]>1 parent 839752f commit 01f451b
File tree
3 files changed
+23
-4
lines changed- core
- app
- helpers/spree/core/controller_helpers
- models/spree
- lib/spree
3 files changed
+23
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| 412 | + | |
| 413 | + | |
412 | 414 | | |
413 | 415 | | |
414 | 416 | | |
| |||
0 commit comments