寻找折扣产品 [英] Finding products for discount

查看:108
本文介绍了寻找折扣产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有折扣ID。我想找到与折扣相关的产品(如果有的话)。我如何实现这一目标?


目前,我希望这些信息仅用于简单折扣(即购买产品X并获得Y%折扣),尽管我可能需要支持更复杂的折扣类型稍后。


感谢任何帮助。


谢谢

解决方案

我没有处理过这种特殊情况,但做了类似的事情。


你可以通过这样做得到DiscountCollection:


 DiscountItemCollection dic = DiscountItemCollection.CreateFromCache(cacheName); 


您可以使用CriteriaFilter过滤它返回的折扣。这可能不适用于您,这里有一个示例:


 DiscountCriteriaFilter filter = new DiscountCriteriaFilter(); 
filter.FilterOnAward = true;
filter.FilterOnCondition = true;
filter.IncludeDiscountsWithEligibilityRequirements = true;
filter.IncludeDiscountsWithPromoCodes = false;
filter.IncludeInactiveDiscounts = false;


然后您可以获得所有折扣。不幸的是,我没有关于DiscountItem的属性的任何文档。 您可以使用discountitem中的属性的索引或名称来访问属性。这是msdn文档:


http://msdn.microsoft.com/en-us/library/microsoft.commerceserver.runtime.marketing.discountitem_members%28v=CS.90%29 .aspx


希望这会有所帮助。


 


祝你好运!


I have a discount id. I want to find the product (if any) related to the discount. How do I achieve this?

For now, I want this information only for Simple Discount (i.e. buy Product X and get Y % off), although I might have to support more complicated discount types later.

Any help is appreciated.

Thanks

解决方案

I have not dealt with this specific situation but have done something similar.

You can get the DiscountCollection by doing this:

    DiscountItemCollection dic = DiscountItemCollection.CreateFromCache(cacheName);

You can filter the discounts it returns by using a CriteriaFilter. This may not apply to you, here is a sample:

 DiscountCriteriaFilter filter = new DiscountCriteriaFilter();
    filter.FilterOnAward = true;
    filter.FilterOnCondition = true;
    filter.IncludeDiscountsWithEligibilityRequirements = true;
    filter.IncludeDiscountsWithPromoCodes = false;
    filter.IncludeInactiveDiscounts = false;

You can then get all the discounts. Unfrotunately i do not have any documentation on the properties for the DiscountItem.  You can access the properties by using the index or name of the property within the discountitem. Here is the msdn documentation:

http://msdn.microsoft.com/en-us/library/microsoft.commerceserver.runtime.marketing.discountitem_members%28v=CS.90%29.aspx

Hope this helps.

 

Good luck!


这篇关于寻找折扣产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆