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

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

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 2.3.0
    • 2.2
    • None

      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).

        Acceptance criteria

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

                Created:
                Updated:
                Resolved:

                  Task DoD