Uploaded image for project: 'Magnolia Shop'
  1. Magnolia Shop
  2. MSHOP-194

resetShoppingCart() should not be called from the template but from the form processor

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Neutral
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3.0
    • Labels:
      None

      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:

      • what if the user closes the browser early? (template might still be rendered?)
      • what if a rendering error occurs?
      • what if the template gets modified, exchanged and the call is forgotten?
      • what if some other templating technology is used?

      The proper place to reset the shopping cart is probably in the processor chain itself (as last task).

        Checklists

        Acceptance criteria

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                will Will Scheidegger
                Reporter:
                will Will Scheidegger
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Checklists

                    DoD