on ‎2018 Mar 16 12:14 PM
Hello,
We use the method "getAbstractProductPromotions" from DefaultPromotionEngineService to get all potencial promotions engine for the product in the PDP. We need to access to the detail of these promotions for implement bussines logic before return the message promotion to the PDP. SourceRule class has conditions and actions, but these fields are String type and we think hybris should provide a easy way to get data field, because parsing this string is a hard work.
Examples:
In a percent promotion of 10% for product X we need to know 10 data.
In a NxM we need to know N and M data.
Does someone know an ease way to get data promotion?
Thanks.
Request clarification before answering.
There is no direct way to parse the conditions and actions, You need to use object mapper to convert the JSON strings to POJO objects. You can take the JSON string generated after you create the promotion source rule and use any online tool to generate POJO classes. Then you can parse the JSON to POJO and retrieve the data you need. you need to follow this similar approach if you wish to add any dynamic condition to your promotion source rule.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello ,
Thanks for you answer. To complete the informatión:
We can use OOTB classes RuleActionData and RuleConditionData how target of the conversion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.