---
title: Displaying discount values on MVC sites
related:
  - https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc/developing-on-line-stores-in-mvc/displaying-product-listings-on-mvc-sites.md
  - https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc/developing-on-line-stores-in-mvc/displaying-product-details-on-mvc-sites.md
  - https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc/developing-on-line-stores-in-mvc/displaying-product-details-on-mvc-sites/displaying-product-variants-on-mvc-sites.md
  - https://docs.kentico.com/k11/e-commerce-features/managing-your-store/discounts/working-with-catalog-discounts.md
  - https://docs.kentico.com/k11/e-commerce-features/managing-your-store/discounts/working-with-free-shipping-offers.md
  - https://docs.kentico.com/k11/e-commerce-features/managing-your-store/discounts/working-with-product-coupons.md
  - https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc/starting-with-mvc-development/installing-kentico-integration-packages.md
  - https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc.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).

When using [discounts](https://docs.kentico.com/k11/e-commerce-features/managing-your-store/discounts.md) or [free shipping offers](https://docs.kentico.com/k11/e-commerce-features/managing-your-store/discounts/working-with-free-shipping-offers.md) on your MVC site, you may want to display the discounted prices or display banners that show how much more customers need to spend to obtain free shipping. This page describes how to use properties and methods of the [Kentico.Ecommerceintegration package](https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc/starting-with-mvc-development/installing-kentico-integration-packages.md), used for [building MVC sites](https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc.md), to display such information.

> **Info:** **Supported discounts**
>
> The **Kentico.Ecommerce** integration package currently supports [catalog discounts](https://docs.kentico.com/k11/e-commerce-features/managing-your-store/discounts/working-with-catalog-discounts.md), free shipping offers and [product coupons](https://docs.kentico.com/k11/e-commerce-features/managing-your-store/discounts/working-with-product-coupons.md) on MVC sites.
>
> Other types of discounts also work. However, the integration package does not offer API for displaying information about those discounts.

## Displaying catalog discounts

In a controller's action, use the **CalculatePrice** method from the **PricingService** in the **Kentico.Ecommerce**  integration package. The method's calculations automatically include any catalog discounts that apply for the current customer.

The method returns a **ProductPrice** object that contains the **Discount** property. In the _Discount_ property, you can find the amount reduced by catalog discounts.

```csharp

            // Initializes the needed services
            ShoppingService shoppingService = new ShoppingService();
            PricingService pricingService = new PricingService();

            // Gets the current shopping cart
            ShoppingCart shoppingCart = shoppingService.GetCurrentShoppingCart();

            // Calculates prices for the specified product
            ProductPrice price = pricingService.CalculatePrice(sku, shoppingCart);

            // Gets the catalog discount
            decimal catalogDiscount = price.Discount;


```

> **Tip:** We recommend using a [dependency injection container](https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc/developing-mvc-applications/initializing-kentico-services-with-dependency-injection.md) to initialize service instances. When configuring the lifetime scope for _ShoppingService_ and _PricingService_, create a shared instance (singleton) for all requests.

You can then use the discount in your views.

## Displaying free shipping offers

In a controller's action, use the **CalculateRemainingAmountForFreeShipping** method of the **PricingService** in the **Kentico.Ecommerce** integration package.

The method returns the remaining amount of money for free shipping. If the cart is null, if there is no valid discount, or if free shipping was already applied, the method returns _0_.

The _CalculateRemainingAmountForFreeShipping_ method  has a shopping cart instance as a parameter. The _ShoppingCart cart_ parameter specifies a shopping cart for which the remaining amount is calculated.

```csharp

            // Initializes the needed services
            ShoppingService shoppingService = new ShoppingService();
            PricingService pricingService = new PricingService();

            // Gets the current shopping cart
            ShoppingCart shoppingCart = shoppingService.GetCurrentShoppingCart();

            // Gets the remaining amount for free shipping
            decimal remainingFreeShipping = pricingService.CalculateRemainingAmountForFreeShipping(shoppingCart);


```

> **Tip:** We recommend using a [dependency injection container](https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc/developing-mvc-applications/initializing-kentico-services-with-dependency-injection.md) to initialize service instances. When configuring the lifetime scope for _ShoppingService_ and _PricingService_, create a shared instance (singleton) for all requests.

You can then use the remaining amount in your views.

## Displaying product coupons

See [Adding coupon code fields to MVC checkout processes](https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc/developing-on-line-stores-in-mvc/checkout-process-in-mvc/using-a-shopping-cart-on-mvc-sites/adding-coupon-code-fields-to-mvc-checkout-processes.md) to learn more about adding a coupon code field to your website.
