0121 31 45 374
Qoute Icon

Output the currency symbol in uCommerce

Tim

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>

Liked this post? Got a suggestion? Leave a comment