Display Manufacturer Info

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 yıl önce
I think it's very useful to display manufacturer info on product details (name, picture, details) and also a "product from same manufacturer" link will be very useful.
Unfortunately I can't understand the way I can accomplish that.
Can someone help?
Thanks in advance
14 yıl önce
I found it!
Just in case somebody else will needed :
FileName : VariantsInGrid.ascx.cs
Add the following lines
                Int32 ManID = product.ProductManufacturers[0].ManufacturerID;
                ProductManufacturer manufacturer = ManufacturerManager.GetProductManufacturerByID(ManID);
                lName.Text = Server.HtmlEncode(manufacturer.Manufacturer.Name );
                lDescription.Text = manufacturer.Manufacturer.Description;
Just after line 50 : ctrlProductRating.Visible = product.AllowCustomerRatings;

FileName : VariantsInGrid.ascx
Add the following wherever you need the Manufacturer to be shown:
    <div class="ManufacturerTitle">
        <asp:Literal runat="server" ID="lName"></asp:Literal>
    </div>
    <div class="clear">
    </div>
    <div class="ManufacturerDescription">
        <asp:Literal runat="server" ID="lDescription"></asp:Literal>
    </div>
    <div class="clear">
    </div>
14 yıl önce
Some Improvents and here we are:
FileName : VariantsInGrid.ascx.cs
                Int32 ManID = product.ProductManufacturers[0].ManufacturerID;
                Manufacturer manufacturer = ManufacturerManager.GetManufacturerByID(ManID);
                lName.Text = Server.HtmlEncode(manufacturer.Name );
                lDescription.Text = manufacturer.Description;

                Picture manufacturerPicture = manufacturer.Picture;
                string pictureUrl = PictureManager.GetPictureUrl(manufacturerPicture, 100);
                this.iManufacturerPicture.Visible = true;
                this.iManufacturerPicture.ImageUrl = pictureUrl;

FileName : VariantsInGrid.ascx
    <div class="ManufacturerTitle">
        <asp:Image ID="iManufacturerPicture" runat="server" />    
        <asp:Literal runat="server" ID="lName"></asp:Literal>
    </div>
    <div class="clear">
    </div>
    <div class="ManufacturerDescription">
        <asp:Literal runat="server" ID="lDescription"></asp:Literal>
    </div>
    <div class="clear">
    </div>
14 yıl önce
You can check out the new 1.5version of nopCommerce, it uses the manufactures details like Manufacturer name and image related to each manufacturer
14 yıl önce
Firstly if you've upgraded to v1.5 and you are using the Single Item template for a product you need to be typing all the code into OneVariant. ascx and .cs otherwise you'll just keep typing away and see nothing until the penny drops !

I've been succesful in getting the SKU and the ManufacturerPartNumber to display (I'm not using description) but I can't get the manufacturer name or picture to display based on the above code. I think the name needs to go into the business logic, I can't remember if it's there of not so need to check that but the picture definitely won't work on the code above.

I get an warning in intellisense if I use productID although I have set it up as an identifier. I'm also getting an error about using ImageURL in the code.

Has anyone got the correct code to get the manufacturer name and picture onto the OneVariant page template ?

This works OK for SKU and ManufacturerPartNumber

existing code in OneVariant.ascx.cs :

            lProductName.Text = Server.HtmlEncode(product.Name);
            lShortDescription.Text = product.ShortDescription;
            lFullDescription.Text = product.FullDescription;
          
new SKU code :
  
            lSKU.Text = product.ProductVariants[0].SKU;

new ManufacturerPartNumber code :

            lManufacturerPartNumber.Text = product.ProductVariants[0].ManufacturerPartNumber;
            Int32 ManID = product.ProductManufacturers[0].ManufacturerID;
            var manufacturer = ManufacturerManager.GetProductManufacturerByID(ManID);

            not sure if all 3 lines are needed ?

new ManufacturersNameCode :

            lManufacturerName.Text = product.ProductVariants[0].ManufacturerName;

            I think this just needs an entry in the business logic.
14 yıl önce
I've got the SKU, manufacturer name and part number appearing on the product details page after searching the forums and doing some tinkering but the manufacturer image is still causing an error when I write the code.

I took this from the the post above :

Picture manufacturerPicture = manufacturer.Picture;
string pictureUrl = PictureManager.GetPictureUrl(manufacturerPicture, 100);
this.lManufacturerPicture.Visible = true;
this.lManufacturerPicture.ImageUrl = pictureUrl;

And this one from the manufacturers page :

var lManufacturerPicture = FindControl("lManufacturerPicture") as HyperLink;
lManufacturerPicture.ImageUrl = PictureManager.GetPictureUrl(manufacturer.PictureID,   SettingManager.GetSettingValueInteger("Media.Manufacturer.ThumbnailImageSize", 125), true);

And I keep getting "manufacturer does not exist in the current context" in the tool tip. Any ideas why the code is throwing up this error ? it's a straight cut & paste from the manufacturers.ascx.cs file ?

This all works OK tho':

OneVariant.ascx

lSKU.Text = product.ProductVariants[0].SKU;
lManufacturerPartNumber.Text = product.ProductVariants[0].ManufacturerPartNumber;
lManufacturerName.Text = product.ProductManufacturers[0].Manufacturer.Name;

OneVariant.ascx.cs

<asp:Literal ID="lSKU" runat="server" />
<asp:Label ID="lManufacturerPartNumber" runat="server" />
<asp:Label ID="lManufacturerName" runat="server" />
14 yıl önce
Hello everyone,
I am having trouble getting the name of the manufacturer to display immediately before the product name.  (with one space in between) (i.e. Sony Playstation)

I am using the latest version of NopCommerce (1.5)
I have confirmed that OneVarient.ascx is selected as the template for products
I have attempted to add the code to the corresponding files (OneVarient.ascx and OneVarient.asc.cs)
I re-ftp both files to my server, and nothing happens.

It seems like I am missing something.  I can edit OneVarient.ascx to display "test" but I cannot get the manufacturer name to display.  (Very important to my website)

see URL:
click here

Can anyone suggest what I should try next?  
I can't believe I can't get this!
14 yıl önce
I was able to sort the answers to my questions and get SKU, Manufacturer name, part number and picture to display.

The info was in the forums in part but still needed a little bit of work. Does look good with a brand logo alongside the product tho'.

For the OneVariant.ascx.cs :

            
            lSKU.Text = product.ProductVariants[0].SKU;
            
            lManufacturerPartNumber.Text = product.ProductVariants[0].ManufacturerPartNumber;
            
            lManufacturerName.Text = product.ProductManufacturers[0].Manufacturer.Name;

            Int32 ManID = product.ProductManufacturers[0].ManufacturerID;
            Manufacturer manufacturer = ManufacturerManager.GetManufacturerByID(ManID);
            Picture manufacturerPicture = manufacturer.Picture;
            string pictureUrl = PictureManager.GetPictureUrl(manufacturerPicture, 100);
            this.iManufacturerPicture.Visible = true;
            iManufacturerPicture.ImageUrl = pictureUrl;

For the OneVariant .aspx :
      
                <div class="SKU">
                <asp:Literal ID="lSKU" runat="server" />
                </div>
                <div class="ManufacturerPartNumber">
                <asp:Label ID="lManufacturerPartNumber" runat="server" />
                </div>
                <div class="ManufacturerName">
                <asp:Label ID="lManufacturerName" runat="server" />
                </div>
                <div class="ManufacturerPicture">
                <asp:Image ID="iManufacturerPicture" runat="server" />
                </div>


Still think the Manufacturer picture can display much more simply with two lines of code from looking elsewhere in other .cs files, but got it working so I'm happy.

Hope this helps.
14 yıl önce
You also need to re-compile, then ftp the files :-)


pobrian wrote:
Hello everyone,
I am having trouble getting the name of the manufacturer to display immediately before the product name.  (with one space in between) (i.e. Sony Playstation)

I am using the latest version of NopCommerce (1.5)
I have confirmed that OneVarient.ascx is selected as the template for products
I have attempted to add the code to the corresponding files (OneVarient.ascx and OneVarient.asc.cs)
I re-ftp both files to my server, and nothing happens.

It seems like I am missing something.  I can edit OneVarient.ascx to display "test" but I cannot get the manufacturer name to display.  (Very important to my website)

see URL:
http://testing.corporate-interiors.com/Products/93-steelcase-i2i.aspx click here

Can anyone suggest what I should try next?  
I can't believe I can't get this!
14 yıl önce
rcnopcom wrote:
I was able to sort the answers to my questions and get SKU, Manufacturer name, part number and picture to display.

The info was in the forums in part but still needed a little bit of work. Does look good with a brand logo alongside the product tho'.

For the OneVariant.ascx.cs :

            
            lSKU.Text = product.ProductVariants[0].SKU;
            
            lManufacturerPartNumber.Text = product.ProductVariants[0].ManufacturerPartNumber;
            
            lManufacturerName.Text = product.ProductManufacturers[0].Manufacturer.Name;

            Int32 ManID = product.ProductManufacturers[0].ManufacturerID;
            Manufacturer manufacturer = ManufacturerManager.GetManufacturerByID(ManID);
            Picture manufacturerPicture = manufacturer.Picture;
            string pictureUrl = PictureManager.GetPictureUrl(manufacturerPicture, 100);
            this.iManufacturerPicture.Visible = true;
            iManufacturerPicture.ImageUrl = pictureUrl;

For the OneVariant .aspx :
      
                <div class="SKU">
                <asp:Literal ID="lSKU" runat="server" />
                </div>
                <div class="ManufacturerPartNumber">
                <asp:Label ID="lManufacturerPartNumber" runat="server" />
                </div>
                <div class="ManufacturerName">
                <asp:Label ID="lManufacturerName" runat="server" />
                </div>
                <div class="ManufacturerPicture">
                <asp:Image ID="iManufacturerPicture" runat="server" />
                </div>


Still think the Manufacturer picture can display much more simply with two lines of code from looking elsewhere in other .cs files, but got it working so I'm happy.

Hope this helps.




hello. would you mind sending me your files in order to achieve this.. im trying... but can not.

mi email is

[email protected]

THANKS!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.