Displaying manufacturer logo on the product page.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
I am currently interning at a Dutch IT-company, and I'm working on my first professional webshop with nopCommerce. Although I am almost finished with the website, there is one problem that I've been unable to solve: My internship supervisor wants me to add a logo of the related menufacturer to each product page, instead of just the name with a link.

I've been looking online for solutions, but everything I find either seems to be outdated or doesn't work at all. The only variable my website seems to recognise is @item.PictureModel.ImageUrl, but for some reason it won't show the actual image.

One of my colleagues told me that I'll have to edit the Model to insert this function, but he is currently on vacation for a week, leaving me unable to continue on my project. So, I'm currently trying to find alternative ways to create a similar function.

Could anybody help me? This is what my code currently looks like:


@model IList<ManufacturerModel>
@using Nop.Web.Models.Catalog;
@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];
                <a href="@Url.RouteUrl("Manufacturer", new { SeName = item.SeName })">
      <img alt="@item.PictureModel.AlternateText" src="@item.PictureModel.ImageUrl" title="@item.PictureModel.Title" />
    </a>
                if (i != Model.Count - 1)
                {
                <span class="separator">,</span>
                }
            }
        </span>
    </div>
}
10 years ago
First you should fill PictureModel for each manufacturer in the ProductManufacturers method.
10 years ago
"Fill" PictureModel? What do you mean with that?

Could you show me an example, please?
10 years ago
//prepare picture model
int pictureSize = 100;
var categoryPictureCacheKey = string.Format(ModelCacheEventConsumer.MANUFACTURER_PICTURE_MODEL_KEY, x.Id, pictureSize, true, _workContext.WorkingLanguage.Id, _webHelper.IsCurrentConnectionSecured(), _storeContext.CurrentStore.Id);
m.PictureModel = _cacheManager.Get(categoryPictureCacheKey, () =>
{
    var pictureModel = new PictureModel()
    {
        FullSizeImageUrl = _pictureService.GetPictureUrl(x.Manufacturer.PictureId),
        ImageUrl = _pictureService.GetPictureUrl(x.Manufacturer.PictureId, pictureSize),
        Title = string.Format(_localizationService.GetResource("Media.Category.ImageLinkTitleFormat"), x.Manufacturer.Name),
        AlternateText = string.Format(_localizationService.GetResource("Media.Category.ImageAlternateTextFormat"), x.Manufacturer.Name)
    };
    return pictureModel;
});
10 years ago
Hi Madam !
       as You have given solutions but I am getting confused where the above logic should be placed in catalog controller.
10 years ago
amit140787 wrote:
Hi Madam !
       as You have given solutions but I am getting confused where the above logic should be placed in catalog controller.


You should place it between
var m = x.Manufacturer.ToModel();
and
return m;
lines in the ProductManufacturers() method of the CatalogController.
10 years ago
Thank you m'am ! Its working . Thank you ................
10 years ago
The activity of the animal beings has become acutely active everywhere on this earth. Bodies do not get time to booty a blow for a while. With the accretion use of altered gadgets of Gps Jammer, the possibilities of accepting the aboriginal of blow accept absolutely finished. The adaptable phones or the corpuscle phones are some of these accessories that accumulate the bodies consistently in blow with the alfresco world. The adaptable building are additionally accessible about everywhere these canicule and due to this the accessibility of the 4g cell phone jammer has become alike added quick and authentic. Today, you cannot break out of ability of these adaptable building as their signals can bolt your about anywhere. The bearings of bodies who accord to altered business professions has become actual analytical of wifi jammer as their authorities bolt them anywhere any moment.
9 years ago
Mariann wrote:
Hi Madam !
       as You have given solutions but I am getting confused where the above logic should be placed in catalog controller.

You should place it between
var m = x.Manufacturer.ToModel();
and
return m;
lines in the ProductManufacturers() method of the CatalogController.


I mam i have also the same requirement can u please tell me how to dispay the product logo in product_details page .please update the code
9 years ago
As you know that the mobile phone signal jammer can cut off the signals of the mobile phones and soon make it impossible to make phone calls or send messages. In this way when you need the peaceful condition and want to stay in it, you can just use the best mobile phone jammer to help you achieve your goal. And now as the technology develops with high speed the advanced 4g jammer has come into the market and are well welcomed by the group of people who need the jammer product.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.