Page 1 of 1

Pull Sheet with Image

Posted: Mon Apr 04, 2011 1:48 pm
by SamsSteins
Would there be a way to have the pull sheet show the thumb nail image of each product?

Re: Pull Sheet with Image

Posted: Wed Apr 06, 2011 5:19 am
by mazhar
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)

Code: Select all

<asp:TemplateField HeaderText="Pulled" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <%#GetImage(Container.DataItem) %>
                    </ItemTemplate>
                </asp:TemplateField>
then add following code block to code behind file (.aspx.cs )

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));
    }

Re: Pull Sheet with Image

Posted: Wed Apr 06, 2011 7:46 am
by SamsSteins
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

Posted: Wed Apr 06, 2011 9:21 am
by mazhar
:) Glad that you were able to fix that typo.

Re: Pull Sheet with Image

Posted: Wed Apr 06, 2011 12:12 pm
by SamsSteins
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!