Change Sku to ModelNumber on Packing Slip
-
- Commander (CMDR)
- Posts: 159
- Joined: Wed Feb 16, 2011 11:51 am
- Location: Indiana
- Contact:
Change Sku to ModelNumber on Packing Slip
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
Thanks,
Chris
Thanks,
Chris
http://www.networkcablesonline.com
Network Cables Online, LLC
Running AbleCommerce GOLD R6
Chris
http://www.networkcablesonline.com
Network Cables Online, LLC
Running AbleCommerce GOLD R6
- compunerdy
- Admiral (ADM)
- Posts: 1283
- Joined: Sun Nov 18, 2007 3:55 pm
Re: Change Sku to ModelNumber on Packing Slip
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.
-
- Commander (CMDR)
- Posts: 159
- Joined: Wed Feb 16, 2011 11:51 am
- Location: Indiana
- Contact:
Re: Change Sku to ModelNumber on Packing Slip
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.
Thanks,
Chris
http://www.networkcablesonline.com
Network Cables Online, LLC
Running AbleCommerce GOLD R6
Chris
http://www.networkcablesonline.com
Network Cables Online, LLC
Running AbleCommerce GOLD R6
Re: Change Sku to ModelNumber on Packing Slip
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:
Then change the PackingList.aspx file template to:
That should get you what you're looking for.
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());
}
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>
-
- Commander (CMDR)
- Posts: 159
- Joined: Wed Feb 16, 2011 11:51 am
- Location: Indiana
- Contact:
Re: Change Sku to ModelNumber on Packing Slip
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?
Thanks,
Chris
http://www.networkcablesonline.com
Network Cables Online, LLC
Running AbleCommerce GOLD R6
Chris
http://www.networkcablesonline.com
Network Cables Online, LLC
Running AbleCommerce GOLD R6
Re: Change Sku to ModelNumber on Packing Slip
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!
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!
-
- Commander (CMDR)
- Posts: 159
- Joined: Wed Feb 16, 2011 11:51 am
- Location: Indiana
- Contact:
Re: Change Sku to ModelNumber on Packing Slip
Yeah, I did notice that SKU is used everywhere. It wasn't a problem until we started using UPC codes.
Thanks,
Chris
http://www.networkcablesonline.com
Network Cables Online, LLC
Running AbleCommerce GOLD R6
Chris
http://www.networkcablesonline.com
Network Cables Online, LLC
Running AbleCommerce GOLD R6