Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Commerce Server Campaigns csf > Discount is not...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 225 of 313
Post > Topic >>

Discount is not showing in commerce server application

by "=?Utf-8?B?YW5pcmJhbiBnaG9zaA==?=" <anirban ghosh@[EMAIL PROTECTED] Aug 29, 2005 at 04:58 AM

I implemented a commerce server application with discount and ad. campaign
of 
type 'image' using the commerce server 2002 help file lab 1- 4 sessions.

The discount campaign is implemented for target group female contractor
for 
product electrrical switch with SKU 6001.

In the default.aspx page   in page load ,I wrote code for displaying ad.
and 
discount
in the texts of the labels using following code:

In the Page_Load() method, add the following code: 


// Create a targeting profile
CommerceContext ctx = CommerceContext.Current;
Profile userProfile = null;
bool isLoggedOn = ctx.AuthenticationInfo.IsAuthenticated();

if (isLoggedOn)
{
   // Extract the user's profile for the Campaign system to
   // decide if the user should be targeted for a given ad.
   ProfileContext profContext = ctx.ProfileSystem;
   
   string userId = ctx.AuthenticationInfo.AuthTicket.UserID;
   userProfile = profContext.GetProfile(userId, "UserObject");
}
//check for the profile


// Get the AD
   
// Get a ContentSelector and set its properties
ContentSelector csoAd = 
ctx.TargetingSystem.SelectionContexts["advertising"].GetSelector();
csoAd.TraceMode = true;
csoAd.ItemsRequested = 1;


if(null != userProfile) 
{
   csoAd.Profiles.Add("User", userProfile);
}

csoAd.Size = "Banner";

// Get some content using CS2002 Content Selection Framework
StringCollection adpayload = csoAd.GetContent();
foreach (string adItem in adpayload)
{
   adLabel.Text = adLabel.Text + adItem.ToString() + "";
}

// Get the Discount

// Create a targeting profile

// ctx is still active
   
// Get a ContentSelector and set its properties
ContentSelector csoDiscount = 
ctx.TargetingSystem.SelectionContexts["discounts"].GetSelector();
csoDiscount.TraceMode = true;
csoDiscount.ItemsRequested = 1;

if(null != userProfile) 
{
   csoDiscount.Profiles.Add("User", userProfile);
}


// Get the content using CS2002 Content Selection Framework
StringCollection discountPayload = csoDiscount.GetContent();
foreach (string discountItem in discountPayload)
{
   discountLabel.Text = discountLabel.Text + discountItem.ToString() + "";
}


I registered a user of type female contractor and logged in.But still 
discount image does not show.

But though the ad. image is showing but discount image is not showing.


In the debug mode I saw that the variable 'adpayload' has count of 1 so
the 
corresponding  for loop is running once and showing the ad. image.

But the variable 'discountPayload' is showing count 0 ,so the following
for 
loop is not running and no image for discount is showing.

I am using commerce server 2002 with SP#3 feature pack 1 default 
recomendation.
Please suggest  if the code is correct??If not give some sample code...

How does the discount show on the website???
Please give the details step by step  procedure.
 




 2 Posts in Topic:
Discount is not showing in commerce server application
"=?Utf-8?B?YW5pcmJhb  2005-08-29 04:58:02 
RE: Discount is not showing in commerce server application
dlott@[EMAIL PROTECTED]   2005-08-29 16:20:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Nov 23 7:22:42 CST 2008.