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 14 Feb 2023 11:46 PM by  Steve L
Mutli filter shipping so close please help
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages


New Member


Posts:49
New Member


--
12 Feb 2023 01:48 AM

    Hi
    I have this multi filter shipping method we need we need to use

    The line that is not working is sum(/in/salesOrder/shippingPackages/shippingPackage/weight) < 1000

    I think it may be due to this being a sum calculation. Just not sure how to add the criteria.

    Thank you. Any advice is appreciated

    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
      <xsl:template match="/">
        <out>
          <allowed>
            <xsl:choose>
              <!--                                                                                                Test if Australia
                                                                                                   -->
              <xsl:when test="sum(/in/salesOrder/shippingPackages/shippingPackage/weight) &lt; 1000 and  in/user/roles[role = 'Trade'] and in/salesOrder/subTotalAmount &gt; 27.27 and in/salesOrder/shippingCountryCode = 'AU' and in/salesOrder/shippingSubdivisionCode = 'AU-SA' and (in/salesOrder/shippingPostalCode = '5000' or in/salesOrder/shippingPostalCode = '5006')">true</xsl:when>
              <xsl:otherwise>false</xsl:otherwise>
            </xsl:choose>
          </allowed>
        </out>
      </xsl:template>
    </xsl:transform>

     

    0


    Veteran Member


    Posts:2955
    Veteran Member


    --
    13 Feb 2023 09:34 PM

    Hi Michael

    It looks fine. The sum of the weights are in grams so make sure you put in the correct value to check. Are you getting an error or the shipping is not showing up for you?

    Have you tried to debug the XSL by generating the actual XML input into your Admin Logs. You can then copy the XML to your rule's Input screen and run the test to see what output you get.

    0


    New Member


    Posts:49
    New Member


    --
    13 Feb 2023 11:21 PM

    Thank you Steve

    We are not getting any onscreen error. Its just not actioning that part of the query.

    0


    Veteran Member


    Posts:2955
    Veteran Member


    --
    14 Feb 2023 11:46 PM

    You need to debug it, copy the XML and run it in your test screen to see what output you get. See my previous reply.

    0
    You are not authorized to post a reply.