Output the currency symbol in uCommerce

currency-trading[1]

One thing that's always bugged me about uCommerce is the way the prices are displayed (using the not so inviting ISO codes), this is a simple switch statement to output the (prettier) HTML symbol instead.

<xsl:choose> <xsl:when test="@currency = 'GBP'"> <xsl:text disable-output-escaping="yes">&amp;pound;</xsl:text> </xsl:when> <xsl:when test="@currency = 'EUR'"> <xsl:text disable-output-escaping="yes">&amp;euro;</xsl:text> </xsl:when> <xsl:when test="@currency = 'YEN'"> <xsl:text disable-output-escaping="yes">&amp;yen;</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text disable-output-escaping="yes">$</xsl:text> </xsl:otherwise> </xsl:choose>

Subscribe to TSD

Don’t miss out on the latest posts. Sign up now to get access to the library of members-only posts.
jamie@example.com
Subscribe