How to get a discount ?
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 discount ?




  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 discount ?  
antoine.seiter@gmail.com


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


 
10-31-06 06: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.






[ Post a follow-up to this message ]



    Re: How to get a discount ?  
antoine.seiter@gmail.com


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


 
10-31-06 06: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.






[ Post a follow-up to this message ]



    Re: How to get a discount ?  
antoine.seiter@gmail.com


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


 
10-31-06 06: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 :
> 






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:03 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