Try our conversational search powered by Generative AI!

Retrieve the promotions/discounts applied on a purchase order.

Vote:
 

Dear Team,
Request you to provide me the instructions to retrieve the promotions/discounts applied on a purchase order.

I am using the below code
_promotionEngine.Run(purchaseOrder, new PromotionEngineSettings(RequestFulfillmentStatus.Fulfilled, true))


However I am unable to get the reward information of the expired discounts .

EPiServer Version :10.2

Regards
Venkata Phani kumar R

#179362
Jun 09, 2017 1:50
Vote:
 

The information of applied discounts are stored in IOrderForm.Promotions. Here you can get the information about the promotions applied and the amounts saved. So if you have an order, just access its .Forms (normally you only have one form so) 

((IOrderGroup)purchaseOrder).Forms.First().Promotions

#179378
Jun 09, 2017 10:15
Vote:
 

Quan Mai,

We have custom promotions with custom fields. How can I access the data on these custom fields from the order form like you showed?

Thanks

#185112
Nov 09, 2017 17:58
Vote:
 

Either store it in AdditionalInformation in the PromotionInformation or load the promotion object and read it from there. Downside is that if you load the promotion and read it in real time you can't really use it on purchaseOrders, since they should always have a snapshot of the promotion data that was applied.

#185113
Nov 09, 2017 18:21
Vote:
 

Thanks Joel, could you point me in the right direction to load up the promotion object?

#185114
Nov 09, 2017 18:26
Vote:
 

Promotions are IContent, just use the content loader to load them from the PromotionInformation.ContentLink :)

#185115
Nov 09, 2017 18:27
Vote:
 

Ah, I did not realize that. Thanks!

#185116
Nov 09, 2017 18:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.