Forum

The forum is a free service supported by community members. Please consider opening a support ticket if you need timely help.

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 26 Dec 2010 05:49 PM by  Steve L
Discount XSL, how to?
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages


New Member


Posts:
New Member


--
25 Dec 2010 07:21 PM
    How do I apply a $10.00 discount on an item that expires on a certain date, example 1/14/2011.

    Note: there is only 1 variant on this item.
    0


    Veteran Member


    Posts:2957
    Veteran Member


    --
    26 Dec 2010 05:49 PM
    It's simple, to apply the $10.00 discount on the single product variant, use this transform for the promotion rule on your product variant. Use the IF statement to decide if the current date is before 2011-01-14 and subtract the selling price by $10.00.

    <xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xsl:template match="/">
    <out>
    <promotionPrice>
    <xsl:if test="current-date() < xs:date('2011-01-14')">
    <xsl:value-of select="in/product/productVariant/price - 10.00" />
    </xsl:if>
    </promotionPrice>
    </out>
    </xsl:template>
    </xsl:transform>


    0
    You are not authorized to post a reply.