Content Selection Framework - How to obtain the Discount Coupon Value

This is Interesting: Free IT Magazines  
Home > Archive > Content Selection Framework > January 2005 > How to obtain the Discount Coupon Value





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 How to obtain the Discount Coupon Value
Shanbhag

2004-12-30, 2:46 am

Kindly tell me how to obtain the value(price) associated with the Coupon.

First I need to determine whether the discount given is in Amount($10
off) or in Percentage(5%)
Is there any variable/API which would provide me this??

Also tell me how can the OrderForm be updated with the discounted
value?
Is the update done automatically by ReservePromoCode and RedeemPromoCode?
I also need to display the amount of discount which was given to the
user.

Kindly help me out.
Thanking you



agindian

2004-12-30, 7:50 am

David,
Some code snippets will also be useful to determine the Discount
Value.


David Messner [MSFT]

2005-01-05, 5:53 pm

You might look at one of the solution sites/SDK samples that applies
discounts such as MSIB or the recently released CS2002/FP1 Starter Site.

The answer is in the keys written out by OrderDiscount (this is no
different for coupon-enabled discounts than it is for any CS2002 discount).
From the docs:

item._itemlevel_discounts_applied

Not always written (only written if one or more item level discounts apply
to the line item). A SimpleList of dictionaries where each dictionary
contains information about an item level discount that was applied to the
line item. The order of the list is significant and represents the order in
which the discounts were applied to this line item.
The dictionary contains the following elements for each discount:

discount_id: Campaign item ID (VT_I4)
discount_priority: Discount priority (rank) (VT_I4)
discount_timestamp: Last-modified timestamp of the discount (VT_DATE)
cy_discount_amount: How much was actually taken off of the item (VT_CY)
discount_type: 1=Currency Value; 2=Percentage (VT_I4)
cy_discount_value: Currency value or percentage value (VT_CY)
discount_name: Discount name (VT_BSTR)
Type: Dictionary (VT_DISPATCH)

And the similar keys written by OrderLevelDiscountApply component, if the
discount is order-level:

item._orderlevel_discounts_applied

-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: "agindian" <aniltom01@yahoo.com>
Newsgroups: microsoft.public.commerceserver.campaigns_csf
Subject: Re: How to obtain the Discount Coupon Value
Date: Thu, 30 Dec 2004 07:53:15 -0500
Organization: www.talkaboutsoftware.com
Message-ID:
< 2ec27fec660624722e055b06a864840d@localho
st.talkaboutsoftware.com>
X-Newsreader: www.talkaboutsoftware.com
Content-Type: text/plain;
References:
< 6b11e5f8f932b89837cddba012306548@localho
st.talkaboutsoftware.com>
X-Complaints-To: abuse@supernews.com
Lines: 5
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!new
sfeed1.ip.tiscali.net!news.glorb.com!tdsnet-transit!newspeer.tds.net!sn-xit-
03!sn-xit-12!sn-xit-01!sn-post-02!sn-post-01!supernews.com!corp.supernews.co
m!not-for-mail
Xref: cpmsftngxa10.phx.gbl
microsoft.public.commerceserver.campaigns_csf:2954
X-Tomcat-NG: microsoft.public.commerceserver.campaigns_csf

David,
Some code snippets will also be useful to determine the Discount
Value.



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com