Promotions when PromotionData is in external system?


Hi :) 

We're running Commerce 10.4.3 and I'm wondering what would be the recommended way to handle promotions when you can't publish the promotion data beforehand. In our specific case we have coupon codes that are validated through an api and may be personal. Lets say we have a fixed amount discount promotion but you can have multiple of them applied to the order (much like a payment, but should be calculated as a discount) through multiple codes.

You can produce a summary reward with the current structure but you don't get distinct promotioninformation records and only a single description text. I've wrecked various parts of the engine (including PromotionEngineContentLoader) to produce duplicates of the promotions to process but it's a bit beyond reasonable adaption.

Mar 16, 2017 16:57

I am not sure if it will work for you but there is an interface IAdditionalPromotionInformationCreator which is called in the engine and allows you to set AdditionalInformation.  You could add what you need to be able to add additional entries for PromotionInformationEntry after the engine returns.

Mar 16, 2017 17:58

In what ways does it need to be counted as a discount?

The way we have solved vouchers and giftcards is that we add them as payments and the customized everything else, how those payments/discounts are shown at checkout, the tax calculations, all the calculators really, etc.

It is a lot of work to be honest but along the road we faced the fact that we needed to be able to handled cancelled orders with refunds on the vouchers/giftcards, attempting to build that kind of support on top of the discount system would also be a monumental effort.

Mar 17, 2017 16:24
* 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.