Hide Private items in CreateOrder2.aspx

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.
Post Reply
bigbangtech
Commander (CMDR)
Commander (CMDR)
Posts: 182
Joined: Mon Oct 10, 2005 6:27 pm

Hide Private items in CreateOrder2.aspx

Post by bigbangtech » Wed Sep 29, 2010 7:11 pm

We have a lot of items that are constantly being worked on, but should not be available to our sales people when they are placing an order through the Admin. (They are set to Private)

1) Would anyone have some simple code that would hide Private items from being displayed in CreateOrder2.aspx?
Preferably this would be overridable with a drop-down box, with the default set not to show Private items.

2) Or it may be easier to display an icon next to Private item lines in CreateOrder2.aspx, but #1 above would be cleaner to the end-user.

Using 7.0.3
AC7.3

Need A Bulb? - Light bulbs for the building maintenance and construction industries

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Hide Private items in CreateOrder2.aspx

Post by mazhar » Thu Sep 30, 2010 4:58 am

Here is a small mod, this will show the visibility of each item next to other information in product grid on createorder2.aspx. Edit Wrebsite/Admin/Orders/Create/CreateOrder2.aspx file and locate following code block

Code: Select all

<asp:TemplateField HeaderText="Price" SortExpression="Price">
                                                <ItemStyle HorizontalAlign="right" Width="80px" />
                                                <ItemTemplate>
                                                    <uc:ProductPrice ID="ProductPrice1" runat="server" Product='<%#Container.DataItem%>' />
                                                </ItemTemplate>
                                            </asp:TemplateField>
and then replace it with

Code: Select all

<asp:TemplateField HeaderText="Price" SortExpression="Price">
                                                <ItemStyle HorizontalAlign="right" Width="80px" />
                                                <ItemTemplate>
                                                    <uc:ProductPrice ID="ProductPrice1" runat="server" Product='<%#Container.DataItem%>' />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Visibility" SortExpression="VisibilityId">
                                                <ItemStyle HorizontalAlign="Center" />
                                                <ItemTemplate>
                                                    <%#((CommerceBuilder.Catalog.CatalogVisibility)Eval("VisibilityId")).ToString()%>
                                                </ItemTemplate>
                                            </asp:TemplateField>
save the file and test again. It should now show the visibility info on page.

bigbangtech
Commander (CMDR)
Commander (CMDR)
Posts: 182
Joined: Mon Oct 10, 2005 6:27 pm

Re: Hide Private items in CreateOrder2.aspx

Post by bigbangtech » Thu Sep 30, 2010 9:20 am

Thanks, that works and shows Public or Private in a new column on the right hand side.

How can the code be modified to show the AddButton if it is Public, and nothing if it is not Public in that same column on the right side?
AC7.3

Need A Bulb? - Light bulbs for the building maintenance and construction industries

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Hide Private items in CreateOrder2.aspx

Post by mazhar » Thu Sep 30, 2010 11:08 am

Locate following code

Code: Select all

<asp:TemplateField>
                                                <ItemStyle Width="50px" HorizontalAlign="center" />
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="AddButton" runat="server" CommandName="Add" CommandArgument='<%#Eval("ProductId")%>' SkinID="AddIcon"/>
                                                </ItemTemplate>
                                            </asp:TemplateField>
and replace it with following

Code: Select all

<asp:TemplateField>
                                                <ItemStyle Width="50px" HorizontalAlign="center" />
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="AddButton" runat="server" CommandName="Add" CommandArgument='<%#Eval("ProductId")%>' SkinID="AddIcon" Visible='<%#((CommerceBuilder.Catalog.CatalogVisibility)Eval("VisibilityId")) == CommerceBuilder.Catalog.CatalogVisibility.Public%>' />
                                                </ItemTemplate>
                                            </asp:TemplateField>

Post Reply