Page 1 of 1

Allow admin to access PrintMyOrder.aspx

Posted: Mon Aug 25, 2008 3:59 pm
by triplw
I am finding it difficult to fill orders for kitted products from the invoice in admin. The bulleted list that the customer can print from PrintMyOrder.aspx is much easier to read. I would like to be able to access this file to fill orders.
Could the PrintMyOrder.ascx.cs file be modified so anyone with admin privileges could access PrintMyOrder.aspx on the web and print the same thing the customer can?

Re: Allow admin to access PrintMyOrder.aspx

Posted: Mon Aug 25, 2008 7:37 pm
by voir
triplw wrote: Could the PrintMyOrder.ascx.cs file be modified so anyone with admin privileges could access PrintMyOrder.aspx on the web and print the same thing the customer can?
Changing this line:

Code: Select all

if (_Order.UserId != Token.Instance.UserId) Response.Redirect(NavigationHelper.GetStoreUrl(this.Page, "Members/MyAccount.aspx"));
To this one:

Code: Select all

if (_Order.UserId != Token.Instance.UserId && !Token.Instance.User.IsAdmin) Response.Redirect(NavigationHelper.GetStoreUrl(this.Page, "Members/MyAccount.aspx"));
Worked for me

Re: Allow admin to access PrintMyOrder.aspx

Posted: Mon Aug 25, 2008 7:51 pm
by triplw
Thanks, that's just what I needed. Now it would be great if I could have a link in the admin to the PrintMyOrder.aspx for each order so I won't have to manually type in the order number.
Can anyone help?

Re: Allow admin to access PrintMyOrder.aspx

Posted: Tue Aug 26, 2008 10:29 am
by voir
in /Admin/Orders/Default.aspx

Find this:

Code: Select all

 <asp:HyperLink ID="OrderId" runat="server" Text='<%# Eval("OrderId") %>' SkinID="Link" NavigateUrl='<%# Eval("OrderId", "ViewOrder.aspx?OrderId={0}") %>'></asp:HyperLink>
Add this(don't replace the other line):

Code: Select all

 <asp:HyperLink ID="PrintHyperLink1" runat="server" Text='Print' SkinID="Link" NavigateUrl='<%# Eval("OrderId", "../../Members/PrintMyOrder.aspx?OrderId={0}") %>'></asp:HyperLink>