Displaying manufacturer logo on the product page...

3 years ago
Hello

I have search the internet and i find nothing.
I want to add the manufactures logo instead of Manufacturer: Dewalt on the product page.
I´m using NopCommerce 3.6
3 years ago
I think the model in this view has the picture info you need

\Presentation\Nop.Web\Views\Product\_ProductManufacturers.cshtml

This is from the ManufacturerAll view, so something similar can probably be used in above.

<div class="picture">
    <a href="@Url.RouteUrl("Manufacturer", new { SeName = item.SeName })" title="@item.PictureModel.Title">
        <img alt="@item.PictureModel.AlternateText" src="@item.PictureModel.ImageUrl" title="@item.PictureModel.Title" />
    </a>
</div>
3 years ago
hello

Thanks for your answer...
I get this error :

Compiler Error Message: CS0103: The name 'item' does not exist in the current context
3 years ago
niklas_73 wrote:
hello

Thanks for your answer...
I get this error :

Compiler Error Message: CS0103: The name 'item' does not exist in the current context


Try like bellow===>
DefaultClean File:~\Views\Product\_ProductManufacturers.cshtml


@model IList<ManufacturerModel>
@using Nop.Web.Models.Catalog;
   @{
        var pictureService = Nop.Core.Infrastructure.EngineContext.Current.Resolve<Nop.Services.Media.IPictureService>();
        var manufacturerService = Nop.Core.Infrastructure.EngineContext.Current.Resolve<Nop.Services.Catalog.IManufacturerService>();
    }

@if (Model.Count > 0)
{
    <div class="manufacturers">
        @if (Model.Count == 1)
        {
            <span class="label">@T("Products.Manufacturer"):</span>
        }
        else
        {
            <span class="label">@T("Products.Manufacturers"):</span>
        }
        <span class="value">
            @for (int i = 0; i < Model.Count; i++)
            {
                var item = Model[i];

                var manufacturer = manufacturerService.GetManufacturerById(item.Id);
                var pictureUrl = pictureService.GetPictureUrl(manufacturer.PictureId, 100);

                <a href="@Url.RouteUrl("Manufacturer", new {SeName = item.SeName})">
                    <img src="@pictureUrl" alt="@item.Name" title="@item.Name" />
                </a>
                if (i != Model.Count - 1)
                {
                <span class="separator">,</span>
                }
            }
        </span>
    </div>
}
3 years ago
hello

I get:
Parser Error Message: Only one 'model' statement is allowed in a file.

Line 103:                        @Html.Partial("_DeliveryInfo", Model)
Line 104:                        <!--product manufacturers-->
Line 105:                        @model IList<ManufacturerModel>
Line 106:@using Nop.Web.Models.Catalog;
Line 107:    @{


this is the text for manufactur in ProductTemplate.Simple.cshtml

<!--product manufacturers-->
@Html.Partial("_ProductManufacturers", Model.ProductManufacturers)
3 years ago
I manage to fix the manufactures:

Do you have an ide how i can make likes this brand:
http://prntscr.com/cjw49v

Min lookes like this:
http://prntscr.com/cjw4yl

And how i can add the manufactures like this in the product list:
http://prntscr.com/cjw5j3

Hope someone can help me.
3 years ago
If you can't come up with a programmatic solution, you might consider altering your product photos to include the brand logos...or maybe even use one of the Watermark generators to have the brand logo appear as a watermark on each product photo??
3 years ago
Also, there are plugins which allow you to display all your brand logos in a carousel, and link to the manufacturer page/product list:
https://www.nopcommerce.com/extensions-and-themes.aspx?searchterm=manufacturers

...or in your top menu:
http://nop4you.com/nopcommerce-menu-responsive

https://www.nop-templates.com/mega-menu-plugin-for-nopcommerce
3 years ago
thanks i whill check this out.
10 months ago
sohel wrote:
hello

Thanks for your answer...
I get this error :

Compiler Error Message: CS0103: The name 'item' does not exist in the current context

Try like bellow===>
DefaultClean File:~\Views\Product\_ProductManufacturers.cshtml


@model IList<ManufacturerModel>
@using Nop.Web.Models.Catalog;
   @{
        var pictureService = Nop.Core.Infrastructure.EngineContext.Current.Resolve<Nop.Services.Media.IPictureService>();
        var manufacturerService = Nop.Core.Infrastructure.EngineContext.Current.Resolve<Nop.Services.Catalog.IManufacturerService>();
    }

@if (Model.Count > 0)
{
    <div class="manufacturers">
        @if (Model.Count == 1)
        {
            <span class="label">@T("Products.Manufacturer"):</span>
        }
        else
        {
            <span class="label">@T("Products.Manufacturers"):</span>
        }
        <span class="value">
            @for (int i = 0; i < Model.Count; i++)
            {
                var item = Model[i];

                var manufacturer = manufacturerService.GetManufacturerById(item.Id);
                var pictureUrl = pictureService.GetPictureUrl(manufacturer.PictureId, 100);

                <a href="@Url.RouteUrl("Manufacturer", new {SeName = item.SeName})">
                    <img src="@pictureUrl" alt="@item.Name" title="@item.Name" />
                </a>
                if (i != Model.Count - 1)
                {
                <span class="separator">,</span>
                }
            }
        </span>
    </div>
}


Hi SOHEL,

I tried your code in ver 4.2 Beta but got the following error can you help in this regard.

The model item passed into the ViewDataDictionary is of type 'System.Collections.Generic.List`1[Nop.Web.Models.Catalog.ManufacturerBriefInfoModel]', but this ViewDataDictionary instance requires a model item of type 'System.Collections.Generic.IList`1[Nop.Web.Models.Catalog.ManufacturerModel]'.

Thanks in advance