> For the complete documentation index, see [llms.txt](https://developer.emporix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.emporix.io/frontend/commerce-examples/orders.md).

# Orders

Learn how to complete purchases on the B2B Commerce Frontend, from adding products to your cart through checkout to order confirmation. The platform supports both registered customer checkout and guest checkout flows, giving you flexibility in how you complete your purchases and manage your orders.

## Adding products to cart

When a customer is browsing products on your storefront and finds something interesting, they can put it in a cart with a standard **Add to cart** option. When they're done with selecting products, they select the **Cart** icon to see all the chosen items. It's possible to edit the cart content, add or subtract the product quantities or remove items from the cart before proceeding to checkout.

<figure><img src="/files/W2QU0qK7qASAUyvphChV" alt="Shopping cart view with selected products before checkout"><figcaption><p>Shopping cart view with selected products before checkout</p></figcaption></figure>

{% hint style="warning" %}
Add to cart may fail when, for example:

* No price, shipping, or tax is configured for the product
* A main product is used instead of a sellable variant
* Price exists only in EUR, but the customer selected USD on a multi-currency site

For the full list of requirements and where to fix them in the Management Dashboard, see [Products on the storefront](/ce/management-dashboard/settings/sites.md#products-on-the-storefront).
{% endhint %}

## Product comparison

Customers can compare products before purchasing by first adding products to the comparison list and then opening the comparison view.

{% stepper %}
{% step %}

#### Add products to comparison

On product listing or product details, choose **Add to comparison** for the products you want to evaluate.

<figure><img src="/files/2CFPtwtcOersfNdL0wnp" alt="Product list with products added to comparison"><figcaption><p>Adding products to the comparison list</p></figcaption></figure>
{% endstep %}

{% step %}

#### Open the comparison view

Open the comparison view to see product specifications side-by-side. Rows with differences between compared products (for example, **Price**) are highlighted in bold so they are easier to spot.

<figure><img src="/files/l9XvqBeGX9NS6SvdEAhQ" alt="Side-by-side comparison view of selected products"><figcaption><p>Product comparison view with side-by-side specifications</p></figcaption></figure>
{% endstep %}
{% endstepper %}

## Checkout process

When a customer is ready to proceed with the purchase, the following options are available:

* **Go to checkout** - to finish the order by registering or logging in
* **Continue as guest** - to process the purchase without the need to register or log in
* **Go to the cart** - to check more details of the products and the order before moving to payment
* **Request quote** - to send a request for a quote

### Go to checkout

Choosing this option takes a customer to the login page where they can register or log in to their account using one of the available options.

The checkout process has the following steps:

{% stepper %}
{% step %}

#### Providing the details of the shipping information

The shipping details are taken from:

* the customer's address book - the default address is selected
* the company locations tagged as `shipping` - if the customer is assigned to the registered company

The taxes are applied according to the shipping location country.
{% endstep %}

{% step %}

#### Providing the payment information

The billing addresses are taken from:

* the customer's address book
* the company locations tagged as `billing` - if the customer is assigned to the registered company

You can also add a coupon to get a discount.
{% endstep %}

{% step %}

#### Reviewing the order

The order review is displayed to the customer before the final order confirmation.

<figure><img src="/files/G1i55rsgzQ34On8XdDDl" alt="Order review step during checkout"><figcaption><p>Order review</p></figcaption></figure>
{% endstep %}

{% step %}

#### Confirming the order

Choosing the **Submit Order** button creates an order in Emporix Management Dashboard and adds the order details to the **Order History** in the customer account.

<figure><img src="/files/bkvyZXUhhYgGoMmXyDha" alt="Order history list in the customer account"><figcaption><p>Order history with list of orders</p></figcaption></figure>

From this view, the customer can also cancel the order.

<figure><img src="/files/9oBNHA5Xi6QKa0lDudSi" alt="Order details page with items and order information"><figcaption><p>Order details page</p></figcaption></figure>
{% endstep %}
{% endstepper %}

### Continue as guest

The customer has the option to complete the purchase without the need to register or log in. They can simply choose **Submit Order**.

The checkout has the following steps:

{% stepper %}
{% step %}

#### Providing the details of the shipping information

The customer needs to provide their name, contact information, and shipping address. Also, they need to choose one of the available shipping methods.

{% hint style="warning" %}
The email address provided in the shipping information cannot be associated with an existing customer account.
{% endhint %}
{% endstep %}

{% step %}

#### Providing the payment information

The customer chooses the payment method and billing address.
{% endstep %}

{% step %}

#### Reviewing the order

The customer reviews all the provided details and if everything is accurate confirms the order and proceeds to the payment by acreeing to the terms and conditions and choosing to **Submit Order**. When the order is placed, the customer gets a notification message.

<figure><img src="/files/u0o6xn40jSEVqL24l6A9" alt="Order confirmation page shown after guest checkout" width="350"><figcaption><p>Order confirmation page for guest checkout</p></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="warning" %}

* In case of the anonymous order, there is a validation mechanism that runs in the background and checks if the provided email address is already associated with an existing customer. If so, it prevents completing a guest checkout with such an email. The customer has an option to either log in or to provide a different email address.
* In the case when a guest customer later wants to return the purchased item, they need to register with the email address provided at checkout and to create a customer account. After logging in, the customer can view the orders under the order history associated with the email.
  {% endhint %}

After the customer submits the order, it is created within the Management Dashboard. The employee can set the status of the order and the storefront is updated accordingly. In a real scenario, the updates are normally integrated from an ERP backend system.

In the Management Dashboard, for the orders that were created by guest users, the **Customer #** field is marked as **Anonymous**. If the guest customer later chooses to create an account, the value of the **Customer #** is replaced with the real customer ID.

<figure><img src="/files/GvVQnFi9ucxHK6W2egGA" alt="Order view in the Management Dashboard"><figcaption><p>Order view in Management Dashboard</p></figcaption></figure>

{% hint style="info" %}
To learn more about API used in this use case see the [Order Service](/api-references/api-guides/orders/order.md) and for user guides check the [Orders](/ce/management-dashboard/orders-module.md) documentation.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://developer.emporix.io/frontend/commerce-examples/orders.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.
