Pull Sheet with Image
-
- Lieutenant Commander (LCDR)
- Posts: 92
- Joined: Thu Jul 10, 2008 11:43 am
- Location: Lancaster PA
- Contact:
Pull Sheet with Image
Would there be a way to have the pull sheet show the thumb nail image of each product?
Re: Pull Sheet with Image
There is a complication. Upon pulls sheet returned OrderPullItem objects don't have product id information along with them. The only workaround could be to make use of Sku to load product to use thumbnail URL information. It could be something like
Add following column code to columns section on pullsheet page (.aspx file)
then add following code block to code behind file (.aspx.cs )
Add following column code to columns section on pullsheet page (.aspx file)
Code: Select all
<asp:TemplateField HeaderText="Pulled" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<%#GetImage(Container.DataItem) %>
</ItemTemplate>
</asp:TemplateField>
Code: Select all
public string GetImage(Object dataItem)
{
OrderPullItem item = (OrderPullItem)dataItem;
string sku = item.Sku;
if (string.IsNullOrEmpty(sku))
return string.Empty;
ProductCollection products = ProductDataSource.LoadForCriteria(string.Format("Sku = '{0}'", sku));
if (products == null && products.Count == 0)
return string.Empty;
Product product = products[0];
string thumbnailUrl = product.ThumbnailUrl;
if (string.IsNullOrEmpty(thumbnailUrl))
return string.Empty;
return string.Format("<img src='{0}' />", Page.ResolveUrl(thumbnailUrl));
}
-
- Lieutenant Commander (LCDR)
- Posts: 92
- Joined: Thu Jul 10, 2008 11:43 am
- Location: Lancaster PA
- Contact:
Re: Pull Sheet with Image
It worked, thank you so very much!!! Only one tiny thing need changed. You had "img scr" instead of img src.
Re: Pull Sheet with Image
Glad that you were able to fix that typo.
-
- Lieutenant Commander (LCDR)
- Posts: 92
- Joined: Thu Jul 10, 2008 11:43 am
- Location: Lancaster PA
- Contact:
Re: Pull Sheet with Image
I am not techy at all, that was ONLY thing I could have fixed. Thanks again, it will be a great time saver for us!