---
title: Displaying the shopping cart preview on pages
related:
  - https://docs.kentico.com/k9/managing-website-content/working-with-pages.md
  - https://docs.kentico.com/k9/e-commerce-features/configuring-your-store/checkout-process.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The shopping cart preview is a part of the website [pages](https://docs.kentico.com/k9/managing-website-content/working-with-pages.md) where you display, for example, the total price of the current [shopping cart](https://docs.kentico.com/k9/e-commerce-features/configuring-your-store/checkout-process.md), and which serves as a hyperlink to the shopping cart from the whole on-line store.

![The shopping cart preview](https://docs.kentico.com/docsassets/k9/displaying-the-shopping-cart-preview-on-pages/shopping_cart_preview.png "The shopping cart preview")

To add the shopping cart preview, use the **Static text** web part and combination of [macros](https://docs.kentico.com/k9/macro-expressions.md) according to your requirements. On this page, you can find a guideline how you can set the shopping cart preview.

## Configuring the shopping cart preview

To display the preview on pages, place the **Static text** web part on the main page of the template that should display the preview. Then, write the macros which display the information you want.

1. Open the **Pages** application.
2. Select the main page of the [template](https://docs.kentico.com/k9/developing-websites/managing-page-templates.md) that should display the preview (for example, the homepage of your website or the [main page of your store](https://docs.kentico.com/k9/e-commerce-features/configuring-your-store/configuring-products/configuring-product-structure.md)).
3. Switch to the **Design** tab.
4. [Place](https://docs.kentico.com/k9/custom-development/developing-web-parts/creating-new-web-parts.md) the **Static text** web part on the page.
5. Enter the desired properties.
   - You need type the macros in the **Text** field in the **Content** category.
   - [See suitable macros for creating the shopping cart preview below.](#suitable-macros-for-creating-the-shopping-cart-preview)
6. Click **Save & Close**.

Your website now displays the shopping cart preview.

### Suitable macros for creating the shopping cart preview

**Total price of the shopping cart**

To display the total price of the shopping cart, use the following macro:

```csharp

{% FormatPrice(ECommerceContext.CurrentShoppingCart.TotalPrice)|(resolver)WebPartRender %}

```

> **Info:** Since you need to [delay the resolving of the macros](https://docs.kentico.com/k9/macro-expressions/entering-macro-expressions.md), do not forget to include the _|(resolver)_ part of the macro. Otherwise, it will not display the correct information.

**Total units of the products in the shopping cart**

To display the total units of all [products](https://docs.kentico.com/k9/e-commerce-features/managing-your-store/products.md) in the shopping cart, use the following macro:

```csharp

{% ECommerceContext.CurrentShoppingCart.TotalUnits|(resolver)WebPartRender %}

```

> **Info:** Since you need to [delay the resolving of the macros](https://docs.kentico.com/k9/macro-expressions/entering-macro-expressions.md), do not forget to include the _|(resolver)_ part of the macro. Otherwise, it will not display the correct information.

**The shopping cart URL**

To get the URL of the current site's shopping cart, use the following macro:

```csharp

{% Settings.CMSShoppingCartURL %}

```

The macro gets the value from the settings. To change the shopping cart URL:

1. Open the **Store configuration** application (if you want to set the URL for the current site) or the **Multistore configuration** application (if you want to set the URL [globally](https://docs.kentico.com/k9/e-commerce-features/configuring-your-store/choosing-site-or-global-e-commerce-configuration.md)).
2. On the **Store settings -> General** tab in the **Pages** category, type the URL in the **Shopping cart URL** field.

   > **Tip:** Use the tilde character (~~) in the URL. For example: \*~~/Store/Shopping-cart\*

   - If you are in the **Store configuration** application, clear the _Inherit from global settings_ option first.
3. Click **Save**.

The system now returns the specified address when you use the _Settings.CMSShoppingCartURL_ macro.

> **Tip:** Similarly, you can set and use the URL for the _My account_/_My profile_ page and the _Wishlist_ page:
>
> **The My account URL**
>
> ```csharp
>
> {% Settings.CMSMyAccountURL %}
>
> ```
>
> In the **Store configuration** application (the **Multistore configuration** application respectively), type the URL in the **My account URL** field.
>
> **The Wishlist URL**
>
> ```csharp
>
> {% Settings.CMSWishlistURL %}
>
> ```
>
> In the **Store configuration** application (the **Multistore configuration** application respectively), type the URL in the **Wishlist URL** field.
