Bold & Resize Individual Items On Invoice
-
Yes,
What your looking for is an CHOOSE WHEN.
<!-- Choose when for specific Item Code. -->
<!-- This will increase the font size to 22px -->
<!-- and set the font-weight to bold if the item code equals -->
<!-- the specified code otherwise everything will be set to default -- >
<xsl:choose> <xsl:when test="Code = '261390147132'"> <td style="{$orderDetailContentStyle}; font-size:22px; font-weight:bold;">
<xsl:value-of select="Code" />
</td> </xsl:when> <xsl:otherwise> <td style="{$orderDetailContentStyle};" >
<xsl:value-of select="Code" />
</td> </xsl:otherwise>
</xsl:choose>
<!-- Same thing goes for Quantity. -- >
<xsl:choose> <xsl:when test="Code = '261390147132'"> <td style="{$orderDetailContentStyle}; font-size:22px; font-weight:bold;" align="right">
<xsl:value-of select="Quantity" />
</td> </xsl:when> <xsl:otherwise> <td style="{$orderDetailContentStyle};" align="right">
<xsl:value-of select="Quantity" />
</td> </xsl:otherwise>
</xsl:choose> -
Invoice template is using HTML format so you can uses css to change style attributes.
I added a second definition or version of the "orderDetailContentStyle"
<xsl:variable name="orderDetailContentStyle2">
padding: 4px 8px 4px 8px;
font-weight: bold;
font-size: larger;
<xsl:if test="position() != 1">border-top: 1px solid lightgrey;</xsl:if>
</xsl:variable>Then applied it the field I wanted bold and larger text.
<td style="{$orderDetailContentStyle2};">
<!-- Shared Snippet -->
<xsl:call-template name="OrderItemCode">
<xsl:with-param name="item" select="." />
</xsl:call-template>
</td>
Please sign in to leave a comment.
Comments
6 comments