Displaying manufacturer logos in cats and product pages

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
bigbangtech
Commander (CMDR)
Commander (CMDR)
Posts: 182
Joined: Mon Oct 10, 2005 6:27 pm

Displaying manufacturer logos in cats and product pages

Post by bigbangtech » Fri Oct 01, 2010 2:47 pm

It would be nice to display a small logo for each item's manufacturer in two places:

1) Near "Other products by..." on the product page

2) In category pages in list mode in the manufacturer column.

Anyone have any experience with this mod/code samples?
AC7.3

Need A Bulb? - Light bulbs for the building maintenance and construction industries

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Displaying manufacturer logos in cats and product pages

Post by jmestep » Sat Oct 02, 2010 6:27 am

I've done it by making a custom field and putting the link to the logo in that field. On another site, I have code in a custom conlib that takes the manufacturer name and has a switch statement that determines what logo to show. The easy part about that option is that you don't need to create/manage a custom field, but you do have to change code in the conlib if you add a new manufacturer. It might be a little slower perfomance-wise also.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

bigbangtech
Commander (CMDR)
Commander (CMDR)
Posts: 182
Joined: Mon Oct 10, 2005 6:27 pm

Re: Displaying manufacturer logos in cats and product pages

Post by bigbangtech » Tue Oct 19, 2010 4:43 pm

I figured out how to display a picture in the CategoryList page:

Code: Select all

itemTemplate1.Controls.Add(new LiteralControl("<td><a href=\"Search.aspx?m=" + product.Manufacturer.ManufacturerId + "\">" + product.Manufacturer.Name + "<br><img src=\"/Assets/mfrs/" + product.Manufacturer.Name + ".jpg\" border=\"0\"/></a></td>"));
Now, I would like to output a manufacturer picture in the AdvancedSearchPage.

I see the following code

Code: Select all

<asp:Label ID="Manufacturer" runat="server" Text='<%#GetManufacturerLink((int)Eval("ManufacturerId"))%>'></asp:Label>
How can I modify it to output a picture the way I did in the first snippet?
AC7.3

Need A Bulb? - Light bulbs for the building maintenance and construction industries

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Displaying manufacturer logos in cats and product pages

Post by jmestep » Wed Oct 20, 2010 3:29 am

You could do it from the code behind similar to the way the name is called now, replacing an image for the name.

Code: Select all

   protected string GetMSRP(object obj)
    {
        Product prod = obj as Product;
        if (prod != null && !prod.UseVariablePrice)
        {
            LSDecimal msrpWithVAT = TaxHelper.GetShopPrice(prod.MSRP, prod.TaxCodeId);
            if (msrpWithVAT > 0) return msrpWithVAT.ToString("ulc");
        }
        return string.Empty;
    }
You can adapt this snippet from a category page

Code: Select all

              //OUTPUT LINKED THUMNAIL
                if (!string.IsNullOrEmpty(product.ThumbnailUrl))
                {
                    string thumbnail = string.Format("<a href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" border=\"0\" class=\"Thumbnail\" /></a><br />", productUrl, ResolveUrl(product.ThumbnailUrl), product.ThumbnailAltText);
                   /////replace this itemTemplate1.Controls.Add(new LiteralControl(thumbnail));
                }

Then return the image url the way the code now returns the name
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Post Reply