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

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Thistle3408
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Apr 19, 2010 4:52 pm

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

Post by Thistle3408 » Fri Oct 29, 2010 4:05 pm

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)?

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

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

Post by compunerdy » Sun Oct 31, 2010 11:40 pm

That is how they show in 7.0.5

Thistle3408
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Apr 19, 2010 4:52 pm

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

Post by Thistle3408 » Mon Nov 01, 2010 9:40 am

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?

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

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

Post by compunerdy » Mon Nov 01, 2010 10:48 am

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

Thistle3408
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Apr 19, 2010 4:52 pm

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

Post by Thistle3408 » Tue Nov 09, 2010 8:18 am

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)?

Post Reply