Formatting Currency

In the eCommerce Module, a formatted price is generated so partners can quickly output the correct price. However, you may sometimes need to convert a "raw" price integer to a currency format.

Instead, we can include price_formatter, which will convert the price from cents to dollars (or your currency's equivalent)

{%- include 'modules/siteglide_ecommerce/ecommerce/price_formatter'
    price_data: my_price_variable 
-%}

Here my_price_variable is the variable containing a price you'd like to format. This will then output the formatted price.

Last updated