# Order Summary component

The drb2b\_orderSummary component serves two purposes: a) Display Order Summary information on the final Place Order page.  b) Handle logic to place the order and navigate the shopper to the Thank You page.  The component is always required on the Place Order page, but can be used with some or all of the UI elements hidden.

## Publish an event to Place an Order

Depending on the checkout flow, you may need to have the order placement triggered by a button *outside* the connector’s native Place Order button. Use the following steps to publish an event that lets you trigger order placement:

{% hint style="info" %}
**Note:** You are still required to have at least one `drb2b_orderSummary` component on the page (with “Place Order” designer attribute set to true), even if the UI elements are hidden. The component is required to fire the order placement logic.
{% endhint %}

* Import the **digitalriverv3\_\_ DigitalRiverMessageChannel \_\_c** message channel and message service into a custom Javascript file as follows:

```
import showPlaceOrderButton from '@salesforce/messageChannel/digitalriverv3__DigitalRiverMessageChannel__c';
 
import {publish, MessageContext } from 'lightning/messageService';
```

* Declare the message context variable.

```
@wire(MessageContext) messageContext;
```

* Publish an event with the purpose being placeOrder.

```
publish(this.messageContext, showPlaceOrderButton, {
            purpose: 'placeOrder' 
        });
```

{% hint style="info" %}
You should make sure that the designer attribute for Bypass Validation on the drb2b\_orderSummary component is set to `{!$GlobalConstant.False}` or `{!$GlobalConstant.True}`based on whether the connector validations should be performed or whether you will implement custom validations.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-app-1.2/extend-the-salesforce-lightning-app/customizing-the-lightning-web-components/components/order-summary-component.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
