03-31-05 10:58 PM
The discount engine doesn't have a feature to qualify a discount on the
subtotal after discounts applied so far. So it's using the cumulative list
price of the items, not the subtotal after discount.
The workaround is hairy - you have to run the discount pipeline component
twice. First you need to apply all the line-item level discounts and get
the subtotal. Then you put the subtotal into the TargetingContext profile.
You need to remove all the temp keys written by the OrderDiscount
component the first time, then run it through the pipeline again with
order-level discounts enabled as well as line-item level.
So your discount eligibility requirement expression could be something like
"TargetingContext.OrderSubtotal > 100.00". When you run the pipeline the
first time, you don't set the OrderSubtotal property at all - this will
cause the expression to evaluate to 'undefined_result', so the order-level
discounts won't apply. The second time through, the targeting context
OrderSubtotal property is set to the subtotal after discount so they will
be eligible to apply.
Hope this helps.
-djm
--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2005 Microsoft Corporation. All rights
reserved.
--------------------
From: markmccrimmon@hotmail.com
Newsgroups: microsoft.public.commerceserver.campaigns_csf
Subject: GWP _qualifying_discounts written when discounted qualification
hasn't been met
Date: 23 Mar 2005 07:30:18 -0800
Organization: http://groups.google.com
Lines: 50
Message-ID: <1111591818.135078.27850@f14g2000cwb.googlegroups.com>
NNTP-Posting-Host: 208.18.166.65
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1111591823 16397 127.0.0.1 (23 Mar 2005
15:30:23 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 23 Mar 2005 15:30:23 +0000 (UTC)
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: f14g2000cwb.googlegroups.com; posting-host=208.18.166.65;
posting-account=5uxQ2QwAAABmVisMEF-U-Z6h4-hF30A0
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!news.glorb.com!postnews.google.com!f14g2000cwb.g
ooglegroups.com!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.commerceserver.campaigns_csf:3104
X-Tomcat-NG: microsoft.public.commerceserver.campaigns_csf
The qualification for the free gift is with a Value > $100.
If the basket contains combined item totals of > $100, the basket
correctly fills in the _qualifying_discounts with the discount id for
the free gift.
The issue is that after applying higher priority discounts to the
basket, the subtotal is now less than the free gift qualification, yet
the _qualifying_discounts entry for the free item still exists.
I have set the trace_discounts key to true and reviewed the ouput of
the discount engine using XmlTracer.
What am I missing?
Here is a portion of the XmlTracer output:
<DICTITEM key="_qualifying_discounts"><VALUE dt:dt="object"
dt:classid="classid:B7990D0E-45FD-11D0-8176-00A0C90A90C7">
<SIMPLELIST xmlns:dt="uuid:304FB305-29A4-11d3-B0D4-00C04F8ED7A2"
version="1.0">
<LISTITEM><VALUE dt:dt="i4">53</VALUE></LISTITEM>
</SIMPLELIST>
<DICTITEM key="saved_cy_oadjust_subtotal"><VALUE
dt:dt="currency">89.97</VALUE></DICTITEM>
Sorted discounts:
0. Id = 64
BUY 3.00(q), CondExprId=19; GET 0 at 1.50($), AwardExprId=19 ; OL=0,
Djoint=0, CC=-1, CA=-1, AC=-1, AA=-1
1. Id = 90
BUY 3.00(q), CondExprId=27; GET 0 at 1.00($), AwardExprId=27 ; OL=0,
Djoint=0, CC=-1, CA=-1, AC=-1, AA=-1
..
13. Id = 53
BUY 100.00($), CondExprId=0; GET 1 at 100.00(%), AwardExprId=22 ;
OL=0, Djoint=-1, CC=-1, CA=0, AC=0, AA=0
Running engine for discount Id = 53
Discount_Id=53: Basket lines sorted for conditions
0: Basket line index 0
1: Basket line index 1
2: Basket line index 2
Discount_Id=53: Basket lines sorted for awards
0: Basket line index 0
1: Basket line index 1
2: Basket line index 2
Discount Id = 53 is not a winner.
[ Post a follow-up to this message ]
|