Page 1 of 1

Bullet List of Kit Components on Invoice, Pack List, etc.

Posted: Fri Oct 29, 2010 4:05 pm
by Thistle3408
Right now I am focused on the Packing List, but I likely will need to pursue this on Invoices and maybe some other things.

Bottom line is that I want to list the Kits and the components on the packing list with the Kit Master left justified (no bullet) and the items that make up the kit (the components) with a bullet.

I know how to show this in an email. My order confirmation email has the code for this:

Code: Select all

#if ( ($orderItem.ParentItemId == $MasterID))
<li>$orderItem.Sku</li>
#elseif($orderItem.Product.KitStatus == "Master")
#set ($MasterID = ($orderItem.OrderItemId))
$orderItem.Sku
#elseif($orderItem.Product.KitStatus == "None")
$orderItem.Sku
#else
$orderItem.Sku
#end
But I am not smart enough to know how to do this in the PackingList.

I can see the .aspx code is:

Code: Select all

               <tr>
                    <td colspan="3" class="dataSheet">
                        <asp:GridView ID="ShipmentItems" runat="server" ShowHeader="true" 
                            AutoGenerateColumns="false" CellPadding=0 CellSpacing=0 GridLines="none" 
                            Width="100%" DataSource='<%#GetProducts(Container.DataItem)%>' CssClass="dataSheet">
                            <Columns>
                                <asp:BoundField DataField="Quantity" HeaderText="Quantity" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="Sku" HeaderText="Sku" ItemStyle-HorizontalAlign="Center" />
                                <asp:TemplateField HeaderText="Item">
                                    <ItemTemplate>
                                        <uc:OrderItemDetail ID="OrderItemDetail1" runat="server" OrderItem='<%#(OrderItem)Container.DataItem%>' ShowAssets="False" LinkProducts="False" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
And I think the .cs code is currently:

Code: Select all

    protected OrderItemCollection GetProducts(object dataItem)
    {
        OrderShipment shipment = (OrderShipment)dataItem;
        Order order = shipment.Order;
        OrderItemCollection products = new OrderItemCollection();
        foreach (OrderItem item in order.Items)
        {
            if ((item.OrderItemType == OrderItemType.Product) && (item.OrderShipmentId == shipment.OrderShipmentId))
            {
                products.Add(item);
            }
        }
        products.Sort(new OrderItemComparer());
        return products;
    }
Can someone help me figure out how to get bullets on the selected items (same logic as the email NVelocity above)?

Re: Bullet List of Kit Components on Invoice, Pack List, etc.

Posted: Sun Oct 31, 2010 11:40 pm
by compunerdy
That is how they show in 7.0.5

Re: Bullet List of Kit Components on Invoice, Pack List, etc.

Posted: Mon Nov 01, 2010 9:40 am
by Thistle3408
We're on 7.0.4

Is there a way to borrow some code from 7.0.5 or do I have to figure out how to do bullets on my own?

Re: Bullet List of Kit Components on Invoice, Pack List, etc.

Posted: Mon Nov 01, 2010 10:48 am
by compunerdy
PM me your E-mail address and I will send you the files and you can see if they will work with 7.0.4

Re: Bullet List of Kit Components on Invoice, Pack List, etc.

Posted: Tue Nov 09, 2010 8:18 am
by Thistle3408
Thanks Tim, but the only significant difference resulting from the actual "print" files you sent from 7.0.5 is one slight change in the inclusion or not of kit components. There is nothing I can see that causes bullets or not.

So, on 7.0.4 I am still trying to see what I need to do to fix the Pack Lists (PackSlips.aspx and PackSlips.aspx.cs) in order to have bullets on components of a kit.

The code (see initial post) in the aspx file that "displays" the items in the order is:

Code: Select all

<ItemTemplate>
          <uc:OrderItemDetail ID="OrderItemDetail1" runat="server" OrderItem='<%#(OrderItem)Container.DataItem%>' ShowAssets="False" LinkProducts="False" />
</ItemTemplate>
The code the passed that from the aspx.cs file is:

Code: Select all

  protected OrderItemCollection GetProducts(object dataItem)
    {
        OrderShipment shipment = (OrderShipment)dataItem;
        Order order = shipment.Order;
        OrderItemCollection products = new OrderItemCollection();
        foreach (OrderItem item in order.Items)
        {
            if ((item.OrderItemType == OrderItemType.Product) && (item.OrderShipmentId == shipment.OrderShipmentId))
            {
                products.Add(item);
            }
        }
        products.Sort(new OrderItemComparer());
        return products;
    }
So is there a way to add a bullet on the SKU and/or Item before the "products.Add(item);" statement? That's assuming I can add the logic to distinguish what items are "kit masters" and which as "kit components" (which I am pretty sure I know how to do)?