Create Discount from code

Vote:
 

Is it possible to programmatically create a Discount?

Same as would happen if it were done from UI, http://prntscr.com/ie4s65

Regards,

/Stefan Sonesson

#188166
Feb 13, 2018 14:37
Vote:
 

Yes,

I wrote about it a while ago: https://vimvq1987.com/2016/06/beauty-episerver-commerce-new-promotion-system/ 

promotions are just content, so you can use the IContentRepository to create/load/update/save the PromotionData instance 

#188168
Feb 13, 2018 14:48
Vote:
 

Quan thats golden! Thanks alot.

#188170
Feb 13, 2018 15:06
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.