Details
-
Bug
-
Resolution: Fixed
-
Neutral
-
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
- is related to
-
MSHOP-46 Migrate code to the latest Magnolia API
-
- Closed
-