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

Prices are not properly formatted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 1.1.1
    • None
    • None

    Description

      The TemplateProductPriceBean formats the prices according to the pattern stored with the currency in the shop configuration, but it does not respect the current local stored in the aggregation state (instead uses the default locale). This "patch" would fix the problem:

          public String getPrice() {
              try {
                  if (price >= 0 && StringUtils.isNotBlank(this.getFormatting())) {
                      NumberFormat formatter = NumberFormat.getNumberInstance(MgnlContext.getAggregationState().getLocale());
                      DecimalFormat df = (DecimalFormat)formatter;
                      df.applyPattern(this.getFormatting());
                      return df.format(price);
                  }
              } catch (Exception e) {
                  log.error("error reading price", e);
              }
              return "" + price;
          }
      

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - 1h
                      1h
                      Remaining:
                      Remaining Estimate - 1h
                      1h
                      Logged:
                      Time Spent - Not Specified
                      Not Specified