Extension Point: Order Data Populator
Basics
Parameter | Value |
---|---|
Extension Point Key | ORDER_DATA_POPULATOR |
Extension Point Name | Populate Order Data during Purchase |
Extension Interface | OrderDataPopulator |
Supports Multiple Extensions? | Yes |
Selector Type | Store |
Available Since | 1.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);
}
}