|
Home > Archive > Content Selection Framework > October 2006 > How to get a 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]
| Author |
How to get a discount ?
|
|
| antoine.seiter@gmail.com 2006-10-31, 1:24 am |
| Hello,
I want to get some information about discounts without puting them into
a basket...
Here is my way to get all discounts for a specific product :
public static DiscountItemCollection GetDiscounts(string
catalogName, string productID)
{
DiscountItemCollection allDiscounts =
DiscountItemCollection.CreateFromCache("Discounts");
DiscountCriteriaFilter filter = new
DiscountCriteriaFilter();
filter.IncludeInactiveDiscounts = false;
return allDiscounts.ApplyProductFilter(filter, catalogName,
productID);
}
The DiscountItem objects returned contains an ID, a display name, ...
but neither an offer type, nor an offer amount.
- Is it possible to get a Microsoft.CommerceServer.Marketing.Discount
form these Microsoft.CommerceServer.Runtime.Marketing.DiscountItem ?
>From their ID maybe ?
- Is it possible to specify a pipeline to launch when the cache manager
loads discounts ?
Thanks in advance,
Antoine.
| |
| antoine.seiter@gmail.com 2006-10-31, 1:24 am |
| Hmmm, I forgot to say that I'm using Commerce Server 2007.
Antoine.
antoine.seiter@gmail.com a =E9crit :
> Hello,
>
> I want to get some information about discounts without puting them into
> a basket...
> Here is my way to get all discounts for a specific product :
>
> public static DiscountItemCollection GetDiscounts(string
> catalogName, string productID)
> {
> DiscountItemCollection allDiscounts =3D
> DiscountItemCollection.CreateFromCache("Discounts");
>
> DiscountCriteriaFilter filter =3D new
> DiscountCriteriaFilter();
> filter.IncludeInactiveDiscounts =3D false;
>
> return allDiscounts.ApplyProductFilter(filter, catalogName,
> productID);
> }
>
> The DiscountItem objects returned contains an ID, a display name, ...
> but neither an offer type, nor an offer amount.
>
> - Is it possible to get a Microsoft.CommerceServer.Marketing.Discount
> form these Microsoft.CommerceServer.Runtime.Marketing.DiscountItem ?
> - Is it possible to specify a pipeline to launch when the cache manager
> loads discounts ?
>=20
> Thanks in advance,
>=20
> Antoine.
| |
| antoine.seiter@gmail.com 2006-10-31, 1:24 am |
| I was wrong... DiscountItem objects contain all information I need.
By adding the XML below in your web.config, a cache loader
(CSFLoadDiscounts) will be automatically called to load the Discounts :
<CommerceServer>
<caches>
<cache name=3D"Discounts" type=3D"Discounts"
loaderprogid=3D"Commerce.CSFLoadDiscounts" refreshInterval=3D"0"
retryInterval=3D"30" />
</caches>
</CommerceServer>
Specifying "Commerce.CSFLoadDiscounts" in the loaderprogid attribute is
not mandatory, because it's the default value.
Here is a table that lists all the property of DiscountItem AFTER the
cache loader job :
http://msdn.microsoft.com/library/d...en-us/CS07Defa=
ult/html/0bffcd15-24f3-4730-8c67-84a92c7519c6.asp
Hope this will help you as it helps me,
Antoine.
antoine.seiter@gmail.com a =E9crit :
[vbcol=seagreen]
> Hmmm, I forgot to say that I'm using Commerce Server 2007.
>
> Antoine.
>
>
>
> antoine.seiter@gmail.com a =E9crit :
>
|
|
|
|
|