Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Martin 44 posts 66 karma points
    Nov 08, 2011 @ 13:12
    Martin
    0

    Product discount

    I have configured a discount for a specific product like this:

    http://i.imgur.com/L0BwE.png

    My campaign is not expired.

    Here is the XSLT I use:

    <xsl:variable name="campaignItems" select="CommerceLibrary:GetTargetedCampaignItems()"/>

                <xsl:variable name="currentSku" select="$product/@sku"/>
                <xsl:choose>
                  <xsl:when test="$campaignItems/campaignItems/campaignItem/product[@sku = $currentSku and @variantSku = '']">
                    <xsl:variable name="amountOff" select="$campaignItems/campaignItems/campaignItem/product[@sku = $currentSku and @variantSku = '']/@amountOff"/>
                    <xsl:value-of select="./@currency"/>&nbsp;<xsl:value-of select="CommerceLibrary:FormatCurrency(./@price - $amountOff)"/>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="./@currency"/>&nbsp;<xsl:value-of select="CommerceLibrary:FormatCurrency(./@price)"/>
                  </xsl:otherwise>
                </xsl:choose>

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 10, 2011 @ 12:14
    Søren Spelling Lund
    0

    Hi Martin,

    When the campaign item is configured in the way you describe uCommerce will produce XML for the product family only. Individual variant SKUs will be included only when there you target them specifically.

    This is what the XML looks like when targeting specific variant SKUs:

    <campaignItems>
        <campaignItem>
            <applyTargets>
                <product index="0" sku="100-000-001" variantSku="001" displayName="Developer Edition" />
            </applyTargets>
            <awards>
                <amountOffUnit index="0" name="" amountOff="100.00" />
            </awards>
            <properties></properties>
        </campaignItem>
        <campaignItem>
            <product index="0" sku="100-000-001" variantSku="001" amountOff="100.00" />
        </campaignItem>
    </campaignItems>

    and for product families:

    <campaignItems>
        <campaignItem>
            <applyTargets>
                <product index="0" sku="100-000-001" variantSku="" displayName="uCommerce" />
            </applyTargets>
            <awards>
                <amountOffUnit index="0" name="" amountOff="100.00" />
            </awards>
            <properties></properties>
        </campaignItem>
        <campaignItem>
            <product index="0" sku="100-000-001" variantSku="" amountOff="100.00" />
        </campaignItem>
    </campaignItems>
Please Sign in or register to post replies

Write your reply to:

Draft