0

I am trying to change change currency symbol that appears throughtout broadleaf application.

Exploring the code I found that BLC has a thymleaf dialect 'blc' and and attribute 'price' to render price/cost in web pages.

Example:

<div style="font: 32px/28px 'Oxygen', Helvetica, sans-serif;" blc:price="${order.total}"></div>

Reffering to 'org.broadleafcommerce.core.web.processor.PriceTextDisplayProcessor' class , the overriden method getText seems to be returning '$' sign with the price :-

    if (price == null || price.isZero()) {
        return "$0.00";
    } else {
        return "$" + price.getAmount().toString();
    }

Doubts :-

  1. Where are the spring beans defined for BLC dialect and processor? How the blc dialect is actually configured and how can I configure my own processor for price attribute.

  2. How 'Currency Resolution' is connected with this See here

  3. Any quick workaround for this problem.

Please correct me if I am missing any information.

Thanks

Kumar Sambhav
  • 7,503
  • 15
  • 63
  • 86

1 Answers1

1

Kumar,

You will want to upgrade to Broadleaf Commerce 2.2 where the PriceTextDisplayProcessor was enhanced to handle currency formatting.

Information on your other questions:

  • Broadleaf Commerce provides a set of Thymeleaf Processors collectively known as a BLCDialect. Most are defined in this file on Github
  • Creating your own thymeleaf dialect to use with BLC is discussed here.
  • In 2.2, the key mechanism for setting locale (and generally currency as a result) happens with the BroadleafRequestProcessor

Support for multiple currencies is achieved via the Price List feature that is part of the Broadleaf Commerce commercial module. Showing a single currency can be done using the steps above or perhaps more simply in your case by writing your own Thymeleaf Processor.

polster
  • 1,353
  • 1
  • 8
  • 6