Skip to main content

Posts

Showing posts from July, 2018

How to read applied promotions codes

The below snippet will give you to read the promotions codes which are applied to order number, String orderId = "978593958"; OrderKey orderKey = new OrderKey(new Long(orderId)); PromotionArgumentSessionBeanPersistenceManager promoManager = new PromotionArgumentSessionBeanPersistenceManager(); PromotionArgument promArg = promoManager.load(orderKey); Iterator prmoExeRecds = promArg.getPromotionExecutionRecords(); while(prmoExeRecds.hasNext()) { PromotionExecutionRecord promotionExeecutionRecord = (PromotionExecutionRecord) prmoExeRecds.next(); Promotion promotion = promotionExeecutionRecord.getPromotion(); System.out.println("Name: " + promotion.getName()); System.out.println("Admin description: " + promotion.getDescription(commandContext.getLocale(), com.ibm.commerce.marketing.promotion.Description.SHOPPER_SHORT_DESC)); }