We'd like to offer a free water filter if a customer places an order of $150+. We don't care what the customer buys to get to $150, but for inventory tracking, we want to make sure the water filter is added to the cart before the coupon can work.
I can either create a promo coupon where product requirement is set to allow all (see below) but then the coupon doesn't force the filter to be in the cart:
or if I try to switch that and say allow only and add the filter (see below) then the coupon this way means that if any other product other than the filter is added to the cart the coupon does not work!
I have also tried it with a promotion which makes sure the filter is in the cart, but the way below makes EVERY filter free, we just want to allow 1 filter free.
I am guessing there may be a way to custom code it in the promo (which we've used before to force minimum and maximum amounts) but I am not sure how to take our custom code that enforces minimum amounts and also make sure a filter is in the order. Here is a sample of our custom promo code enforces on sales order detail:
<xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<out>
<discountAmount>
<!-- Coupon code is always tested in lowercase -->
<xsl:if test="in/salesOrder/couponCodes[couponCode = 'thanks7'] and (in/this/salesOrderDetail/productVariantExtension/data/qualified or in/this/salesOrderDetail/productVariantExtension/data/qualified1 or in/this/salesOrderDetail/productVariantExtension/data/qualified2) and sum(/in/salesOrder/salesOrderDetails/salesOrderDetail/(price * quantity)) &gt;= 99 and sum(/in/salesOrder/salesOrderDetails/salesOrderDetail/discountAmount) = 0">
<xsl:value-of select="-7.0000"/>
</xsl:if>
</discountAmount>
</out>
</xsl:template>
</xsl:transform>
If anyone can help me put these pieces together I'd greatly appreciate it!
Thanks in advance!