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 Apr 2024 02:38 PM by  Steve L
Promotion Rule for specific users and product
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages


New Member


Posts:48
New Member


--
17 Apr 2024 11:25 AM

    I want to define a promotion rule(s) for specific users and specific product. Promotion rule is valid for specific period - it depends on the user.

    For example
    User A has a 50% discount for product X between 1 Mar 2024 - 8 Mar 2024
    User B has a 50% discount for product X between 1 Apr 2024 - 8 Apr 2024
    etc.
    I was thinking about defining custom Marketing->Promotion rules for each user.

    I'll set promotion start-end dates and set custom rule like that for Promotion Type: product:
    <xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
          <xsl:template match="/">
            <out>
              <promotionPrice>
                <xsl:if test="in/product/productVariant/productVariantID = 26 and /in/user/username = 'username_of_user_A'">
                    <xsl:value-of select="0.50 * in/product/productVariant/price" />
                </xsl:if>
              </promotionPrice>
            </out>
          </xsl:template>
        </xsl:transform>

    But it doesn't work. Price for logged in user is displayed without discount on Product List/Cart/Checkout. 
    Any ideas why?

    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    26 Apr 2024 02:38 PM

    It looks fine. Have you tried to enable Debug mode and see the actual XML input being passed to the rule? You can copy the XML input and paste into your code window (Input tab) and Run test to see what Output you get.

     

    0
    You are not authorized to post a reply.