i have to show on the product page the price , the reduced price ( with the first discount that can apply ex : 10 % off if you buy 1 item)
ex : product XXX 10 $ > 9$ ( 10% off)
then i have to show other discount that can apply if you buy more
ex : buy 2 product XXX then get 20% off ( discount can be linked to user profile and or product expression)
i have tried
DiscountCriteriaFilter filter = new DiscountCriteriaFilter(); ...
but it don't show discount linked to profil ( because you can not send profil information in it)
also tried the solution with the pipeline
RunCSOWithItemsAndProducts (..., ...)
but it didn't show other related discount to my product
Did someone know how to show discounted price on the product page
how to list related discount of a product using or not pipeline
best regards!

find discount for product
Erik Bertrand
i can't beleve that i need to create a basket and run all pipeline to find a discount ....
ggsubscribe
Set the cache in the web config:
<
caches><cache name="Discounts" type="Discounts" loaderprogid="Commerce.CSFLoadDiscounts" refreshInterval="0" retryInterval="1"/></caches>After you run the DiscountItemCollection.ApplyProductFilter, in the resulting discount coollection use the method DiscountItemCollection.DiscountItem[the field name below] and you will get the price, etc from which you can display the data.
The offer_type and offer_value will give you what you want.
<H2>Discount at row #0</H2><P>
Field Name: award_catalog Field Value: Catalog<br>
Field Name: award_category Field Value: Books<br>
Field Name: award_expr Field Value: 12<br>
Field Name: award_max Field Value: 0<br>
Field Name: award_product Field Value: <br>
Field Name: b_reuse_award_as_award Field Value: False<br>
Field Name: b_reuse_award_as_cond Field Value: False<br>
Field Name: b_reuse_cond_as_award Field Value: False<br>
Field Name: b_reuse_cond_as_cond Field Value: False<br>
Field Name: campaign_id Field Value: 2<br>
Field Name: click_required Field Value: False<br>
Field Name: condition_basis Field Value: 2<br>
Field Name: condition_catalog Field Value: <br>
Field Name: condition_category Field Value: <br>
Field Name: condition_expr Field Value: 0<br>
Field Name: condition_mny_min Field Value: 0.0000<br>
Field Name: condition_product Field Value: <br>
Field Name: condition_qty_min Field Value: 1<br>
Field Name: date_end Field Value: 1/13/2008 12:00:00 AM<br>
Field Name: date_modified Field Value: 1/5/2007 2:21:22 PM<br>
Field Name: date_start Field Value: 1/2/2006 12:00:00 AM<br>
Field Name: disjoint Field Value: False<br>
Field Name: exposure_limit Field Value: 1<br>
Field Name: expressions_used_for_display Field Value: False<br>
Field Name: height Field Value: 60<br>
Field Name: item_id Field Value: 2<br>
Field Name: limit Field Value: 0<br>
Field Name: name Field Value: TENPCT<br>
Field Name: offer_type Field Value: 1<br>
Field Name: offer_value Field Value: 29<br>
Field Name: order_level Field Value: False<br>
Field Name: promocode_definition_id Field Value: 0<br>
Field Name: promocode_public_code Field Value: <br>
Field Name: promocode_usage_limit Field Value: 0<br>
Field Name: promocode_usage_type Field Value: 0<br>
Field Name: rank Field Value: 2<br>
Field Name: size Field Value: Banner<br>
Field Name: special_offer_type Field Value: <br>
Field Name: template Field Value: No Display<br>
Field Name: width Field Value: 468<br>
Field Name: pagegroups Field Value: <br>
Field Name: values Field Value: System.__ComObject<br>
Field Name: target_actions Field Value: System.Object[]<br>
Field Name: required_exprs Field Value: <br>
Field Name: basket_displays Field Value: System.Object[]<br>
Field Name: description Field Value: TENPCT<br>
Field Name: _RowNum Field Value: 0<br>
End Row
enjoy.
LPJ
The discount system is very complex. If you want to be sure that your discount applies, you need to run the pipelines to validate that the items and quantities are correct, the user has the proper properties, promo codes are valid, etc.
If you want a rough estimate, you can use DiscountCriteriaFiltering, but this only works for simple discounts. Another option to explore is the Content Selection Framework. It can display discounts that apply based on products in your basket, on the current page, and the user profile properties. See http://msdn2.microsoft.com/en-us/library/aa545379.aspx and http://msdn2.microsoft.com/en-us/library/ms960069.aspx in the help.
Also you may want to visit the Commerce Server GotDotNet site (http://www.gotdotnet.com/Workspaces/Workspace.aspx id=77487df3-96dc-41de-9ca0-b7f284a8c113) and look at Madhur's "Sample page on how to retreive the discounts that target a given list of products or line items" project (sorry, I'm not aware of a good way to link directly in GotDotNet)
Hope this helps.
David
Bill F.
I have seen this kind of display done before on the product page, but usually it is done by tagging a product with a code (using custom field(s) in the product definition). The page then uses this code to grab info or an image about the discount.
You could add the product to the users basket, run the pipelines and see if any discount applied. However, you would have to do this on every product page, and it would only tell you about discounts that the basket products qualified for. Not every discount relating to that product.
Having said all that, if there is a better way I would like to know about it too!