@using MrCMS.Web.Apps.Ecommerce.Entities.Products
@using MrCMS.Web.Apps.Ecommerce.Helpers
@using MrCMS.Web.Apps.Ecommerce.Services.Pricing
@using MrCMS.Website
@model MrCMS.Web.Apps.Ecommerce.Entities.Products.ProductVariant
@{
    var pricingMethod = MrCMSApplication.Get<IProductPricingMethod>();
}
<div id="product-variants-pricebreaks">
    @if (Model.PriceBreaks.Any())
    {
        <table id="product-pricebreaks-table" class="table grey-border price-break">
            <thead>
                <tr>
                    <th>Price Breaks</th>
                    <th>&nbsp;</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.PriceBreaks.OrderBy(x => x.Quantity))
                {
                    <tr>
                        <td>Buy @item.Quantity&nbsp;+</td>
                        <td>@pricingMethod.GetPrice(item).ToCurrencyFormat()</td>
                    </tr>
                }
            </tbody>
        </table>
    }
</div>
