Provide Orders from Salesforce Order Management
Starting in PWA Kit 3.16, Composable Storefront orders are integrated with Salesforce Order Management (SOM). The storefront shows customer order details and order history from SOM, if available. The integration requires that you set up a connection between the B2C Commerce instance and the SOM organization. Providing shoppers with a real-time view of their past and current orders from SOM empowers them to check their order status and history, which reduces support costs. This integration keeps storefront orders synchronized with the merchant’s backend order management system.
This feature is available starting with B2C Commerce version 26.3.
Before the storefront can show SOM orders, perform these steps.
- To connect the B2C Commerce instance to SOM, see Connect B2C Commerce and Order Management in Salesforce Help.
- Enable sharing of SOM records. See Enable Order Management for B2C Commerce in Salesforce Help.
Test the integration by placing an order from the storefront to SOM by using the placeOrder hook. After the connection is set up, calling OrderMgr.placeOrder(order) creates an order in SOM.
This code snippet shows one way of how to place an order and handle the order placement flow. It places an order in SOM via the placeOrder hook. Next, it gets the export and confirmation status if the order placement was successful. You can implement additional logic to satisfy your specific requirements.