[MSHOP-194] resetShoppingCart() should not be called from the template but from the form processor Created: 01/Jul/15 Updated: 15/Jul/15 Resolved: 15/Jul/15 |
|
| Status: | Resolved |
| Project: | Magnolia Shop (closed) |
| Component/s: | None |
| Affects Version/s: | 2.2 |
| Fix Version/s: | 2.3.0 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Will Scheidegger | Assignee: | Will Scheidegger |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Description |
|
After the checkout is finished, the session variable containing the shopping cart should be reset. The ShopSingletonParagraphTemplateModel.resetShoppingCart() method is currently called from an ftl template. Besides the fact that the UI should contain close to zero business logic, it has more disadvantages:
The proper place to reset the shopping cart is probably in the processor chain itself (as last task). |
| Comments |
| Comment by Will Scheidegger [ 15/Jul/15 ] |
|
Spending some more thought on this I think resetting the shopping cart should be part of the SaveAndConfirmFormProcessor.
Therefore it makes sense to do this at this point. To have the shopping cart available for the following form processors (order mail, confirmation mail...) and possibly the confirmation page, the cart should be moved to a new session variable: [shop name]_lastShoppingCart |
| Comment by Will Scheidegger [ 15/Jul/15 ] |
|
Shopping cart now reset when cart is solved |