|
Home > Archive > Content Selection Framework > June 2005 > Discounts do not apply with Targeting Expressions FP1
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Discounts do not apply with Targeting Expressions FP1
|
|
| TechMate 2005-06-06, 8:48 pm |
| I am trying to apply a discount based on the foloowing conditions. I have a
shared expression (ShareExp) which looks for all products priced $15. My
discount is a Simple Discount set as follows:
Condition (Buy)
Shared Expression: ShareExp
Quantity: 0
Award (Receive)
Shared Expression: ShareExp
Amount Off: $14
Limit
Basket limit: 0
Award Limit: 0
This discount is applied if I do not specify a Targeting Expression in the
Eligibility Requirement. However when I have the Eligibility set to another
Shared Targeting Expression (TargetExp) which has a condition
UserObject.General Information.UserType = Registered User
When this eligibility is set the discounts do not appear on the basket. What
could be the reason. I tried logging into the ASP.NET solution site as
registered user type but still the discounts do not appear.
Can someone help me identify the problem.
| |
| TechMate 2005-06-09, 5:52 pm |
| I resolved the issue. The problem was targeting evaluation was never
evaluated. To fix this I changed the PromoCodeSample sample code in Commerce
Server 2002 FP1 documentation to add the UserProfile along with
TargetingContextProfile before running the Basket in the PromoCodeSample
class. For detailed info please look up documentation Developer's Guide ->
Developer Concepts and Tasks -> Marketing System -> Implementing Promotion
Codes.
I got this fixed by converting thsi C# to VB, added this class in the
TxContext and changing the following lines
1. Public Shared Sub ProcessBasketWithPromoCodes(ByVal userId As Guid,
ByVal userEmail As String
to
Public Shared Sub ProcessBasketWithPromoCodes(ByVal userId As Guid,
ByVal userEmail As String, ByVal codes As String())
2. "Basket basket =
CommerceContext.Current.OrderSystem.GetBasket(userId);" - C#
to
"Dim basket As basket =
Microsoft.CommerceServer.Site.Transactions.TransactionContext.Current.Cart" -
VB
3. of("promo_codes") = GetPromoCodesList("One")
to
of("promo_codes") = GetPromoCodesList(codes)
Since there is not much documentation or code samples, I believe this will
help to continue with troubleshooting FP1 Promotion Codes and Targeting
Evaluators issue
"TechMate" wrote:
> I am trying to apply a discount based on the foloowing conditions. I have a
> shared expression (ShareExp) which looks for all products priced $15. My
> discount is a Simple Discount set as follows:
> Condition (Buy)
> Shared Expression: ShareExp
> Quantity: 0
>
> Award (Receive)
> Shared Expression: ShareExp
> Amount Off: $14
>
> Limit
> Basket limit: 0
> Award Limit: 0
>
> This discount is applied if I do not specify a Targeting Expression in the
> Eligibility Requirement. However when I have the Eligibility set to another
> Shared Targeting Expression (TargetExp) which has a condition
> UserObject.General Information.UserType = Registered User
> When this eligibility is set the discounts do not appear on the basket. What
> could be the reason. I tried logging into the ASP.NET solution site as
> registered user type but still the discounts do not appear.
>
> Can someone help me identify the problem.
| |
| David Messner [MSFT] 2005-06-09, 5:52 pm |
| Hello,
Here are the things you can do to diagnose:
1. First - inspect the profile properties on the UserObject instance and
ensure that they are as expected
2. Be sure the UserObject profile instance is being passed into the
pipeline correctly. If this is .NET site code, then see
PipelineInfo.Profiles.Add.
3. Use the trace functionality of order discount in conjunction with
pipeline logging. See the ORderDiscount pipeline component reference
documentation for the values read/written related to this (I believe it is
context._trace_discounts flag that you need to set). The output that gets
generated in the pipeline log will tell you the result of the expression
evaluation. If it is "undefined result" instead of "false", this tells you
that the profile or the profile property being referenced in the property
was not available at runtime (see #2).
Hope that 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: "=?Utf-8?B?VGVjaE1hdGU=?=" <TechMate@discussions.microsoft.com>
Subject: Discounts do not apply with Targeting Expressions FP1
Date: Mon, 6 Jun 2005 17:25:31 -0700
I am trying to apply a discount based on the foloowing conditions. I have a
shared expression (ShareExp) which looks for all products priced $15. My
discount is a Simple Discount set as follows:
Condition (Buy)
Shared Expression: ShareExp
Quantity: 0
Award (Receive)
Shared Expression: ShareExp
Amount Off: $14
Limit
Basket limit: 0
Award Limit: 0
This discount is applied if I do not specify a Targeting Expression in the
Eligibility Requirement. However when I have the Eligibility set to another
Shared Targeting Expression (TargetExp) which has a condition
UserObject.General Information.UserType = Registered User
When this eligibility is set the discounts do not appear on the basket.
What
could be the reason. I tried logging into the ASP.NET solution site as
registered user type but still the discounts do not appear.
Can someone help me identify the problem.
| |
| TechMate 2005-06-09, 5:52 pm |
| Continued...
Forgot to mention the most important change in the sample codes.
Add the following lines in the RunBasketPipeline() of the PromoCodeSample
class
pipeInfo.Profiles.Add("User",
CommerceContext.Current.UserProfile);
pipeInfo.Profiles.Add("TargetingContext",
CommerceContext.Current.TargetingSystem.TargetingContextProfile);
Thanks
"TechMate" wrote:
> I am trying to apply a discount based on the foloowing conditions. I have a
> shared expression (ShareExp) which looks for all products priced $15. My
> discount is a Simple Discount set as follows:
> Condition (Buy)
> Shared Expression: ShareExp
> Quantity: 0
>
> Award (Receive)
> Shared Expression: ShareExp
> Amount Off: $14
>
> Limit
> Basket limit: 0
> Award Limit: 0
>
> This discount is applied if I do not specify a Targeting Expression in the
> Eligibility Requirement. However when I have the Eligibility set to another
> Shared Targeting Expression (TargetExp) which has a condition
> UserObject.General Information.UserType = Registered User
> When this eligibility is set the discounts do not appear on the basket. What
> could be the reason. I tried logging into the ASP.NET solution site as
> registered user type but still the discounts do not appear.
>
> Can someone help me identify the problem.
|
|
|
|
|