Indicate locked/hidden items in admin create order

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
mouse_8b
Commander (CMDR)
Commander (CMDR)
Posts: 115
Joined: Mon Oct 11, 2010 1:21 pm
Location: Austin, TX
Contact:

Indicate locked/hidden items in admin create order

Post by mouse_8b » Mon Oct 10, 2011 9:31 am

Hello,
In the admin create order screen, is there a way to indicate on the search results if an item is locked or hidden?

Thanks

FredM
AbleCommerce Admin
AbleCommerce Admin
Posts: 35
Joined: Thu Nov 22, 2007 10:06 am

Re: Indicate locked/hidden items in admin create order

Post by FredM » Mon Oct 10, 2011 3:25 pm

Hello,
This is something that would need to be customized. By default you can only tell if an item is locked / hidden by viewing the category it is in.

mouse_8b
Commander (CMDR)
Commander (CMDR)
Posts: 115
Joined: Mon Oct 11, 2010 1:21 pm
Location: Austin, TX
Contact:

Re: Indicate locked/hidden items in admin create order

Post by mouse_8b » Wed Oct 12, 2011 11:36 am

I'm fine with customizations, I just don't know what to look for or what to change.

User avatar
david-ebt
Captain (CAPT)
Captain (CAPT)
Posts: 253
Joined: Fri Dec 31, 2010 10:12 am

Re: Indicate locked/hidden items in admin create order

Post by david-ebt » Wed Oct 12, 2011 5:17 pm

Are you interested in see if the product is public, private or hidden? If you're okay with a numerical representation, it's a pretty easy change. Looking at the CreateOrder2.aspx page, look for the FindProductSearchResults gridview control. Inside that control you'll find this code:

Code: Select all

<asp:BoundField DataField="Sku" HeaderText="SKU" SortExpression="Sku" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
Change it to this:

Code: Select all

<asp:BoundField DataField="Sku" HeaderText="SKU" SortExpression="Sku" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="VisibilityId" HeaderText="Visible" SortExpression="VisibilityId" />
And the search results will display the VisibilityID.
0 = Public
1 = Private
2 = Hidden

If you want the actual words you'll need to create a function in the code behind page that returns the correct text when you pass in the VisibilityID.

The function would look like this:

Code: Select all

	protected string GetVisible(object dataItem)
	{
		Product product = (Product)dataItem;
		switch (product.VisibilityId)
		{
		case 0:
			return "Public";
		case 1:
			return "Private";
		case 2:
			return "Hidden";
		default:
			return "Unknown";
		}
	}
and the gridview code would change to this:

Code: Select all

<asp:BoundField DataField="Sku" HeaderText="SKU" SortExpression="Sku" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:TemplateField HeaderText="Visible" SortExpression="VisibilityId">
    <ItemStyle HorizontalAlign="center" />
    <ItemTemplate>
        <asp:Label ID="VisibleLabel" runat="server" Text='<%# GetVisible(Container.DataItem) %>'></asp:Label>
    </ItemTemplate>
</asp:TemplateField>
Is that what you are trying to do? Or hopefully it will at least point you in the right direction.
David
http://www.ecombuildertoday.com
Enhanced Reporting for AbleCommerce
Image

mouse_8b
Commander (CMDR)
Commander (CMDR)
Posts: 115
Joined: Mon Oct 11, 2010 1:21 pm
Location: Austin, TX
Contact:

Re: Indicate locked/hidden items in admin create order

Post by mouse_8b » Fri Oct 14, 2011 4:51 pm

Thank you! This is exaclty what I needed.

If you want the backstory: We sell pet food. Each bag comes in 3 sizes. Our POS syncs each product to AC, which results in each size of food having its own product. For most foods, I have made a product that puts those 3 sizes as 3 variants and locked the original products. When I search for a food to add to an order, it will be much easier to tell which product to select now.

Again, thanks!

User avatar
david-ebt
Captain (CAPT)
Captain (CAPT)
Posts: 253
Joined: Fri Dec 31, 2010 10:12 am

Re: Indicate locked/hidden items in admin create order

Post by david-ebt » Fri Oct 14, 2011 7:10 pm

Happy to be of assistance!
David
http://www.ecombuildertoday.com
Enhanced Reporting for AbleCommerce
Image

Post Reply