Skip to main content
Version: 1.2.x

Extension Point: Order Data Populator

Basics​

ParameterValue
Extension Point KeyORDER_DATA_POPULATOR
Extension Point NamePopulate Order Data during Purchase
Extension InterfaceOrderDataPopulator
Supports Multiple Extensions?Yes
Selector TypeStore
Available Since1.0.0

Use Cases​

Extensions implementing this Extension Point can return key/value pairs that are used to populate Order Data fields, which are visible to business users on an order in Commerce Manager.

Methods​

collectOrderData​

The collectOrderData method is invoked during checkout. It can use data from the context, or make calls to external services to retrieve data that needs to be populated on the order.

Extension Sample​

@Extension
@XPFAssignment(extensionPoint = XPFExtensionPointEnum.ORDER_DATA_POPULATOR, priority = 100)
public class IPOrderDataPopulator extends XPFExtensionPointImpl implements OrderDataPopulator {

private static final String IP_ADDRESS = "ip-address";

@Override
public Map<String, String> collectOrderData(final XPFOrderDataPopulatorContext orderDataPopulatorContext) {
String ipAddress = (String) orderDataPopulatorContext.getShoppingCart().getShopper().getSession().getTagSet().get(IP_ADDRESS);
return Collections.singletonMap(IP_ADDRESS, ipAddress);
}
}