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.
-
frankenstein897
- Commander (CMDR)

- Posts: 159
- Joined: Wed Feb 16, 2011 11:51 am
- Location: Indiana
-
Contact:
Post
by frankenstein897 » Thu May 10, 2012 7:37 am
I am looking at the PackingSlip.aspx file and I see sku in there. But, I can't change to ModelNumber without getting errors. I am sure I am not doing something correct. I am still learning Able. I am sure there is something else I need to do. Has anyone modified the packing slip to show model number instead of SKU? If so, care you give me a hint?
Thanks,
Chris
-
compunerdy
- Admiral (ADM)

- Posts: 1283
- Joined: Sun Nov 18, 2007 3:55 pm
Post
by compunerdy » Thu May 10, 2012 10:53 am
I do not have a answer but I wish they had a global setting to not show sku's. I want them for myself but I do not want my customers to see them all.
-
frankenstein897
- Commander (CMDR)

- Posts: 159
- Joined: Wed Feb 16, 2011 11:51 am
- Location: Indiana
-
Contact:
Post
by frankenstein897 » Thu May 10, 2012 11:20 am
Same here. We use the UPC code for the Sku which means nothing to most people. I just want the Model Number to show, especially on the Packing Slip. That is critical now.
-
david-ebt
- Captain (CAPT)

- Posts: 253
- Joined: Fri Dec 31, 2010 10:12 am
Post
by david-ebt » Thu May 10, 2012 11:22 am
I'm assuming you're working on the Admin\Orders\Shipments\PackingList.aspx file? You can add a new function to the PackingList.aspx.cs file:
Code: Select all
protected string GetModel(object dataItem)
{
OrderItem orderItem = (OrderItem)dataItem;
if (orderItem.OrderItemType == OrderItemType.Product) return orderItem.Product.ModelNumber;
return StringHelper.SpaceName(orderItem.OrderItemType.ToString());
}
Then change the PackingList.aspx file template to:
Code: Select all
<asp:TemplateField HeaderText="Model">
<HeaderStyle Width="80" HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="center" />
<ItemTemplate>
<asp:Literal ID="Model" runat="server" Text='<%# GetModel(Container.DataItem) %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
That should get you what you're looking for.
-
frankenstein897
- Commander (CMDR)

- Posts: 159
- Joined: Wed Feb 16, 2011 11:51 am
- Location: Indiana
-
Contact:
Post
by frankenstein897 » Thu May 10, 2012 11:47 am
Cool, does it matter where I put the function in the PackingList.aspx.cs file? Is at the end ok? And can I just put the template code in place of the line for the SKU?
-
david-ebt
- Captain (CAPT)

- Posts: 253
- Joined: Fri Dec 31, 2010 10:12 am
Post
by david-ebt » Thu May 10, 2012 12:06 pm
It doesn't matter where you put the function - right after the GetSku function is fine. It just has to be before that final closing curly brace. And yes you can just replace the SKU template code with this version.
The current AbleCommerce code is pretty dependent on the SKU value. If you compare the GetModel function with the GetSku function you'll notice that the SKU is part of the OrderItem object while the ModelNumber isn't - the code has to go back to the product record to get the ModelNumber. This means changing all references from SKU to Model Number is going to be a bit of a pain and often result is an extra database call. Maybe this will be easier to do in version 8!
-
frankenstein897
- Commander (CMDR)

- Posts: 159
- Joined: Wed Feb 16, 2011 11:51 am
- Location: Indiana
-
Contact:
Post
by frankenstein897 » Thu May 10, 2012 12:22 pm
Yeah, I did notice that SKU is used everywhere. It wasn't a problem until we started using UPC codes.