Content Selection Framework - Promocode

This is Interesting: Free IT Magazines  
Home > Archive > Content Selection Framework > May 2004 > Promocode





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 Promocode
Rao

2004-05-17, 4:38 pm

Hi,

we are implementing Promocodes functionality to one of our sites.
First we added the Promocode field to targetingcontext. and we build
the expression using the promocode.

users will enter the promocode on shoppincart page. once we have
proocode value we are re running the basket pipeline with
targetingcontext. But still discounts are not appilied. Could someone
help us...

code below.


PipelineInfo info = new PipelineInfo("basket");
if (CommerceContext.Current.UserProfile !=null)
{
CommerceContext.Current.TargetingSystem.TargetingContextProfile["PromoCode"].Value=Promocode;

info.Profiles.Add("User", CommerceContext.Current.UserProfile);
info.Profiles.Add("targetingContext",CommerceContext.Current.TargetingSystem.TargetingContextProfile);

}
OrdBasket.RunPipeline(info);
OrdBasket.Save();




PLEASE HELP.

Thanks in advance !
---Rao
Andy Xu[MSFT]

2004-05-18, 5:04 pm

Rao,

Your approach looks right. Actually, I tried the similar code on my test site, it works fine.

So it let me wonder maybe you didn't set expression correctly? based on your site code, I assume that you used bizdesk to modify the TargetingContext schema (add one property
called PromoCode) and create a target expression, something like TargetingContext.PromoCode is equaled to "whatever value you want", and then create the discount to use that
expression as eligibility requirement, correct?

since we are talking about PromoCode topic, why not try our new released feature pack 1, it contains a completed out-of-box solution for 3 different types of promocodes.

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: vrao@nrahq.org (Rao)
Newsgroups: microsoft.public.commerceserver.campaigns_csf
Subject: Promocode
Date: 17 May 2004 12:53:17 -0700
Organization: http://groups.google.com
Lines: 33
Message-ID: <991a6106.0405171153.74803a3d@posting.google.com>
NNTP-Posting-Host: 216.2.18.67
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1084823597 23237 127.0.0.1 (17 May 2004 19:53:17 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 17 May 2004 19:53:17 +0000 (UTC)
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!
postnews1.google.com!not-for-mail
Xref: cpmsftngxa10.phx.gbl microsoft.public.commerceserver.campaigns_csf:2649
X-Tomcat-NG: microsoft.public.commerceserver.campaigns_csf

Hi,

we are implementing Promocodes functionality to one of our sites.
First we added the Promocode field to targetingcontext. and we build
the expression using the promocode.

users will enter the promocode on shoppincart page. once we have
proocode value we are re running the basket pipeline with
targetingcontext. But still discounts are not appilied. Could someone
help us...

code below.


PipelineInfo info = new PipelineInfo("basket");
if (CommerceContext.Current.UserProfile !=null)
{
CommerceContext.Current.TargetingSystem.TargetingContextProfile["PromoCode"].Value=Promocode;

info.Profiles.Add("User", CommerceContext.Current.UserProfile);
info.Profiles.Add("targetingContext",CommerceContext.Current.TargetingSystem.TargetingContextProfile);

}
OrdBasket.RunPipeline(info);
OrdBasket.Save();




PLEASE HELP.

Thanks in advance !
---Rao


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com