Applying Discount to Product with Banner

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hi Guys,

I want to create a banner on top of ProductSimple.Template page. Like code blow

@if (Model.AppliedDiscount != null)
            {
    <div class="special-offer-wrapper">
        <div class="special-offer-inner">
            <div class="container">
                <div class="dt full" style="height: 100px;">
                    <div class="col-xs-4 dtc vam fn">
                        @if (Model.AppliedDiscount.UsePercentage)
                        {
                            <img src="@Url.Content("~/Themes/BlueClean/images/icons/discount-percent.png")" width="50" class="marr10" />
                            <span>Size Özel % @Math.Round(Model.AppliedDiscount.DiscountPercentage) indirim !</span>
                        }
                        else
                        {
                            <img src="@Url.Content("~/Themes/BlueClean/images/icons/discount-price.png")" width="50" class="marr10" />
                            <span>Size Özel @Model.AppliedDiscount.DiscountAmountText indirim !</span>
                        }
                    </div>
                    <div class="col-xs-4 dtc vam fn fs30 special-offer-price">
                        @if (!String.IsNullOrWhiteSpace(Model.ProductPrice.PriceWithDiscount))
                        {
                            @Html.Raw(Model.ProductPrice.PriceWithDiscount)
                        }
                    </div>
                    <div class="col-xs-4 dtc vam fn">
                        Bu ürünün size özel fiyatı<br />
                        Sepete Ekleyin fırsatı kaçırmayın
                    </div>
                </div>
            </div>
        </div>
    </div>
}


My problem is AppliedDiscount comes always null. There for I didnt show to customer discount popup.

I crate discount in admin panel to "assigned to order subtotal" and "Customer has one of these products in the cart" options.

Is there anything wrong or its a campain bug.

My Nop version is 3.60
6 years ago
Any idea from anyone guys ?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.