TOTECS Forums

Recommendations for setting currency code and symbol in any content managed web page area formats
Author
Thread
Recommendations for setting currency code and symbol in any content managed web page area formats
Author Rowan Drew
November 17 2015 @ 01:37 PM
Thread On a content managed website, we often see administrators and web implementors hard coding the currency symbol and currency code into the format areas.
A bad example of this in a Product Detail area format would look like:
AUD $ $_P_PriceEx$

This would evaluate out to AUD $ 10.00

The reason why this is bad is because if in the future a TOTECS project wanted to support displaying pricing in different currencies enabled through the multi-currency feature, it would cause a world of pain for somebody to go through all the formats displaying the currency label and fix them up.

The recommended, and best approach from the beginning is to use the currency session hooks to do the same job. These session hooks can be used to display the currency code, currency symbol, currency label, and currency exchange rate. The data in the hooks will change based on the currency assigned to the user. These session hooks are available to any area format, but for areas displaying historic data such as orders, it is recommended to use the currency hooks made available to the data.
So a good example using the session hooks:
$SES_locale_currency_code$ $SES_locale_currency_symbol$ $_P_PriceEx$

This would also evaluate out to AUD $ 10.00

There are a number of other session hooks available, which are listed in this post http://totecs.gosquizz.com/ecommerce-solutions-forum-post/419-news.html


TOTECS Software Development Manager

Post a Comment
Message:
By clicking on the Post button you accept the rules and guidelines of using this forum.