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?
Displaying manufacturer logos in cats and product pages
-
- Commander (CMDR)
- Posts: 182
- Joined: Mon Oct 10, 2005 6:27 pm
- 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
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
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
-
- Commander (CMDR)
- Posts: 182
- Joined: Mon Oct 10, 2005 6:27 pm
Re: Displaying manufacturer logos in cats and product pages
I figured out how to display a picture in the CategoryList page:
Now, I would like to output a manufacturer picture in the AdvancedSearchPage.
I see the following code
How can I modify it to output a picture the way I did in the first snippet?
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>"));
I see the following code
Code: Select all
<asp:Label ID="Manufacturer" runat="server" Text='<%#GetManufacturerLink((int)Eval("ManufacturerId"))%>'></asp:Label>
- 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
You could do it from the code behind similar to the way the name is called now, replacing an image for the name.
You can adapt this snippet from a category page
Then return the image url the way the code now returns 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;
}
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));
}
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
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