Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: FormatDecimal Issues

  1. #1
    donttryathome is offline Senior Member
    Join Date
    Apr 2009
    Posts
    171

    Default FormatDecimal Issues

    Hi, I'm using the FormatDecimal fuction to display the actual quantity discount price for items. I've got it all setup in table format but the FormatDecimal function doesn't seem to be formatting all the prices correctly, some look fine, others don't.

    Name:  Untitled-2.gif
Views: 48
Size:  4.0 KB

    The following is the actual FormatDecimal code I am using:

    Code:
    $<xsl:value-of select="aspdnsf:FormatDecimal(.9*Price, 2)"/>
    $<xsl:value-of select="aspdnsf:FormatDecimal(.8*Price, 2)"/>
    $<xsl:value-of select="aspdnsf:FormatDecimal(.7*Price, 2)"/>
    Why are some prices displaying correctly and others aren't displaying proper decimal places?
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  2. #2
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    Try this instead :-


    C#/VB.NET Code:
    <xsl:value-of select="format-number((Price*0.9), '###0.00')" />
    <
    xsl:value-of select="format-number((Price*0.8), '###0.00')" />
    <
    xsl:value-of select="format-number((Price*0.7), '###0.00')" /> 

    TTFN

    BFG

  3. #3
    donttryathome is offline Senior Member
    Join Date
    Apr 2009
    Posts
    171

    Default

    You're the man, BFG! Works perfectly!
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  4. #4
    mortega5 is offline Junior Member
    Join Date
    Nov 2011
    Posts
    3

    Default how can i implement this into my product pages

    i would like to implement this exact thing into my product pages with quantity discounts. can anyone please provide some more information/steps.

    thanks!!

  5. #5
    donttryathome is offline Senior Member
    Join Date
    Apr 2009
    Posts
    171

    Default

    This change needs to be made inside your product xml package. Depending on how familiar you are with making changes to xml packages, it's as easy as inserting that code inside your xml package wherever you want it to appear. Without knowing how your xml package is setup, and where exactly you want it to be displayed, I can't really provide step by step instructions.

    Code:
    <xsl:value-of select="format-number((Price*0.9), '###0.00')" />
    This simply takes the price of the item and multiplies it by whatever percentage discount you may have setup in the quantity discount table. The two are not connected at all -- these discount prices are being populated and displayed manually, so you'll have to create a line of code for each discount level. Keep in mind that if you alter your quantity discount levels, you'll have to alter your xml package.

    If you've got multiple quantity discount tables you'll have to create a separate xml package for each discount table, and then assign the appropriate xml package to each product.
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2