SKUs in Low Inventory

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
User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

SKUs in Low Inventory

Post by William_firefold » Mon Oct 27, 2008 9:55 am

Our stock manager has asked if we can get a column of SKUs on the /Admin/Reports/LowInventory.aspx page.
It should be possible to get it in there, I was having trouble doing it though.
Can anyone help with this? Thanks.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: SKUs in Low Inventory

Post by mazhar » Mon Oct 27, 2008 10:17 am

In order to do that first add following method to the report

Code: Select all

 public string GetSku(Object dataItem) 
    {
        ProductInventoryDetail detail = (ProductInventoryDetail)dataItem;
        Product product = ProductDataSource.Load(detail.ProductId);
        return product.Sku;
    }
and then add another column for Sku in InventoryGrid just below the Name column

Code: Select all

 <asp:TemplateField HeaderText="Sku" >
                                <ItemTemplate>
                                    <asp:HyperLink ID="ProductLink" runat="server" Text='<%# GetSku(Container.DataItem) %>' NavigateUrl='<%#Eval("ProductId", "../Products/EditProduct.aspx?ProductId={0}")%>'></asp:HyperLink>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:TemplateField>
This will make available another column showing the Sku of the product next to name column.

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: SKUs in Low Inventory

Post by William_firefold » Mon Oct 27, 2008 11:27 am

Thanks mazhar!
You are the Able forums gladiator.

Post Reply