Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

_DiscountBox.cshtml

@model ShoppingCartModel.DiscountBoxModel
@if (Model.Display)
{
    <div class="coupon-box">
        <h2 class="title">
            @T("ShoppingCart.DiscountCouponCode")
        </h2>
        <div class="hint">
            @T("ShoppingCart.DiscountCouponCode.Tooltip")
        </div>
        <div class="coupon-code">
            <input name="discountcouponcode" id="discountcouponcode" type="text" class="discount-coupon-code" aria-label="@T("ShoppingCart.DiscountCouponCode.Label")" />

            <button type="submit" name="applydiscountcouponcode" id="applydiscountcouponcode" class="button-2 apply-discount-coupon-code-button">@T("ShoppingCart.DiscountCouponCode.Button")</button>
        </div>
        @foreach (var message in Model.Messages)
        {
            <div class="@(Model.IsApplied ? "message-success" : "message-failure")">
                @message
            </div>
        }
        @foreach (var discount in Model.AppliedDiscountsWithCodes)
        {
            <div class="current-code">
                <span class="applied-discount-code">@string.Format(T("ShoppingCart.DiscountCouponCode.CurrentCode").Text, discount.CouponCode)</span>
                @*empty value (little hack for FormValueExistsAttribute)*@
                <button type="submit" name="removediscount-@discount.Id" class="remove-discount-button"></button>
            </div>
        }
    </div>
    <script asp-location="Footer">
        $(function() {
            $('#discountcouponcode').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    $('#applydiscountcouponcode').trigger("click");
                    return false;
                }
            });
        });
    </script>
}