Webiant Logo Webiant Logo
  1. No results found.

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

Vendor.cshtml

@model VendorModel

@using Nop.Core
@using Nop.Core.Domain.Seo
@using Nop.Core.Domain.Vendors

@inject IWebHelper webHelper
@inject SeoSettings seoSettings

@{
    Layout = "_ColumnsTwo";

    //title
    NopHtml.AddTitleParts(!string.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name);
    //meta
    NopHtml.AddMetaDescriptionParts(Model.MetaDescription);
    NopHtml.AddMetaKeywordParts(Model.MetaKeywords);
    //page class
    NopHtml.AppendPageCssClassParts("html-vendor-page");

    if (seoSettings.CanonicalUrlsEnabled)
    {
        var vendorUrl = (await NopUrl.RouteGenericUrlAsync<Vendor>(new { SeName = Model.SeName }, webHelper.GetCurrentRequestProtocol())).ToLowerInvariant();
        NopHtml.AddCanonicalUrlParts(vendorUrl, seoSettings.QueryStringInCanonicalUrlsEnabled);
    }
}

@section CatalogFilters {
    @await Html.PartialAsync("_CatalogFilters", Model.CatalogProductsModel)
}

<div class="page vendor-page">
    <div class="page-title">
        <h1>@Model.Name</h1>
    </div>
    <div class="page-body">
        @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.VendorDetailsTop, additionalData = Model })
        @*description*@
        @if (!string.IsNullOrWhiteSpace(Model.Description))
        {
            <div class="vendor-description">
                @Html.Raw(Model.Description)
            </div>
        }
        @*contact vendor*@
        @if (Model.AllowCustomersToContactVendors)
        {
            <div class="contact-vendor">
                <button type="button" class="button-2 contact-vendor-button" onclick="setLocation('@Url.RouteUrl(NopRouteNames.Standard.CONTACT_VENDOR, new { vendorId = Model.Id })')">@T("ContactVendor")</button>

                @if(Model.PmCustomerId > 0)
                {
                    <button type="button" class="button-2 pm-vendor-button" onclick="setLocation('@Url.RouteUrl(NopRouteNames.Standard.SEND_PM, new { toCustomerId = Model.PmCustomerId })')">@T("SendPmToVendor")</button>
                }
            </div>
        }
        @await Html.PartialAsync("_CatalogSelectors", Model.CatalogProductsModel)
        @{
            var catalogProductsViewData = new ViewDataDictionary(ViewData)
            {
                ["fetchUrl"] = Html.Raw(Url.RouteUrl(NopRouteNames.Ajax.GET_VENDOR_PRODUCTS, new { vendorId = Model.Id }))
            };
        }
        @await Html.PartialAsync("_CatalogProducts", Model.CatalogProductsModel, catalogProductsViewData)
        
        @await Html.PartialAsync("_VendorProductReviews", Model.ProductReviews.Reviews)

        @if (Model.ProductReviews.PagingFilteringContext.TotalPages > 1)
        {
            <div class="block">
                <a href="@Url.RouteUrl(NopRouteNames.Standard.VENDOR_REVIEWS, new { vendorId = Model.Id })">@T("Vendors.Reviews.All")</a>
            </div>
        }

        @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.VendorDetailsBottom, additionalData = Model })
    </div>
</div>