Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Thanked 0 Times in 0 Posts

    Placing two XSL values on same line

    I am trying to add the Xsl value of sale price and the xsl if value of You Save $x.xx - (x%) on the same line. So it looks something like this:

    Regular Price: $x.xx
    Sale Price: $x.xx - You Save $x.xx (x%)

    So far I can get it on two separate lines - but not one. Any ideas?

    <h4><xsl:attribute name="id">VariantPrice_<xsl:value-of select="VariantID"/></xsl:attribute></h4>
    <h3><xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes"/></h3>
    <h5><xsl:if test="SalePrice > 0">You Save $<xsl:value-of select="format-number((Price - SalePrice),'##.00')" />  (<xsl:value-of select="100-(round((format-number (SalePrice div Price,'##.00'))*100))" />%)

  2. #2
    Master Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Behind the Wall
    Thanked 569 Times in 562 Posts
    then don’t use a block element for each part.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  3. #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Splendora, Texas, United States of America
    Thanked 317 Times in 311 Posts
    Quote Originally Posted by wing43215 View Post
    So far I can get it on two separate lines - but not one. Any ideas?
    Block-level elements, such as the h# elements, create automatic line breaks.

    It's worth noting that you've improperly nested h# elements within a span element; that isn't allowed in HTML and may result in odd layout behaviors because you're nesting block-level (h#) elements within an inline (span) element.
    For every complex problem, there is an answer that is clear, simple, and wrong.

    CSS Specifications


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts