|
Home > Archive > Content Selection Framework > July 2004 > Coupon discount
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]
|
|
|
| Hi Andy,
Thanks for your respond in conference.
I still have the same issue when after running the modified (I've
added 2 new components for PromoCodes) Basket.pcf I have no discount
for specified coupon. Discount is approved, I'm working on my local
box, IIS is resetted many times 
I tried to trace execution of Basket.pcf in SQL Profiler. I saw only
one call of stored procedure. I made the same call with the same
parameters in QueryAnalyzer and got one record with data for my coupon
discount. As I understand, this coupon discount is available and by
some reason it doesn't apply to my Basket object.
Any help from you will be GREAT!
Thanks a lot
Alex
| |
| Andy Xu[MSFT] 2004-07-09, 3:13 pm |
| Alex,
A simple yet very helpful way to debug/trace basket discount related issues is to take advantage of orderform._discounts_trace_info generated by OrderDiscount component, in order to let it generate the trace
info, you have to set Context._trace_discounts before calling OrderDiscount, refer to commerce server documentation for details (search "_trace_discounts")
I include a sample here. You can create a scriptor component BEFORE OrderDiscount and use the following script:
/////////////////////////// beginning of the code snippet /////////////////////////////////////////
'The following entry points are available (shown in VBScript format):
function MSCSExecute(config, orderform, context, flags)
context.Value("_trace_discounts") = 1
MSCSExecute = 1
end function
sub MSCSOpen(config)
end sub
sub MSCSClose()
end sub
//////////////////////////////// end of the code snippet ////////////////////////////////////////////////
Then create a scriptor component AFTER OrderDiscount and use the following script:
///////////////////////////////// beginning of the code snippet ////////////////////////////////////////
' this script assumes you set the filename parameter to a
' valid filename for output. The directory the output file is written to must be set up to
' have write access via the user your IIS is running as.
'
' For example, you could set
' filename=c:\discounttrace.log
' in the Parameters control.
'
' This would assume your IIS user can write to c:\
'
function MSCSExecute(config, orderform, context, flags)
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(config.filename, True)
a.WriteLine("********** Discount Trace Info ****************")
a.WriteLine(cstr(orderform.Value("_discounts_trace_info")))
a.Close
MSCSExecute = 1
end function
sub MSCSOpen(config)
end sub
sub MSCSClose()
end sub
///////////////////////////////// end of the code snippet //////////////////////////////////////////////////
You need to specify a log file name in the second scriptor component's property page. And make sure your IIS process identity has permission to write that log file.
Save the pipeline, IISRESET and run your basket and check what the trace information says.
BTW, I am still a little confused about your data: you said that " you have NO discount for specified coupon"? If that's the case, even shopper inputs the correct coupon, he/she still can not get any discount (since
there is none) by design, correct?
HTH,
Andy Xu [MSFT]
Commerce Server Team
--
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
--------------------
From: alexr@eidenai.ca (Alex)
Newsgroups: microsoft.public.commerceserver.campaigns_csf
Subject: Coupon discount
Date: 5 Jul 2004 10:07:04 -0700
Organization: http://groups.google.com
Lines: 18
Message-ID: <561c5247.0407050907.31ebeca3@posting.google.com>
NNTP-Posting-Host: 66.46.139.106
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1089047224 454 127.0.0.1 (5 Jul 2004 17:07:04 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 5 Jul 2004 17:07:04 +0000 (UTC)
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.net!postnews2.google.com!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.commerceserver.campaigns_csf:2770
X-Tomcat-NG: microsoft.public.commerceserver.campaigns_csf
Hi Andy,
Thanks for your respond in conference.
I still have the same issue when after running the modified (I've
added 2 new components for PromoCodes) Basket.pcf I have no discount
for specified coupon. Discount is approved, I'm working on my local
box, IIS is resetted many times 
I tried to trace execution of Basket.pcf in SQL Profiler. I saw only
one call of stored procedure. I made the same call with the same
parameters in QueryAnalyzer and got one record with data for my coupon
discount. As I understand, this coupon discount is available and by
some reason it doesn't apply to my Basket object.
Any help from you will be GREAT!
Thanks a lot
Alex
| |
|
| Got it fixed!!!
The problem was with Targeting Expressions.
My fault! 
|
|
|
|
|