Try our conversational search powered by Generative AI!

Add property to PromotionData in new marketing UI

Vote:
 

Hi!

I just started to implement the new promotion engine and the built in promotions suits me good enough but I would like to add an Xhtml property to all the built in promotions.
Is that doable without overriding everyone of them like this example shows?

http://world.episerver.com/documentation/Items/Developers-Guide/Episerver-Commerce/9/Marketing/new_promotions/

Or maybe you could add a "MainBody" Xhtml property by default?

I would like to have one text in listings and another on the page where you can read about the promotion item. Of course I could use first 200 chars in listings from Description and use all of it in the presentation but a property of its own would be best.

Thanks!

/Kristoffer

#175507
Feb 22, 2017 10:46
Vote:
 

Unfortunately no, there is no other way than to add your PromotionData types which inherit from the default ones.

/Q

#175510
Feb 22, 2017 11:41
Vote:
 

I had this question a while back as well. It seems like there is no simple way of doing this. This seems to be pretty much in line with how other episerver content types work though - you need to extend the base class to be able to add your own fields to them, be it ProductContent, VariationContent or any of the promotion content types.

It's of course a bit more of hassle in this context since you have to do it for all of them, and new ones might be added with updates.

Something that helps is if you define an interface that defines the extra fields that all your extended promotions should have, then you have your extended promotions implement that interface. This helps in the future if you need to add more fields and don't want to forget about adding it to one of your extended promotion classes.

Other than that, remember that there, from v10.1 or higher, is a way do "hide" all the built in promotions so that there aren't two of each (your extended and the original one) when you open the create promotion dialog:
http://world.episerver.com/documentation/developer-guides/commerce/marketing/hiding-promotion-types/

#175511
Feb 22, 2017 11:42
Vote:
 

Thanks, then I will go for the 200 chars solution.

/Kristoffer

#175512
Feb 22, 2017 11:52
Vote:
 

Thanks Jafet!
I will check with my customer. If they only want to use 4-5 of the built in promotions I could disable all and make my own with the built is as base class. We'll se.

/Kristoffer

#175516
Feb 22, 2017 12:04
* 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.