how to get a list of discounts applicable for a product/SKU
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Commerce Server > Content Selection Framework > how to get a list of discounts applicable for a product/SKU




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    how to get a list of discounts applicable for a product/SKU  
Ravi Shankar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-01-04 12:34 PM


As part of the site we're building the customer has a
requirement that states that they would like to see all
discounts applicable for a product/SKU to be visible on
the product listing page.

I have gone through the documentation (probably not with
sufficient thoroughness) but am at a loss on how for
every product I can query the CFS for all possible
discounts available on it...

Any pointers welcome

Regards.
Ravi.





[ Post a follow-up to this message ]



    RE: how to get a list of discounts applicable for a product/SKU  
Andy Xu[MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-06-04 02:36 AM

Ravi,

Unfornately, there is no direct out-of-box solution for the scenario you des
cribe, which is more like predict discounts based on product. The content se
lection feature provided by
Commerce Server 2002 is to show ad/discount targetted by user profile or tar
get context. What you want is targetted by product/SKU.

A workaround I can think of is to add a property to targeting context, for e
xample, called "TargetedProduct".  for each discount, you create a target ex
pression, which is
TargetingContext.TargetedProduct = <SKU value>". And in the runtime code, fo
r each request to the product page, your site code is in charge of adding co
rresponding SKU(s) to the
targeting context's TargetedProduct property. (CommerceContext.Current.Targe
tingSystem.TargetingContextProfile ) And running ContentSelector should get 
the targetted discounts.

The problem is, of course, if you have multiple products in one page, you wi
ll probably get more than one returned applicable discounts. You probably ha
ve to use the site code to
mapping the returned discount to show with the correct product.

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 mess
age are best directed to the newsgroup/thread from which they originated.
--------------------
Content-Class: urn:content-classes:message
From: "Ravi Shankar" <shankar.nospam@hp.com>
Sender: "Ravi Shankar" <shankar.nospam@hp.com>
Subject: how to get a list of discounts applicable for a product/SKU
Date: Sat, 1 May 2004 03:55:23 -0700
Lines: 15
Message-ID: <6f6b01c42f6a$cdc64b20$a101280a@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcQvas3G/7jH3b5dTSmKM+rVrGQnwg==
Newsgroups: microsoft.public.commerceserver.campaigns_csf
Path: cpmsftngxa10.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.commerceserver.campaigns_csf:262
5
NNTP-Posting-Host: tk2msftngxa09.phx.gbl 10.40.1.161
X-Tomcat-NG: microsoft.public.commerceserver.campaigns_csf


As part of the site we're building the customer has a
requirement that states that they would like to see all
discounts applicable for a product/SKU to be visible on
the product listing page.

I have gone through the documentation (probably not with
sufficient thoroughness) but am at a loss on how for
every product I can query the CFS for all possible
discounts available on it...

Any pointers welcome

Regards.
Ravi.







[ Post a follow-up to this message ]



    RE: how to get a list of discounts applicable for a product/SKU  
Ravi Shankar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 03:50 PM

I have done the following

1. Extended the "Targeting Context" Profile by adding a
field "TargetProduct"

2. Based on this using BizDesk I created a "Target
Group" where the Expression is TargetProduct="SKU" and
the Action is "Target"

3. In an advertising campaign I created an Advertisement
where "Page Group" was "ALL" and the above TargetGroup
was the assigned target group.

4. I'm trying to retrieve the ad like so...

Dim oCommerceContext As CommerceContext
Dim oCS As ContentSelector

oCommerceContext = CommerceContext.Current
oCommerceContext.TargetingSystem.TargetingContextProfile
("PageGroup").Value = "All"
oCommerceContext.TargetingSystem.TargetingContextProfile
("TargetProduct").Value = ProductID

oCS = oCommerceContext.TargetingSystem.SelectionContexts
("Advertising").GetSelector()
If Not oCS Is Nothing Then
oCS.Profiles.Add("targetingContext",
oCommerceContext.TargetingSystem.TargetingContextProfile)

If oCommerceContext.AuthenticationInfo.IsAuthenticated
() Then
oCS.Profiles.Add("user",
oCommerceContext.UserProfile)
End If

oCS.ItemsRequested = 3
oCS.Size = "Button1"
m_arDiscounts = oCS.GetContent()

If m_arDiscounts.Count > 0 Then
productDiscountsDisplay.DataSource = m_arDiscounts
productDiscountsDisplay.DataBind()
End If
End If

Now what is happening is that the ad is being shown for
every product, While I wanted only where the target group
condition is true.

Is there something I missed ? How can cause the selection
framework to return this only when the target group is
exactly matched.

HELP !

>-----Original Message-----
>Ravi,
>
>Unfornately, there is no direct out-of-box solution for
the scenario you describe, which is more like predict
discounts based on product. The content selection feature
provided by
>Commerce Server 2002 is to show ad/discount targetted by
user profile or target context. What you want is
targetted by product/SKU.
>
>A workaround I can think of is to add a property to
targeting context, for example,
called "TargetedProduct".  for each discount, you create
a target expression, which is
>TargetingContext.TargetedProduct = <SKU value>". And in
the runtime code, for each request to the product page,
your site code is in charge of adding corresponding SKU
(s) to the
>targeting context's TargetedProduct property.
(CommerceContext.Current.TargetingSystem.TargetingContextP
rofile ) And running ContentSelector should get the
targetted discounts.
>
>The problem is, of course, if you have multiple products
in one page, you will probably get more than one returned
applicable discounts. You probably have to use the site
code to
>mapping the returned discount to show with the correct
product.
>
>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.
>--------------------
>Content-Class: urn:content-classes:message
>From: "Ravi Shankar" <shankar.nospam@hp.com>
>Sender: "Ravi Shankar" <shankar.nospam@hp.com>
>Subject: how to get a list of discounts applicable for a
product/SKU
>Date: Sat, 1 May 2004 03:55:23 -0700
>Lines: 15
>Message-ID: <6f6b01c42f6a$cdc64b20$a101280a@phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
>	charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Thread-Index: AcQvas3G/7jH3b5dTSmKM+rVrGQnwg==
>Newsgroups: microsoft.public.commerceserver.campaigns_csf
>Path: cpmsftngxa10.phx.gbl
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.commerceserver.campaigns_csf:2625
>NNTP-Posting-Host: tk2msftngxa09.phx.gbl 10.40.1.161
>X-Tomcat-NG:
microsoft.public.commerceserver.campaigns_csf
>
>
>As part of the site we're building the customer has a
>requirement that states that they would like to see all
>discounts applicable for a product/SKU to be visible on
>the product listing page.
>
>I have gone through the documentation (probably not with
>sufficient thoroughness) but am at a loss on how for
>every product I can query the CFS for all possible
>discounts available on it...
>
>Any pointers welcome
>
>Regards.
>Ravi.
>
>





[ Post a follow-up to this message ]



    RE: how to get a list of discounts applicable for a product/SKU  
Ravi Shankar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 03:50 PM

Solved it.. the issue was with the target group
definition, setting the action to "Require" as opposed
to "Target" resolved the display portion.


>-----Original Message-----
>I have done the following
>
> 1. Extended the "Targeting Context" Profile by adding a
>field "TargetProduct"
>
> 2. Based on this using BizDesk I created a "Target
>Group" where the Expression is TargetProduct="SKU" and
>the Action is "Target"
>
> 3. In an advertising campaign I created an
Advertisement
>where "Page Group" was "ALL" and the above TargetGroup
>was the assigned target group.
>
> 4. I'm trying to retrieve the ad like so...
>
>  Dim oCommerceContext As CommerceContext
>  Dim oCS As ContentSelector
>
>  oCommerceContext = CommerceContext.Current
>
oCommerceContext.TargetingSystem.TargetingContextProfile
>("PageGroup").Value = "All"
>
oCommerceContext.TargetingSystem.TargetingContextProfile
>("TargetProduct").Value = ProductID
>
>  oCS =
oCommerceContext.TargetingSystem.SelectionContexts
>("Advertising").GetSelector()
>  If Not oCS Is Nothing Then
>    oCS.Profiles.Add("targetingContext",
>oCommerceContext.TargetingSystem.TargetingContextProfile)
>
>    If
oCommerceContext.AuthenticationInfo.IsAuthenticated
>() Then
>      oCS.Profiles.Add("user",
>oCommerceContext.UserProfile)
>    End If
>
>    oCS.ItemsRequested = 3
>    oCS.Size = "Button1"
>    m_arDiscounts = oCS.GetContent()
>
>    If m_arDiscounts.Count > 0 Then
>        productDiscountsDisplay.DataSource =
m_arDiscounts
>        productDiscountsDisplay.DataBind()
>    End If
>  End If
>
>Now what is happening is that the ad is being shown for
>every product, While I wanted only where the target
group
>condition is true.
>
>Is there something I missed ? How can cause the
selection
>framework to return this only when the target group is
>exactly matched.
>
>HELP !
> 
>the scenario you describe, which is more like predict
>discounts based on product. The content selection
feature
>provided by 
by[vbcol=seagreen]
>user profile or target context. What you want is
>targetted by product/SKU. 
>targeting context, for example,
>called "TargetedProduct".  for each discount, you create
>a target expression, which is 
>the runtime code, for each request to the product page,
>your site code is in charge of adding corresponding SKU
>(s) to the 
>
(CommerceContext.Current.TargetingSystem.TargetingContextP
>rofile ) And running ContentSelector should get the
>targetted discounts. 
products[vbcol=seagreen]
>in one page, you will probably get more than one
returned
>applicable discounts. You probably have to use the site
>code to 
>product. 
and[vbcol=seagreen]
>confers no rights. Use of included script samples are
>subject to the terms specified at 
>responses to this message are best directed to the
>newsgroup/thread from which they originated. 
a[vbcol=seagreen]
>product/SKU 
microsoft.public.commerceserver.campaigns_csf[vbcol=seagreen] 
>microsoft.public.commerceserver.campaigns_csf:2625 
>microsoft.public.commerceserver.campaigns_csf 
with[vbcol=seagreen] 
>.
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:11 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register