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

    • Improvement
    • Status: Resolved
    • Neutral
    • Resolution: Fixed
    • 2.2
    • 2.3.0
    • 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

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

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    DoD

                    CI Builds

                      No builds found.